openapi: 3.0.0 info: title: OnePageCRM API description: >- The OnePageCRM REST API. Full guides, a per-endpoint reference, and copy-ready examples live at https://developer.onepagecrm.com/. Built something with OnePageCRM? Tell us at https://forms.onepagecrm.com/65d470e49e344574cb4b3e5b/ or email support(at)onepagecrm(dot)com. Authentication is HTTP Basic: your username is your user_id and your password is your api_key. Find both at https://app.onepagecrm.com/app/api (API tab). Conventions — pagination (page, per_page), sorting (sort_by, order), time filters (since, until, modified_since), partial updates (partial=true) and undo deletion (undo=true) — are documented on the developer portal. termsOfService: 'https://www.onepagecrm.com/api-use' contact: name: OnePageCRM API Support url: https://developer.onepagecrm.com/ email: support@onepagecrm.com license: name: OnePageCRM API Terms of Use url: https://www.onepagecrm.com/api-use version: '3.0' servers: - url: 'https://app.onepagecrm.com/api/v3' description: Production Application Server security: - BasicAuth: [] tags: - name: Bootstrap description: "Account start-up data in a single call — settings, the logged user, and reference lists such as statuses and lead sources. Also used to log out or roll your API key." - name: Users description: "The logged user and the other members of the account. Each user can update their own details; admins can update anyone's." - name: Contacts description: "The people you're actively selling to. Each contact is the hub for its related actions, deals, notes, calls and meetings." - name: Companies description: "Organizations that group related contacts, with shared details like postal address and website. A company can hold its own deals and actions, and always exists alongside a contact (they're called 'organizations' in the app)." - name: Actions description: "The next steps to take on a contact — the heart of OnePageCRM. Actions sort ASAP first, then by due date (overdue first), then waiting-for, then undated queued items." - name: Action Stream description: "Your contacts ordered by when their next action is due — the default view in the OnePageCRM app." - name: Team Stream description: "The Action Stream across the whole account in one list, or for any single user — using the same next-action-due ordering." - name: Deals description: "Potential sales tracked against a contact — amount, stage, and expected or actual close date. Deals support file attachments." - name: Notes description: "Free-form information logged against a contact — meeting notes, context, or anything else relevant. Notes support file attachments." - name: Calls description: "Phone calls logged against a contact, including the number dialled and the result. Calls support file attachments." - name: Meetings description: "Meetings logged against a contact, including when they happened and the outcome. Meetings support file attachments." - name: Attachments description: "Files attached to a deal, note, call or meeting — stored in OnePageCRM (S3) or linked from Google Drive, Dropbox or Evernote." - name: Relationship Types description: "The labels used to describe how two contacts are related — for example 'colleague', 'spouse' or 'referred by'." - name: Pipelines description: "Your sales processes and the deal stages within them. Each product or service group can have its own pipeline." - name: Statuses description: "The stages a contact moves through in your sales process. The list comes pre-populated and can be edited to fit your account." - name: Lead Sources description: "How a contact first came to you. Like statuses, this list is pre-populated and can be edited to fit your account." - name: Filters description: "Saved, custom queries over your contacts. Filters are created in the app and can then be applied through the API." - name: Predefined Actions description: "Reusable action templates for steps you take often (called 'Saved Actions' in the app)." - name: Predefined Items description: "A configurable list of products or services, used to standardize deal creation." - name: Predefined Action Groups description: "Groups of predefined actions that can be applied together as a workflow." - name: Predefined Item Groups description: "Groups of predefined deal items that are sold together or complement one another." - name: Custom Fields description: "Extra, user-defined fields on contacts. Configurable by admins." - name: Company Fields description: "Extra, user-defined fields on companies. Configurable by admins." - name: Deal Fields description: "Extra, user-defined fields on deals. Configurable by admins." - name: Notifications description: "The logged user's in-app notifications (excludes email and link notifications)." - name: Countries description: "The countries OnePageCRM supports, with their ISO-3166 codes." - name: Web Hooks description: "A simple way to be notified when records change in OnePageCRM. Subscribe an endpoint and OnePageCRM POSTs each event as it happens." paths: /bootstrap: get: operationId: getBootstrap summary: Get useful information about the logged API user's account description: "Includes global account configuration such as lead sources and deal stages, and user-specific configuration such as date format and time zone." parameters: [] tags: - Bootstrap responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: $ref: '#/components/schemas/Bootstrap' lead_sources: $ref: '#/components/schemas/Lead_source' statuses: $ref: '#/components/schemas/Status' tags: description: >- Tags provide a means to classify contacts by however many tags you choose to attach to them. There are 2 types of tags, tags and system tags properties: tags: description: >- An array of custom tags. A custom tag is a user created tag used for categorising contacts type: array items: $ref: '#/components/schemas/Tag' system_tags: description: >- An array of system tags. A system tag is a system generate tag used for categorising contacts type: array items: $ref: '#/components/schemas/Tag' contacts_count: $ref: '#/components/schemas/Contacts_count' team_stream: $ref: '#/components/schemas/Team_stream' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' /change_auth_key: post: operationId: changeAuthKey summary: Invalidate the current API key and return a new API key description: >- **Warning:** This will change the users authentication key, and therefore log them out of all applications. Note: this includes the mobile applications. tags: - Bootstrap responses: 201: description: Created content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: auth_key: description: New API Key type: string example: wbJBo+odEikiDOjdnL+P+0fl+Dbgk84747jFtyOZghs= 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' /users: get: operationId: listUsers summary: Get the list of users (for the logged API user's account) description: "Returns every user on your account — name, email, photo, role and account rights. Your own record also includes bcc_email and google_contacts_email. The full team is returned, unpaginated." tags: - Users parameters: [] responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: type: array items: properties: user: $ref: '#/components/schemas/User' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /users/{user_id}: get: operationId: getUser summary: Get a specific user description: "Returns one user on your account by ID, including their name, email, photo, role and account rights. bcc_email and google_contacts_email are only included when the ID is your own." tags: - Users parameters: - $ref: '#/components/parameters/path_user_id' responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: user: $ref: '#/components/schemas/User' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' put: operationId: updateUser summary: Update a specific user description: >- Each team member can edit their own details; admins can update anyone's. The API can edit these fields: first_name, last_name, company, and bcc_email. Set bcc_email to true to generate a new BCC email address, otherwise omit it — you can only update bcc_email for yourself. tags: - Users parameters: - $ref: '#/components/parameters/path_user_id' requestBody: required: true content: application/json: schema: properties: first_name: $ref: '#/components/schemas/User/properties/first_name' last_name: $ref: '#/components/schemas/User/properties/last_name' company_name: $ref: '#/components/schemas/User/properties/company_name' bcc_email: type: string description: >- Should the BCC email address be re-generated for this user (you can only update this field for yourself) example: 'true' responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: user: $ref: '#/components/schemas/User' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /lead_sources: get: operationId: listLeadSources summary: Get the list of lead sources (for the logged API user's account) description: "Returns the account's lead sources with per-user and total contact counts, in alphabetical order. Each id is the source's system_id — the value contacts reference in their lead_source field." tags: - Lead Sources parameters: [] responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: type: array items: $ref: '#/components/schemas/Lead_source' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' post: operationId: createLeadSource summary: Create a new lead source description: "Creates a lead source. text is required and limited to 40 characters; the id is server-generated. Admin only. Adding one re-sorts the list, which is kept in alphabetical order." tags: - Lead Sources parameters: [] requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/Lead_source' responses: 201: description: Created content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: $ref: '#/components/schemas/Lead_source' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /lead_sources/{lead_source_id}: get: operationId: getLeadSource summary: Get a specific lead source description: "Returns one lead source with its contact counts. The path id is the source's system_id — the value contacts carry in their lead_source field — which is separate from the record's internal id. Built-in sources use short slugs like advertisement; ones you create get an ObjectId-style id." tags: - Lead Sources parameters: - $ref: '#/components/parameters/path_lead_source_id' responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: $ref: '#/components/schemas/Lead_source' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' put: operationId: updateLeadSource summary: Update a specific lead source description: "Updates a lead source's text (max 40 characters). Admin only. text is the only field; it is required unless you pass partial=true, which leaves the current value unchanged when omitted. The list is re-sorted alphabetically afterwards." tags: - Lead Sources parameters: - $ref: '#/components/parameters/path_lead_source_id' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/Lead_source' responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: $ref: '#/components/schemas/Lead_source' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' delete: operationId: deleteLeadSource summary: Delete a specific lead source description: "Deletes a lead source. Admin only. Contacts and webhooks referencing it have their lead_source cleared. The last remaining lead source cannot be deleted — an account must always keep at least one." tags: - Lead Sources parameters: - $ref: '#/components/parameters/path_lead_source_id' responses: 200: $ref: '#/components/responses/200' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /statuses: get: operationId: listStatuses summary: Get the list of statuses (for the logged API user's account) description: "Returns the account's contact statuses with per-user and total counts, in their configured order. The status field carries the system id (lead, custom1…) that contacts reference." tags: - Statuses parameters: [] responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: type: array items: properties: status: $ref: '#/components/schemas/Status' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' post: operationId: createStatus summary: Create a new status description: "Creates a contact status. text (max 20 characters) and color are required, description (max 33) is optional. Admin only. color must be one of the allowed palette values; the system id is server-assigned." tags: - Statuses parameters: [] requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/Status' responses: 201: description: Created content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: status: $ref: '#/components/schemas/Status' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /statuses/{status_id}: get: operationId: getStatus summary: Get a specific status description: "Returns one contact status with its counts. The path id is the status's own ObjectId, not the short system id in the status field — note this differs from lead sources, which are addressed by system id." tags: - Statuses parameters: - $ref: '#/components/parameters/path_status_id' responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: status: $ref: '#/components/schemas/Status' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' put: operationId: updateStatus summary: Update a specific status description: "Updates a contact status. Admin only. text and color are required on every request unless you pass partial=true, and description is cleared if you omit it on a non-partial update." tags: - Statuses parameters: - $ref: '#/components/parameters/path_status_id' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/Status' responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: status: $ref: '#/components/schemas/Status' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' delete: operationId: deleteStatus summary: Delete a specific status description: "Deletes a contact status. Admin only. Contacts, companies and webhooks using it fall back to the lead status. The built-in lead status itself cannot be deleted." tags: - Statuses parameters: - $ref: '#/components/parameters/path_status_id' responses: 200: description: OK 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /deal_fields: get: operationId: listDealFields summary: Get the list of deal fields (for the logged API user's account) description: "Returns the custom fields defined for deals on your account — id, name, type, position and, for select_box and multiple_choice fields, their choices. Deal fields are separate from contact and company custom fields." tags: - Deal Fields parameters: - $ref: '#/components/parameters/query_custom_fields_sort_by' - $ref: '#/components/parameters/query_order' - $ref: '#/components/parameters/query_page' - $ref: '#/components/parameters/query_per_page' responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: deal_fields: type: array items: properties: deal_field: $ref: '#/components/schemas/Deal_field' total_count: $ref: '#/components/schemas/Page_data/properties/total_count' page: $ref: '#/components/schemas/Page_data/properties/page' per_page: $ref: '#/components/schemas/Page_data/properties/per_page' max_page: $ref: '#/components/schemas/Page_data/properties/max_page' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' post: operationId: createDealField summary: Create a deal field description: Only admins can create deal fields. tags: - Deal Fields parameters: [] requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/Deal_field' responses: 201: description: Created content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: deal_field: $ref: '#/components/schemas/Deal_field' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /deal_fields/{deal_field_id}: get: operationId: getDealField summary: Get a specific deal field description: "Returns one deal custom field by ID, including its type and — for select_box and multiple_choice fields — the choices available. Unlike contact custom fields, deal fields cannot be of type anniversary." tags: - Deal Fields parameters: - $ref: '#/components/parameters/path_deal_field_id' responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: deal_field: $ref: '#/components/schemas/Deal_field' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' put: operationId: updateDealField summary: Update a specific deal field description: Only admins can update deal fields. tags: - Deal Fields parameters: - $ref: '#/components/parameters/path_deal_field_id' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/Deal_field' responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: deal_field: $ref: '#/components/schemas/Deal_field' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' delete: operationId: deleteDealField summary: Delete a specific deal field description: Only admins can delete deal fields. tags: - Deal Fields parameters: - $ref: '#/components/parameters/path_deal_field_id' responses: 200: $ref: '#/components/responses/200' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /custom_fields: get: operationId: listCustomFields summary: Get the list of custom fields (for the logged API user's account) description: "Returns the custom fields defined for contacts on your account — id, name, type, position and, for select_box and multiple_choice fields, their choices. Filter by type, and sort by position (the default), created_at or modified_at." tags: - Custom Fields parameters: - $ref: '#/components/parameters/query_custom_fields_sort_by' - $ref: '#/components/parameters/query_order' - $ref: '#/components/parameters/query_page' - $ref: '#/components/parameters/query_per_page' responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: custom_fields: type: array items: properties: custom_field: $ref: '#/components/schemas/Custom_field' total_count: $ref: '#/components/schemas/Page_data/properties/total_count' page: $ref: '#/components/schemas/Page_data/properties/page' per_page: $ref: '#/components/schemas/Page_data/properties/per_page' max_page: $ref: '#/components/schemas/Page_data/properties/max_page' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' post: operationId: createCustomField summary: Create a new custom field description: Only admins can create custom fields. tags: - Custom Fields parameters: [] requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/Custom_field' responses: 201: description: Created content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: custom_field: $ref: '#/components/schemas/Custom_field' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /custom_fields/{custom_field_id}: get: operationId: getCustomField summary: Get a specific custom field description: "Returns one contact custom field by ID, including its type and — for select_box and multiple_choice fields — the list of choices available. Anniversary fields also carry reminder_days." tags: - Custom Fields parameters: - $ref: '#/components/parameters/path_custom_field_id' responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: custom_field: $ref: '#/components/schemas/Custom_field' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' put: operationId: updateCustomField summary: Update a specific custom field description: Only admins can update custom fields. tags: - Custom Fields parameters: - $ref: '#/components/parameters/path_custom_field_id' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/Custom_field' responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: custom_field: $ref: '#/components/schemas/Custom_field' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' delete: operationId: deleteCustomField summary: Delete a specific custom field description: Only admins can delete custom fields. tags: - Custom Fields parameters: - $ref: '#/components/parameters/path_custom_field_id' responses: 200: $ref: '#/components/responses/200' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /company_fields: get: operationId: listCompanyFields summary: Get the list of company fields (for the logged API user's account) description: "Returns the custom fields defined for companies on your account — id, name, type, position and, for select_box and multiple_choice fields, their choices. These are separate from contact custom fields and deal fields." tags: - Company Fields parameters: - $ref: '#/components/parameters/query_custom_fields_sort_by' - $ref: '#/components/parameters/query_order' - $ref: '#/components/parameters/query_page' - $ref: '#/components/parameters/query_per_page' responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: company_fields: type: array items: properties: company_field: $ref: '#/components/schemas/Company_field' total_count: $ref: '#/components/schemas/Page_data/properties/total_count' page: $ref: '#/components/schemas/Page_data/properties/page' per_page: $ref: '#/components/schemas/Page_data/properties/per_page' max_page: $ref: '#/components/schemas/Page_data/properties/max_page' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' post: operationId: createCompanyField summary: Create a new company field description: Only admins can create company fields. tags: - Company Fields parameters: [] requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/Company_field' responses: 201: description: Created content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: company_field: $ref: '#/components/schemas/Company_field' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /company_fields/{company_field_id}: get: operationId: getCompanyField summary: Get a specific company field description: "Returns one company custom field by ID, including its type and — for select_box and multiple_choice fields — the choices available. Company fields are numbered separately from contact and deal fields." tags: - Company Fields parameters: - $ref: '#/components/parameters/path_company_field_id' responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: company_field: $ref: '#/components/schemas/Company_field' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' put: operationId: updateCompanyField summary: Update a specific company field description: Only admins can update company fields. tags: - Company Fields parameters: - $ref: '#/components/parameters/path_company_field_id' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/Company_field' responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: company_field: $ref: '#/components/schemas/Company_field' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' delete: operationId: deleteCompanyField summary: Delete a specific company field description: Only admins can delete company fields. tags: - Company Fields parameters: - $ref: '#/components/parameters/path_company_field_id' responses: 200: $ref: '#/components/responses/200' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /predefined_actions: get: operationId: listPredefinedActions summary: Get the list of predefined actions (for the logged API user's account) description: "Returns the account's predefined actions — reusable next-action templates, each with the text to apply and a days offset used to calculate the due date. Actions that belong to a group are included, and carry that group's action_group_id." tags: - Predefined Actions parameters: [] responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: predefined_actions: type: array items: properties: predefined_action: $ref: '#/components/schemas/Predefined_action' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' post: operationId: createPredefinedAction summary: Create a new predefined action description: "Creates a predefined action template. text (max 140 characters) and days are required; text can embed placeholders like [first name] that are substituted when the action is applied to a contact." tags: - Predefined Actions parameters: [] requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/Predefined_action' responses: 201: description: Created content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: predefined_action: $ref: '#/components/schemas/Predefined_action' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /predefined_actions/{predefined_action_id}: get: operationId: getPredefinedAction summary: Get a specific predefined action description: "Returns one predefined action template, including its text, days offset and the action_group_id of the group it belongs to. Passing a group's ID here returns not-found — use the predefined action groups endpoint for those." tags: - Predefined Actions parameters: - $ref: '#/components/parameters/path_predefined_action_id' responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: predefined_action: $ref: '#/components/schemas/Predefined_action' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' put: operationId: updatePredefinedAction summary: Update a specific predefined action description: "Updates a predefined action template's text (max 140 characters), days offset or position — but not its group membership, which is silently ignored if you send action_group_id. Use the groups endpoint to move an action between groups." tags: - Predefined Actions parameters: - $ref: '#/components/parameters/path_predefined_action_id' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/Predefined_action' responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: predefined_action: $ref: '#/components/schemas/Predefined_action' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' delete: operationId: deletePredefinedAction summary: Delete a specific predefined action description: "Deletes a predefined action template. Actions already created from it on contacts are untouched. If this leaves its group with fewer than two members, the group is dissolved automatically." tags: - Predefined Actions parameters: - $ref: '#/components/parameters/path_predefined_action_id' responses: 200: $ref: '#/components/responses/200' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /predefined_action_groups: get: operationId: listPredefinedActionGroups summary: Get the list of predefined action groups (for the logged API user's account) description: "Returns the account's predefined action groups. A group bundles two or more predefined action templates so they can all be applied to a contact in one request, each with its own due date." tags: - Predefined Action Groups parameters: [] responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: predefined_action_groups: type: array items: properties: predefined_action_group: $ref: '#/components/schemas/Predefined_action_group' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' post: operationId: createPredefinedActionGroup summary: Create a new predefined action group description: "Creates a predefined action group. text is required and action_ids must list at least two existing, currently ungrouped predefined actions. Names longer than 127 characters are truncated on save." tags: - Predefined Action Groups parameters: [] requestBody: required: true content: application/json: schema: properties: text: type: string description: Name of the predefined action group example: Follow-up sequence position: type: integer format: int32 description: Position of the group in the list of predefined action groups example: 0 action_ids: type: array description: List of IDs of the predefined actions in the predefined action group items: type: string format: bson-id example: - 5acddaa7d556733c507ff405 - 5acddaa7d556733c507ff406 responses: 201: description: Created content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: predefined_action_group: $ref: '#/components/schemas/Predefined_action_group' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /predefined_action_groups/{predefined_action_group_id}: get: operationId: getPredefinedActionGroup summary: Get a specific predefined action group description: "Returns one predefined action group, including action_ids — the templates that currently belong to it, resolved live. Passing a plain predefined action's ID here returns not-found." tags: - Predefined Action Groups parameters: - $ref: '#/components/parameters/path_predefined_action_group_id' responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: predefined_action_group: $ref: '#/components/schemas/Predefined_action_group' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' put: operationId: updatePredefinedActionGroup summary: Update a specific predefined action group description: "Updates a predefined action group. action_ids replaces the group's membership outright rather than adding to it; actions dropped from the list are ungrouped, not deleted. Actions already in another group are rejected." tags: - Predefined Action Groups parameters: - $ref: '#/components/parameters/path_predefined_action_group_id' requestBody: required: true content: application/json: schema: properties: text: type: string description: Name of the predefined action group example: Follow-up sequence position: type: integer format: int32 description: Position of the group in the list of predefined action groups example: 0 action_ids: type: array description: List of IDs of the predefined actions in the predefined action group items: type: string format: bson-id example: - 5acddaa7d556733c507ff405 - 5acddaa7d556733c507ff406 responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: predefined_action_group: $ref: '#/components/schemas/Predefined_action_group' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' delete: operationId: deletePredefinedActionGroup summary: Delete a specific predefined action group description: "Deletes a predefined action group. The action templates it contained are kept and simply become ungrouped — deleting a group never deletes its actions." tags: - Predefined Action Groups parameters: - $ref: '#/components/parameters/path_predefined_action_group_id' responses: 200: $ref: '#/components/responses/200' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /predefined_items: get: operationId: listPredefinedItems summary: Get the list of predefined items (for the logged API user's account) description: "Returns the account's predefined items — reusable products or services with a name, description, cost and price that can be dropped onto a deal as line items. Search by name, and page through with page and per_page." tags: - Predefined Items parameters: [] responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: predefined_items: type: array items: properties: predefined_item: $ref: '#/components/schemas/Predefined_item' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' post: operationId: createPredefinedItem summary: Create a new predefined item description: "Creates a predefined item. name is required and must be unique on the account; description, cost and price are optional. Requires the deal items permission. Accounts are capped at 1000 predefined items." tags: - Predefined Items parameters: [] requestBody: required: true content: application/json: schema: properties: name: type: string description: Name of the predefined item example: Solar panels description: type: string description: Description text of the predefined item example: Photovoltaic solar panels (2019 model) cost: type: number format: float description: Cost of the predefined item (if deals costs are enabled) example: 95.00 price: type: number format: float description: Price of the predefined item example: 149.99 responses: 201: description: Created content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: predefined_item: $ref: '#/components/schemas/Predefined_item' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /predefined_items/{predefined_item_id}: get: operationId: getPredefinedItem summary: Get a specific predefined item description: "Returns one predefined item — a reusable product or service with its name, description, cost and price, used as a template for deal line items." tags: - Predefined Items parameters: - $ref: '#/components/parameters/path_predefined_item_id' responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: predefined_item: $ref: '#/components/schemas/Predefined_item' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' put: operationId: updatePredefinedItem summary: Update a specific predefined item description: "Updates a predefined item. Requires the deal items permission. Pass partial=true to leave omitted fields untouched; without it, an omitted description, cost or price is reset to its default." tags: - Predefined Items parameters: - $ref: '#/components/parameters/path_predefined_item_id' requestBody: required: true content: application/json: schema: properties: name: type: string description: Name of the predefined item example: Solar panels description: type: string description: Description text of the predefined item example: Photovoltaic solar panels (2019 model) cost: type: number format: float description: Cost of the predefined item (if deals costs are enabled) example: 95.00 price: type: number format: float description: Price of the predefined item example: 149.99 responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: predefined_item: $ref: '#/components/schemas/Predefined_item' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' delete: operationId: deletePredefinedItem summary: Delete a specific predefined item description: "Deletes a predefined item. Requires the deal items permission. Line items already added to deals keep their own copy of the name, cost and price, so existing deals are unaffected." tags: - Predefined Items parameters: - $ref: '#/components/parameters/path_predefined_item_id' responses: 200: $ref: '#/components/responses/200' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /predefined_item_groups: get: operationId: listPredefinedItemGroups summary: Get the list of predefined item groups (for the logged API user's account) description: "Returns the account's predefined item groups. A group bundles predefined items under one name, and its cost and price are the sums of its members. Pass include_items to embed the items themselves." tags: - Predefined Item Groups parameters: [] responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: predefined_item_groups: type: array items: properties: predefined_item_group: $ref: '#/components/schemas/Predefined_item_group' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' post: operationId: createPredefinedItemGroup summary: Create a new predefined item group description: "Creates a predefined item group. name is required and must be unique on the account, and items_ids lists the predefined items to bundle (up to 200). The group's cost and price are derived from its members." tags: - Predefined Item Groups parameters: [] requestBody: required: true content: application/json: schema: properties: name: type: string description: Name of the predefined item group example: Electronics deal_items: type: array description: List of IDs of the predefined/deal items in the predefined item group items: type: string format: bson-id example: - 5c79510e9007ba3f7519e819 - 5c9a53349007ba58f13c8118 responses: 201: description: Created content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: predefined_item: $ref: '#/components/schemas/Predefined_item_group' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /predefined_item_groups/{predefined_item_group_id}: get: operationId: getPredefinedItemGroup summary: Get a specific predefined item group description: "Returns one predefined item group with the items it bundles. Its cost and price are the totals of its member items, and subcount is the number of item IDs the group holds." tags: - Predefined Item Groups parameters: - $ref: '#/components/parameters/path_predefined_item_group_id' responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: predefined_item_group: $ref: '#/components/schemas/Predefined_item_group' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' delete: operationId: deletePredefinedItemGroup summary: Delete a specific predefined item group description: "Deletes a predefined item group. The predefined items it bundled are not deleted — only the grouping is removed." tags: - Predefined Item Groups parameters: - $ref: '#/components/parameters/path_predefined_item_group_id' responses: 200: $ref: '#/components/responses/200' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /notes: get: operationId: listNotes summary: Get a list of notes description: "Returns notes logged against your contacts. A note can also be linked to a deal." tags: - Notes parameters: - $ref: '#/components/parameters/query_notes_contact_id' - $ref: '#/components/parameters/query_notes_company_id' - $ref: '#/components/parameters/query_notes_date_filter' - $ref: '#/components/parameters/query_since' - $ref: '#/components/parameters/query_until' - $ref: '#/components/parameters/query_modified_since' - $ref: '#/components/parameters/query_unmodified_since' - $ref: '#/components/parameters/query_notes_sort_by' - $ref: '#/components/parameters/query_order' - $ref: '#/components/parameters/query_page' - $ref: '#/components/parameters/query_per_page' responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: notes: type: array items: properties: note: $ref: '#/components/schemas/Note' total_count: $ref: '#/components/schemas/Page_data/properties/total_count' page: $ref: '#/components/schemas/Page_data/properties/page' per_page: $ref: '#/components/schemas/Page_data/properties/per_page' max_page: $ref: '#/components/schemas/Page_data/properties/max_page' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' post: operationId: createNote summary: Create a note description: "Logs a note against a contact. contact_id is required; text carries the note body; link a deal with linked_deal_id. Logging a note updates the contact's last activity date." tags: - Notes parameters: [] requestBody: required: true content: application/json: schema: properties: contact_id: $ref: '#/components/schemas/Note/properties/contact_id' text: $ref: '#/components/schemas/Note/properties/text' date: $ref: '#/components/schemas/Note/properties/date' linked_deal_id: type: string format: bson-id nullable: true example: '' user_ids_to_notify: type: array description: A list of user IDs to notify items: type: string format: bson-id example: 5aba31e99007ba0f570c12f7 responses: 201: description: Created content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: note: $ref: '#/components/schemas/Note' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /notes/{note_id}: get: operationId: getNote summary: Get a specific note description: "Returns one note — its text, author, date, the contact it belongs to, any attachments, and the linked deal if there is one. Any user who can see the note's contact can read it, not just its author." tags: - Notes parameters: - $ref: '#/components/parameters/path_note_id' responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: note: $ref: '#/components/schemas/Note' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' put: operationId: updateNote summary: Update a specific note description: "Updates a note. The author display name stays with the original author." tags: - Notes parameters: - $ref: '#/components/parameters/path_note_id' requestBody: required: true content: application/json: schema: properties: contact_id: $ref: '#/components/schemas/Note/properties/contact_id' text: $ref: '#/components/schemas/Note/properties/text' date: $ref: '#/components/schemas/Note/properties/date' linked_deal_id: type: string format: bson-id nullable: true example: '' user_ids_to_notify: type: array description: A list of user IDs to notify items: type: string format: bson-id example: 5aba31e99007ba0f570c12f7 responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: note: $ref: '#/components/schemas/Note' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' delete: operationId: deleteNote summary: Delete a specific note description: "Deletes a note permanently — the API has no undo, unlike deleting from the web app. Its attachments are removed with it and the note disappears from the contact's timeline. Any user who can see the contact can delete it." tags: - Notes parameters: - $ref: '#/components/parameters/path_note_id' responses: 200: $ref: '#/components/responses/200' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /notes/{note_id}/attachments: post: operationId: addNoteAttachment summary: Create attachment and assign it to an existing note tags: - Notes description: >- Before creating an attachment, the file should be uploaded to S3. Make a request to `attachments/s3_form` for a pre-authorized upload form. Following successful upload to S3, files can be attached via this endpoint. parameters: - $ref: '#/components/parameters/path_note_id' requestBody: required: true content: application/json: schema: required: - reference_type - key properties: reference_id: type: string format: bson-id description: ID of the note associated with the attachment example: 5afc1b69d556730b580596cb reference_type: type: string description: Type of resource is associated with the attachment enum: [ deal, note, call, meeting ] example: note contact_id: $ref: '#/components/schemas/Note/properties/contact_id' name: $ref: '#/components/schemas/Attachment/properties/filename' key: type: string description: >- The same key used in the `attachments/s3_form`, composed as `{contact_id}/{timestamp}/{filename}` example: 5ae06ef9d55673108fe8877f/1530520812224/mario.jpg size: $ref: '#/components/schemas/Attachment/properties/size' link_type: type: string description: Type of external link (for external `storage_provider`s) enum: [ dropbox, google_drive, evernote ] nullable: true example: null external_url: type: string description: URL for the file (for use with external `storage_provider`s) nullable: true example: '' responses: 201: description: Created content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: attachment: $ref: '#/components/schemas/Attachment' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /calls: get: operationId: listCalls summary: Get a list of calls description: "Returns calls logged against your contacts, including the result of each." tags: - Calls parameters: - $ref: '#/components/parameters/query_calls_contact_id' - $ref: '#/components/parameters/query_calls_company_id' - $ref: '#/components/parameters/query_calls_date_filter' - $ref: '#/components/parameters/query_since' - $ref: '#/components/parameters/query_until' - $ref: '#/components/parameters/query_modified_since' - $ref: '#/components/parameters/query_unmodified_since' - $ref: '#/components/parameters/query_calls_sort_by' - $ref: '#/components/parameters/query_order' - $ref: '#/components/parameters/query_page' - $ref: '#/components/parameters/query_per_page' responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: calls: type: array items: properties: call: $ref: '#/components/schemas/Call' total_count: $ref: '#/components/schemas/Page_data/properties/total_count' page: $ref: '#/components/schemas/Page_data/properties/page' per_page: $ref: '#/components/schemas/Page_data/properties/per_page' max_page: $ref: '#/components/schemas/Page_data/properties/max_page' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' post: operationId: createCall summary: Create a call description: "Logs a phone call against a contact. contact_id is required; record the outcome with call_result (from the account's configured results), plus the number dialled and an optional recording link." tags: - Calls parameters: [] requestBody: required: true content: application/json: schema: properties: contact_id: $ref: '#/components/schemas/Call/properties/contact_id' call_time_int: $ref: '#/components/schemas/Call/properties/call_time_int' text: $ref: '#/components/schemas/Call/properties/text' phone_number: $ref: '#/components/schemas/Call/properties/phone_number' call_result: $ref: '#/components/schemas/Call/properties/call_result' via: $ref: '#/components/schemas/Call/properties/via' recording_link: $ref: '#/components/schemas/Call/properties/recording_link' user_ids_to_notify: type: array description: A list of user IDs to notify items: type: string format: bson-id example: 5aba31e99007ba0f570c12f7 responses: 201: description: Created content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: call: $ref: '#/components/schemas/Call' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /calls/{call_id}: get: operationId: getCall summary: Get a specific call description: "Returns one logged call — its text, author, result, call time, phone number, the contact it belongs to, and any attachments. Any user who can see the call's contact can read it, not just its author." tags: - Calls parameters: - $ref: '#/components/parameters/path_call_id' responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: call: $ref: '#/components/schemas/Call' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' put: operationId: updateCall summary: Update a specific call description: "Updates a call. The author display name stays with the original author." tags: - Calls parameters: - $ref: '#/components/parameters/path_call_id' requestBody: required: true content: application/json: schema: properties: contact_id: $ref: '#/components/schemas/Call/properties/contact_id' call_time_int: $ref: '#/components/schemas/Call/properties/call_time_int' text: $ref: '#/components/schemas/Call/properties/text' phone_number: $ref: '#/components/schemas/Call/properties/phone_number' call_result: $ref: '#/components/schemas/Call/properties/call_result' via: $ref: '#/components/schemas/Call/properties/via' recording_link: $ref: '#/components/schemas/Call/properties/recording_link' user_ids_to_notify: type: array description: A list of user IDs to notify items: type: string format: bson-id example: 5aba31e99007ba0f570c12f7 responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: call: $ref: '#/components/schemas/Call' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' delete: operationId: deleteCall summary: Delete a specific call description: "Deletes a logged call permanently — the API has no undo, unlike the web app. Its attachments go with it, it leaves the contact's timeline, and the author's call targets are recalculated." tags: - Calls parameters: - $ref: '#/components/parameters/path_call_id' responses: 200: $ref: '#/components/responses/200' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /calls/{call_id}/attachments: post: operationId: addCallAttachment summary: Create attachment and assign it to an existing call description: >- Before creating an attachment, the file should be uploaded to S3. Make a request to `attachments/s3_form` for a pre-authorized upload form. Following successful upload to S3, files can be attached via this endpoint. tags: - Calls parameters: - $ref: '#/components/parameters/path_call_id' requestBody: required: true content: application/json: schema: required: - reference_type - key properties: reference_id: type: string format: bson-id description: ID of the call associated with the attachment example: 5afc1b69d556730b580596cb reference_type: type: string description: Type of resource is associated with the attachment enum: [ deal, note, call ] example: call contact_id: $ref: '#/components/schemas/Note/properties/contact_id' name: $ref: '#/components/schemas/Attachment/properties/filename' key: type: string description: >- The same key used in the `attachments/s3_form`, composed as `{contact_id}/{timestamp}/{filename}` example: 5ae06ef9d55673108fe8877f/1530520812224/mario.jpg size: $ref: '#/components/schemas/Attachment/properties/size' link_type: type: string description: Type of external link (for external `storage_provider`s) enum: [ dropbox, google_drive, evernote ] nullable: true example: null external_url: type: string description: URL for the file (for use with external `storage_provider`s) nullable: true example: '' responses: 201: description: Created content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: attachment: $ref: '#/components/schemas/Attachment' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /call_results: get: operationId: listCallResults summary: Get the list of call results (for the logged API user's account) description: >- Includes: The call results for the account.; The counts of their usages for the logged API user, and their team. tags: - Calls parameters: [] responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: type: array items: properties: call_result: properties: result: type: string format: bson-id description: ID of the call result example: interested text: type: string description: Display text of the call result example: Interested counts: type: integer format: int32 description: The number of calls for the logged API user, with the call result readOnly: true example: 5 total_counts: type: integer format: int32 description: The number of calls for the entire account, with the call result readOnly: true example: 5 team_counts: type: array description: The number of calls for each user, with the call result readOnly: true items: properties: user_id: $ref: '#/components/schemas/User/properties/id' counts: type: integer format: int32 description: Number of calls for the user, with the call result readOnly: true example: 4 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /meetings: get: operationId: listMeetings summary: Get a list of meetings description: "Returns meetings logged against your contacts." tags: - Meetings parameters: - $ref: '#/components/parameters/query_meetings_contact_id' - $ref: '#/components/parameters/query_meetings_company_id' - $ref: '#/components/parameters/query_meetings_date_filter' - $ref: '#/components/parameters/query_since' - $ref: '#/components/parameters/query_until' - $ref: '#/components/parameters/query_modified_since' - $ref: '#/components/parameters/query_unmodified_since' - $ref: '#/components/parameters/query_meetings_sort_by' - $ref: '#/components/parameters/query_order' - $ref: '#/components/parameters/query_page' - $ref: '#/components/parameters/query_per_page' responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: meetings: type: array items: properties: meeting: $ref: '#/components/schemas/Meeting' total_count: $ref: '#/components/schemas/Page_data/properties/total_count' page: $ref: '#/components/schemas/Page_data/properties/page' per_page: $ref: '#/components/schemas/Page_data/properties/per_page' max_page: $ref: '#/components/schemas/Page_data/properties/max_page' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' post: operationId: createMeeting summary: Create a meeting description: "Logs a meeting against a contact. contact_id is required; place is free-form text (max 100 characters) and meeting_time records when it happened." tags: - Meetings parameters: [] requestBody: required: true content: application/json: schema: properties: contact_id: $ref: '#/components/schemas/Meeting/properties/contact_id' meeting_time_int: $ref: '#/components/schemas/Meeting/properties/meeting_time_int' place: $ref: '#/components/schemas/Meeting/properties/place' text: $ref: '#/components/schemas/Meeting/properties/text' # meeting_result: # $ref: '#/components/schemas/Meeting/properties/meeting_result' user_ids_to_notify: type: array description: A list of user IDs to notify items: type: string format: bson-id example: 5aba31e99007ba0f570c12f7 responses: 201: description: Created content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: meeting: $ref: '#/components/schemas/Meeting' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /meetings/{meeting_id}: get: operationId: getMeeting summary: Get a specific meeting description: "Returns one meeting — its text, author, meeting time, place, the contact it belongs to, and any attachments. Any user who can see the meeting's contact can read it, not just its author." tags: - Meetings parameters: - $ref: '#/components/parameters/path_meeting_id' responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: meeting: $ref: '#/components/schemas/Meeting' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' put: operationId: updateMeeting summary: Update a specific meeting description: "Updates a meeting. The author display name stays with the original author." tags: - Meetings parameters: - $ref: '#/components/parameters/path_meeting_id' requestBody: required: true content: application/json: schema: properties: contact_id: $ref: '#/components/schemas/Meeting/properties/contact_id' meeting_time_int: $ref: '#/components/schemas/Meeting/properties/meeting_time_int' place: $ref: '#/components/schemas/Meeting/properties/place' text: $ref: '#/components/schemas/Meeting/properties/text' # meeting_result: # $ref: '#/components/schemas/Meeting/properties/meeting_result' user_ids_to_notify: type: array description: A list of user IDs to notify items: type: string format: bson-id example: 5aba31e99007ba0f570c12f7 responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: meeting: $ref: '#/components/schemas/Meeting' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' delete: operationId: deleteMeeting summary: Delete a specific meeting description: "Deletes a meeting permanently — the API has no undo, unlike the web app. Its attachments go with it, it leaves the contact's timeline, and the author's meeting targets are recalculated." tags: - Meetings parameters: - $ref: '#/components/parameters/path_meeting_id' responses: 200: $ref: '#/components/responses/200' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /meetings/{meeting_id}/attachments: post: operationId: addMeetingAttachment summary: Create attachment and assign it to an existing meeting description: >- Before creating an attachment, the file should be uploaded to S3. Make a request to `attachments/s3_form` for a pre-authorized upload form. Following successful upload to S3, files can be attached via this endpoint. tags: - Meetings parameters: - $ref: '#/components/parameters/path_meeting_id' requestBody: required: true content: application/json: schema: required: - reference_type - key properties: reference_id: type: string format: bson-id description: ID of the meeting associated with the attachment example: 5afc1b69d556730b580596cb reference_type: type: string description: Type of resource is associated with the attachment enum: [ deal, note, call, meeting ] example: meeting contact_id: $ref: '#/components/schemas/Note/properties/contact_id' name: $ref: '#/components/schemas/Attachment/properties/filename' key: type: string description: >- The same key used in the `attachments/s3_form`, composed as `{contact_id}/{timestamp}/{filename}` example: 5ae06ef9d55673108fe8877f/1530520812224/mario.jpg size: $ref: '#/components/schemas/Attachment/properties/size' link_type: type: string description: Type of external link (for external `storage_provider`s) enum: [ dropbox, google_drive, evernote ] nullable: true example: null external_url: type: string description: URL for the file (for use with external `storage_provider`s) nullable: true example: '' responses: 201: description: Created content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: attachment: $ref: '#/components/schemas/Attachment' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /deals: get: operationId: listDeals summary: Get a list of deals description: "Returns the account's deals. Each deal belongs to one primary contact and moves through your pipeline as pending, then won or lost." tags: - Deals parameters: - $ref: '#/components/parameters/query_deals_name' - $ref: '#/components/parameters/query_deals_search' - $ref: '#/components/parameters/query_deals_status' - $ref: '#/components/parameters/query_stage' - $ref: '#/components/parameters/query_pipeline_id' - $ref: '#/components/parameters/query_sales_pipeline_id' - $ref: '#/components/parameters/query_deals_owner_id' - $ref: '#/components/parameters/query_deals_contact_id' - $ref: '#/components/parameters/query_deals_company_id' - $ref: '#/components/parameters/query_deals_tag' - $ref: '#/components/parameters/query_deals_filter_id' - $ref: '#/components/parameters/query_deals_fields' - $ref: '#/components/parameters/query_deals_date_filter' - $ref: '#/components/parameters/query_since' - $ref: '#/components/parameters/query_until' - $ref: '#/components/parameters/query_modified_since' - $ref: '#/components/parameters/query_unmodified_since' - $ref: '#/components/parameters/query_include_history' - $ref: '#/components/parameters/query_deals_sort_by' - $ref: '#/components/parameters/query_order' - $ref: '#/components/parameters/query_page' - $ref: '#/components/parameters/query_per_page' responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: deals: type: array items: properties: deal: $ref: '#/components/schemas/Deal' contacts: type: array description: >- Full `Contact` objects for the deal (primary contact plus linked contacts). Returned only when `fields=contacts(all)` is supplied. items: $ref: '#/components/schemas/Contact' total_count: $ref: '#/components/schemas/Page_data/properties/total_count' page: $ref: '#/components/schemas/Page_data/properties/page' per_page: $ref: '#/components/schemas/Page_data/properties/per_page' max_page: $ref: '#/components/schemas/Page_data/properties/max_page' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' post: operationId: createDeal summary: Create a deal description: "Creates a deal on a contact. contact_id and name are required (name up to 60 characters; longer names are truncated). status defaults to pending; stage is a per-pipeline integer and applies to pending deals only. amount is the per-month deal value; for recurring deals the total is amount multiplied by the number of months." tags: - Deals parameters: [] requestBody: required: true content: application/json: schema: properties: contact_id: $ref: '#/components/schemas/Deal/properties/contact_id' owner_id: $ref: '#/components/schemas/Deal/properties/owner_id' pipeline_id: $ref: '#/components/schemas/Deal/properties/pipeline_id' sales_pipeline_id: $ref: '#/components/schemas/Deal/properties/sales_pipeline_id' name: $ref: '#/components/schemas/Deal/properties/name' text: $ref: '#/components/schemas/Deal/properties/text' stage: $ref: '#/components/schemas/Deal/properties/stage' status: $ref: '#/components/schemas/Deal/properties/status' expected_close_date: $ref: '#/components/schemas/Deal/properties/expected_close_date' close_date: $ref: '#/components/schemas/Deal/properties/close_date' date: $ref: '#/components/schemas/Deal/properties/date' amount: $ref: '#/components/schemas/Deal/properties/amount' months: $ref: '#/components/schemas/Deal/properties/months' cost: $ref: '#/components/schemas/Deal/properties/cost' commission_base: $ref: '#/components/schemas/Deal/properties/commission_base' commission_type: $ref: '#/components/schemas/Deal/properties/commission_type' commission: $ref: '#/components/schemas/Deal/properties/commission' commission_percentage: $ref: '#/components/schemas/Deal/properties/commission_percentage' deal_fields: type: array description: Extra user-configurable data fields for Deals. Only editable by admins. items: type: object properties: deal_field: properties: id: type: string format: bson-id description: ID of the deal field example: 5aad9b039007ba28c9ebad56 value: type: string description: Value for the deal field example: Large has_deal_items: type: boolean description: Must to be `true` to create or keep deal items (if `false`, deal items will be removed) default: false example: true deal_items: type: array description: List of deal items associated with the deal items: type: object required: - name - description - cost - price - qty properties: name: $ref: '#/components/schemas/Deal_item/properties/name' description: $ref: '#/components/schemas/Deal_item/properties/description' cost: $ref: '#/components/schemas/Deal_item/properties/cost' price: $ref: '#/components/schemas/Deal_item/properties/price' qty: $ref: '#/components/schemas/Deal_item/properties/qty' predefined_item_id: $ref: '#/components/schemas/Deal_item/properties/predefined_item_id' responses: 201: description: Created content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: deal: $ref: '#/components/schemas/Deal' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /deals/{deal_id}: get: operationId: getDeal summary: Get a specific deal description: "Returns one deal, including its stage, financial fields and any deal items." tags: - Deals parameters: - $ref: '#/components/parameters/path_deal_id' - $ref: '#/components/parameters/query_include_history' responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: deal: $ref: '#/components/schemas/Deal' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' put: operationId: updateDeal summary: Update a specific deal description: "Updates a deal. contact_id cannot be changed — a deal stays with its contact. expected_close_date applies to pending deals; close_date is set when the deal becomes won or lost." tags: - Deals parameters: - $ref: '#/components/parameters/path_deal_id' requestBody: required: true content: application/json: schema: properties: contact_id: $ref: '#/components/schemas/Deal/properties/contact_id' owner_id: $ref: '#/components/schemas/Deal/properties/owner_id' pipeline_id: $ref: '#/components/schemas/Deal/properties/pipeline_id' sales_pipeline_id: $ref: '#/components/schemas/Deal/properties/sales_pipeline_id' name: $ref: '#/components/schemas/Deal/properties/name' text: $ref: '#/components/schemas/Deal/properties/text' stage: $ref: '#/components/schemas/Deal/properties/stage' status: $ref: '#/components/schemas/Deal/properties/status' expected_close_date: $ref: '#/components/schemas/Deal/properties/expected_close_date' close_date: $ref: '#/components/schemas/Deal/properties/close_date' date: $ref: '#/components/schemas/Deal/properties/date' amount: $ref: '#/components/schemas/Deal/properties/amount' months: $ref: '#/components/schemas/Deal/properties/months' cost: $ref: '#/components/schemas/Deal/properties/cost' commission_base: $ref: '#/components/schemas/Deal/properties/commission_base' commission_type: $ref: '#/components/schemas/Deal/properties/commission_type' commission: $ref: '#/components/schemas/Deal/properties/commission' commission_percentage: $ref: '#/components/schemas/Deal/properties/commission_percentage' deal_fields: type: array description: Extra user-configurable data fields for Deals. Only editable by admins. items: type: object properties: deal_field: properties: id: type: string format: bson-id description: ID of the deal field example: 5aad9b039007ba28c9ebad56 value: type: string description: Value for the deal field example: Large has_deal_items: type: boolean description: Must to be `true` to create or keep deal items (if `false`, deal items will be removed) default: false example: true deal_items: type: array description: List of deal items associated with the deal items: type: object required: - name - description - cost - price - qty properties: name: $ref: '#/components/schemas/Deal_item/properties/name' description: $ref: '#/components/schemas/Deal_item/properties/description' cost: $ref: '#/components/schemas/Deal_item/properties/cost' price: $ref: '#/components/schemas/Deal_item/properties/price' qty: $ref: '#/components/schemas/Deal_item/properties/qty' predefined_item_id: $ref: '#/components/schemas/Deal_item/properties/predefined_item_id' responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: deal: $ref: '#/components/schemas/Deal' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' delete: operationId: deleteDeal summary: Delete a specific deal description: "Deletes a deal. Only users with the delete_deals permission can delete deals." tags: - Deals parameters: - $ref: '#/components/parameters/path_deal_id' responses: 200: $ref: '#/components/responses/200' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /deals/{deal_id}/attachments: post: operationId: addDealAttachment summary: Create attachment and assign it to an existing deal description: >- Before creating an attachment, the file should be uploaded to S3. Make a request to `attachments/s3_form` for a pre-authorized upload form. Following successful upload to S3, files can be attached via this endpoint. tags: - Deals parameters: - $ref: '#/components/parameters/path_deal_id' requestBody: required: true content: application/json: schema: required: - reference_type - key properties: reference_id: type: string format: bson-id description: ID of the deal associated with the attachment example: 5afc1b69d556730b580596cb reference_type: type: string description: Type of resource is associated with the attachment enum: [ deal, note, call, meeting ] example: deal contact_id: $ref: '#/components/schemas/Note/properties/contact_id' name: $ref: '#/components/schemas/Attachment/properties/filename' key: type: string description: >- The same key used in the `attachments/s3_form`, composed as `{contact_id}/{timestamp}/{filename}` example: 5ae06ef9d55673108fe8877f/1530520812224/mario.jpg size: $ref: '#/components/schemas/Attachment/properties/size' link_type: type: string description: Type of external link (for external `storage_provider`s) enum: [ dropbox, google_drive, evernote ] nullable: true example: null external_url: type: string description: URL for the file (for use with external `storage_provider`s) nullable: true example: '' responses: 201: description: Created content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: attachment: $ref: '#/components/schemas/Attachment' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /attachments/s3_form: get: operationId: getAttachmentUploadForm summary: >- Get a pre-authorized S3 upload form (use to upload a file on the client side) description: >- Files must be uploaded to S3 before they can be attached to deals, notes, calls or meetings, and this request returns everything needed for that upload. Send a POST request to the URL in the response and include every param from the fields construct as form fields of that upload. Most can be sent as they are, but key must be constructed as {contact_id}/{timestamp}/{filename}, the filename field must match the filename at the end of key, and file is the file to upload. After a successful upload the file can be attached. Maximum file size is 10 MB; each account has 1 GB of storage per user. Additional information on the upload process: https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-post-example.html tags: - Attachments parameters: - in: query name: contact_id required: true schema: type: string description: Contact to be associated with the attachment responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: quota: example: 1073741824 display_quota: example: 1024MB url: example: https://s3-us-west-1.amazonaws.com/onepagecrm-ud2-us-west-1/ fields: properties: key: example: '' x-ignore-pattern: example: '59bacde236aebd7842f8be7x/__timestamp__/${filename}' acl: example: private success_action_status: example: 201 policy: example: aBcDe...aBcDe= x-amz-algorithm: example: AWS4-HMAC-SHA256 x-amz-credential: example: ABCDE...ABCDE/20170914/us-west-1/s3/aws4_request x-amz-date: example: 20170914T184346Z x-amz-signature: example: aBcDe...aBcDe 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /attachments: post: operationId: createAttachment summary: Create a new attachment description: >- Before creating an attachment, the file should be uploaded to S3. Make a request to `attachments/s3_form` for a pre-authorized upload form. Following successful upload to S3, files can be attached via this endpoint. Note: file attachments are supported by Deals, Notes, Calls or Meetings. tags: - Attachments parameters: [] requestBody: required: true content: application/json: schema: required: - reference_type - key properties: reference_id: type: string format: bson-id description: ID of the note associated with the attachment example: 5afc1b69d556730b580596cb reference_type: type: string description: Type of resource is associated with the attachment enum: [ deal, note, call, meeting ] example: note contact_id: $ref: '#/components/schemas/Note/properties/contact_id' name: $ref: '#/components/schemas/Attachment/properties/filename' key: type: string description: >- The same key used in the `attachments/s3_form`, composed as `{contact_id}/{timestamp}/{filename}` example: 5ae06ef9d55673108fe8877f/1530520812224/mario.jpg size: $ref: '#/components/schemas/Attachment/properties/size' link_type: type: string description: Type of external link (for external `storage_provider`s) enum: [ dropbox, google_drive, evernote ] nullable: true example: null external_url: type: string description: URL for the file (for use with external `storage_provider`s) nullable: true example: '' responses: 201: description: Created content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: attachment: $ref: '#/components/schemas/Attachment' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /attachments/{attachment_id}: patch: operationId: updateAttachment summary: Sets/updates attachment custom file name description: Once the custom file name is set it cannot be unset to nil/empty string tags: - Attachments parameters: - $ref: '#/components/parameters/path_attachment_id' requestBody: required: true content: application/json: schema: properties: attachment: required: - custom_filename properties: custom_filename: $ref: '#/components/schemas/Attachment/properties/custom_filename' responses: 200: description: 'OK' content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: $ref: '#/components/schemas/Attachment' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' delete: operationId: deleteAttachment summary: Delete a specific attachment description: "Deletes an attachment from the note, call, meeting or deal it was uploaded to. The file stops being returned by the API immediately; the stored copy is retained rather than purged straight away." tags: - Attachments parameters: - $ref: '#/components/parameters/path_attachment_id' responses: 200: $ref: '#/components/responses/200' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /attachments/{attachment_id}/pin: patch: operationId: pinAttachment summary: Pin attachment to its owner contact through its note/call/deal description: "Pins an attachment so it surfaces on the profile of the contact it belongs to, rather than only on the note, call, meeting or deal it was uploaded to. Pinned files are listed by GET /contacts/{contact_id}/pinned_attachments." tags: - Attachments parameters: - $ref: '#/components/parameters/path_attachment_id' responses: 200: description: 'OK' content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: $ref: '#/components/schemas/Attachment' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /attachments/{attachment_id}/unpin: patch: operationId: unpinAttachment summary: Unpin attachment from its owner contact through its note/call/deal description: "Unpins an attachment, so it no longer surfaces on its contact's profile and appears only against the note, call, meeting or deal it was uploaded to. The file itself is not deleted." tags: - Attachments parameters: - $ref: '#/components/parameters/path_attachment_id' responses: 200: description: 'OK' content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: $ref: '#/components/schemas/Attachment' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /relationship_types: get: operationId: listRelationshipTypes summary: Get a list of relationship types description: "Returns the relationship types defined on your account, each with its variants — the labels used for the two ends of a relationship. A type with one variant is symmetrical (Partner/Partner); one with two is directional (Manager/Reports to)." tags: - Relationship Types parameters: - $ref: '#/components/parameters/query_relationship_types_search' - $ref: '#/components/parameters/query_relationship_symmetrical' - $ref: '#/components/parameters/query_date_filter' - $ref: '#/components/parameters/query_since' - $ref: '#/components/parameters/query_until' - $ref: '#/components/parameters/query_modified_since' - $ref: '#/components/parameters/query_unmodified_since' - $ref: '#/components/parameters/query_sort_by' - $ref: '#/components/parameters/query_order' - $ref: '#/components/parameters/query_page' - $ref: '#/components/parameters/query_per_page' responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: relationship_types: type: array items: properties: relationship_type: $ref: '#/components/schemas/Relationship_Type' total_count: $ref: '#/components/schemas/Page_data/properties/total_count' page: $ref: '#/components/schemas/Page_data/properties/page' per_page: $ref: '#/components/schemas/Page_data/properties/per_page' max_page: $ref: '#/components/schemas/Page_data/properties/max_page' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' post: operationId: createRelationshipType summary: Create a new relationship type description: "Creates a relationship type from a variants list: one variant name makes a symmetrical type (Partner/Partner), two make a directional one (Manager/Reports to). Whether a type is symmetrical is derived from that count, not set directly. An account is limited to 50 types, and variant names to 35 characters." tags: - Relationship Types parameters: [] requestBody: required: true content: application/json: schema: properties: variants: type: array description: The relationship variants. items: type: object properties: name: type: string description: The relationship variant name. example: Partner responses: 201: description: Created content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: relationship_types: type: array items: properties: relationship_type: $ref: '#/components/schemas/Relationship_Type' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /relationship_types/{relationship_type_id}: get: operationId: getRelationshipType summary: Get a specific relationship type description: "Returns one relationship type with its variants. A single variant means the type is symmetrical and both contacts get the same label; two variants mean each end of the relationship gets a different one." tags: - Relationship Types parameters: - $ref: '#/components/parameters/path_relationship_type_id' responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: relationship_type: $ref: '#/components/schemas/Relationship_Type' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' put: operationId: updateRelationshipType summary: Update a specific relationship type description: "Renames a relationship type's variants: send the full set of existing variant ids with new names. Variants cannot be added or removed, and a type cannot switch between symmetrical and directional." tags: - Relationship Types parameters: - $ref: '#/components/parameters/path_relationship_type_id' requestBody: required: true content: application/json: schema: properties: variants: type: array description: The relationship variants. items: type: object properties: id: type: string format: bson-id description: ID of the relationship variant example: 5aaa9b059007ba08c9ebaf59 name: type: string description: The relationship variant name. example: Partner responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: relationship_type: $ref: '#/components/schemas/Relationship_Type' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' delete: operationId: deleteRelationshipType summary: Delete a relationship type description: "Deletes a relationship type and every relationship using it — including ones that were soft-deleted and could otherwise have been restored. This cascade is permanent, so check usage before calling it." tags: - Relationship Types parameters: - $ref: '#/components/parameters/path_relationship_type_id' responses: 200: $ref: '#/components/responses/200' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /countries: get: operationId: listCountries summary: Get the list of all compatible countries description: >- A read-only list of all compatible countries, alpha sorted based on their ISO-3166 country codes. The example response below shows only a few sample entries; the live endpoint returns the full list. tags: - Countries parameters: [] responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: countries: type: array example: - country: name: Australia code: AU phone_prefix: '+61' - country: name: Ireland code: IE phone_prefix: '+353' - country: name: United States code: US phone_prefix: '+1' items: properties: country: properties: name: type: string description: Name of the country readOnly: true example: Ireland code: type: string description: ISO-3166 country code readOnly: true example: IE phone_prefix: type: string description: Phone prefix of the country readOnly: true example: '+353' /actions: get: operationId: listActions summary: Get a list of actions description: "Returns actions in Action Stream order: ASAP first, then dated actions by due date (overdue first), then waiting-for, then queued actions without a date, then completed." tags: - Actions parameters: - $ref: '#/components/parameters/query_done' - $ref: '#/components/parameters/query_actions_status' - $ref: '#/components/parameters/query_assignee_id' - $ref: '#/components/parameters/query_actions_contact_id' - $ref: '#/components/parameters/query_actions_company_id' - $ref: '#/components/parameters/query_actions_date_filter' - $ref: '#/components/parameters/query_since' - $ref: '#/components/parameters/query_until' - $ref: '#/components/parameters/query_modified_since' - $ref: '#/components/parameters/query_unmodified_since' - $ref: '#/components/parameters/query_sort_by' - $ref: '#/components/parameters/query_order' - $ref: '#/components/parameters/query_page' - $ref: '#/components/parameters/query_per_page' responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: actions: type: array items: properties: action: $ref: '#/components/schemas/Action' total_count: $ref: '#/components/schemas/Page_data/properties/total_count' page: $ref: '#/components/schemas/Page_data/properties/page' per_page: $ref: '#/components/schemas/Page_data/properties/per_page' max_page: $ref: '#/components/schemas/Page_data/properties/max_page' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' post: operationId: createAction summary: Create an action description: "Creates an action on a contact. contact_id and text are required — text is the step to take, max 140 characters. status sets the action type: asap, date, date_time, waiting or queued (default date); assignee_id defaults to the calling user. A contact holds one ASAP action per assignee — creating a second demotes the existing one to a dated action for today." tags: - Actions parameters: [] requestBody: required: true content: application/json: schema: properties: contact_id: $ref: '#/components/schemas/Action/properties/contact_id' assignee_id: $ref: '#/components/schemas/Action/properties/assignee_id' status: $ref: '#/components/schemas/Action/properties/status' text: $ref: '#/components/schemas/Action/properties/text' date: $ref: '#/components/schemas/Action/properties/date' exact_time: $ref: '#/components/schemas/Action/properties/exact_time' position: $ref: '#/components/schemas/Action/properties/position' responses: 201: description: Created content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: action: $ref: '#/components/schemas/Action' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /actions/{action_id}: get: operationId: getAction summary: Get a specific action description: "Returns one action, including its computed weight — higher means more urgent." tags: - Actions parameters: - $ref: '#/components/parameters/path_action_id' responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: action: $ref: '#/components/schemas/Action' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' put: operationId: updateAction summary: Update a specific action description: "Updates an action. contact_id cannot be changed. Changing status between asap, date, date_time, waiting and queued moves the action between stream groups." tags: - Actions parameters: - $ref: '#/components/parameters/path_action_id' - name: done in: query required: false description: Mark the action as complete schema: type: boolean example: true requestBody: required: true content: application/json: schema: properties: contact_id: $ref: '#/components/schemas/Action/properties/contact_id' assignee_id: $ref: '#/components/schemas/Action/properties/assignee_id' status: $ref: '#/components/schemas/Action/properties/status' text: $ref: '#/components/schemas/Action/properties/text' date: $ref: '#/components/schemas/Action/properties/date' exact_time: $ref: '#/components/schemas/Action/properties/exact_time' position: $ref: '#/components/schemas/Action/properties/position' responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: action: $ref: '#/components/schemas/Action' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' delete: operationId: deleteAction summary: Delete a specific action description: "Deletes an action. Repeat the same request with undo=true to restore it." tags: - Actions parameters: - $ref: '#/components/parameters/path_action_id' - in: query name: undo description: Undo action deletion schema: type: boolean format: boolean example: true responses: 200: $ref: '#/components/responses/200' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /actions/{action_id}/unassign: put: operationId: unassignAction summary: Unassign a specific action (from the currently assigned user) description: >- Note: leaving `assignee_id` blank will assign this action to the logged API user. tags: - Actions parameters: - $ref: '#/components/parameters/path_action_id' responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: action: $ref: '#/components/schemas/Action' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /actions/{action_id}/mark_as_done: put: operationId: markActionAsDone summary: Mark a specific action as complete description: "Marks the action complete." tags: - Actions parameters: - $ref: '#/components/parameters/path_action_id' responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: action: $ref: '#/components/schemas/Action' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /actions/{action_id}/undo_completion: put: operationId: undoActionCompletion summary: Undo action completion description: "Reverts a completed action to its previous state." tags: - Actions parameters: - $ref: '#/components/parameters/path_action_id' responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: action: $ref: '#/components/schemas/Action' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /actions/{action_id}/unlink: put: operationId: unlinkAction summary: Unlink an action from the external event it mirrors description: >- Detaches an action from the external event it mirrors, making it an ordinary action: `text`, `date`, `exact_time`, `status` and `done` become writable again, and it can be completed or deleted. Nothing is sent to the external provider — unlinking does not cancel or change the meeting there. tags: - Actions parameters: - $ref: '#/components/parameters/path_action_id' responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: action: $ref: '#/components/schemas/Action' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /actions/{action_id}/promote: put: operationId: promoteAction summary: Specify action to be promoted as the logged API users next action description: >- Only use this method if there is no next action already assigned, otherwise see similar `swap` request. tags: - Actions parameters: - $ref: '#/components/parameters/path_action_id' responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: action: $ref: '#/components/schemas/Action' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /actions/{action_id}/revert_promotion: put: operationId: revertActionPromotion summary: Undo action promotion description: "Retained for backwards compatibility only — this endpoint no longer changes anything and simply returns the action unmodified. The promotion it used to reverse can no longer be undone, and the endpoint is due for removal." tags: - Actions parameters: - $ref: '#/components/parameters/path_action_id' responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: action: $ref: '#/components/schemas/Action' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /actions/{action_id}/swap: put: operationId: swapAction summary: >- Specify action to be swapped in as the logged API users next action description: >- Resolves a date conflict between a next action and a dated queued action by swapping them. The swap needs a next action of status date, date_time or waiting, and a queued action of status queued_with_date. Both actions must belong to the current user, and the queued action's date must be before the next action's date. tags: - Actions parameters: - $ref: '#/components/parameters/path_action_id' responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: action: $ref: '#/components/schemas/Action' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /filters: get: operationId: listFilters summary: Get the list of custom filters (for the logged API user's account) description: "Returns the account's saved contact filters, each with its name and the conditions that define it — the filter definitions themselves, not the contacts they match. To get matching contacts, use GET /contacts/filters/{filter_id}." tags: - Filters parameters: - $ref: '#/components/parameters/query_page' - $ref: '#/components/parameters/query_per_page' responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: filters: type: array items: properties: filter: $ref: '#/components/schemas/Filter' total_count: $ref: '#/components/schemas/Page_data/properties/total_count' page: $ref: '#/components/schemas/Page_data/properties/page' per_page: $ref: '#/components/schemas/Page_data/properties/per_page' max_page: $ref: '#/components/schemas/Page_data/properties/max_page' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /filters/{filter_id}: get: operationId: getFilter summary: Get (and run) a specific custom filter description: >- This endpoint returns all details of the specified filter, as well as all contacts that meet the criteria of the filter. tags: - Filters parameters: - $ref: '#/components/parameters/path_filter_id' responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: filter: $ref: '#/components/schemas/Filter' total_count: $ref: '#/components/schemas/Page_data/properties/total_count' page: $ref: '#/components/schemas/Page_data/properties/page' per_page: $ref: '#/components/schemas/Page_data/properties/per_page' max_page: $ref: '#/components/schemas/Page_data/properties/max_page' contacts: type: array items: properties: contact: $ref: '#/components/schemas/Contact' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /companies: get: operationId: listCompanies summary: Get a list of companies description: "Returns the account's companies, sorted by name." tags: - Companies parameters: - $ref: '#/components/parameters/query_companies_name' - $ref: '#/components/parameters/query_companies_phone' - $ref: '#/components/parameters/query_companies_letter' - $ref: '#/components/parameters/query_companies_sort_by' - $ref: '#/components/parameters/query_order' - $ref: '#/components/parameters/query_page' - $ref: '#/components/parameters/query_per_page' responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: companies: type: array items: properties: company: $ref: '#/components/schemas/Company' total_count: $ref: '#/components/schemas/Page_data/properties/total_count' page: $ref: '#/components/schemas/Page_data/properties/page' per_page: $ref: '#/components/schemas/Page_data/properties/per_page' max_page: $ref: '#/components/schemas/Page_data/properties/max_page' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /companies/{company_id}: get: operationId: getCompany summary: Get a specific company description: "Returns one company with its shared details and roll-ups. Company size is the count of its non-deleted contacts." tags: - Companies parameters: - $ref: '#/components/parameters/path_company_id' responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: company: $ref: '#/components/schemas/Company' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' put: operationId: updateCompany summary: Update a specific company description: >- Note: when updating a company field, either the `id` or `name` and the `value` must be present. tags: - Companies parameters: - $ref: '#/components/parameters/path_company_id' requestBody: required: true content: application/json: schema: properties: name: $ref: '#/components/schemas/Company/properties/name' description: $ref: '#/components/schemas/Company/properties/description' url: $ref: '#/components/schemas/Company/properties/url' phone: $ref: '#/components/schemas/Company/properties/phone' address: $ref: '#/components/schemas/Company/properties/address' company_fields: type: array description: Extra user-configurable data fields for Companies. Only editable by admins. items: type: object properties: company_field: properties: id: type: string format: bson-id description: ID of the company field example: 5aad9b039007ba28c9ebad56 value: type: string description: Value for the company field example: Large responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: company: $ref: '#/components/schemas/Company' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /companies/{company_id}/actions: get: operationId: listCompanyActions summary: Get actions associated with a specific company description: "Returns actions across the contacts that belong to this company, with the same paging, sorting and date filters as GET /actions. This covers the company's own contacts, not contacts merely linked to it." tags: - Companies parameters: - $ref: '#/components/parameters/path_company_id' - $ref: '#/components/parameters/query_done' - $ref: '#/components/parameters/query_actions_status' - $ref: '#/components/parameters/query_assignee_id' - $ref: '#/components/parameters/query_actions_date_filter' - $ref: '#/components/parameters/query_since' - $ref: '#/components/parameters/query_until' - $ref: '#/components/parameters/query_modified_since' - $ref: '#/components/parameters/query_unmodified_since' - $ref: '#/components/parameters/query_sort_by' - $ref: '#/components/parameters/query_order' - $ref: '#/components/parameters/query_page' - $ref: '#/components/parameters/query_per_page' responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: actions: type: array items: properties: action: $ref: '#/components/schemas/Action' total_count: $ref: '#/components/schemas/Page_data/properties/total_count' page: $ref: '#/components/schemas/Page_data/properties/page' per_page: $ref: '#/components/schemas/Page_data/properties/per_page' max_page: $ref: '#/components/schemas/Page_data/properties/max_page' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /companies/{company_id}/deals: get: operationId: listCompanyDeals summary: Get deals associated with a specific company description: "Returns deals across the contacts that belong to this company, with the same paging, sorting and filters as GET /deals. This covers the company's own contacts, not contacts merely linked to it." tags: - Companies parameters: - $ref: '#/components/parameters/path_company_id' - $ref: '#/components/parameters/query_deals_name' - $ref: '#/components/parameters/query_deals_search' - $ref: '#/components/parameters/query_deals_status' - $ref: '#/components/parameters/query_stage' - $ref: '#/components/parameters/query_deals_owner_id' - $ref: '#/components/parameters/query_deals_date_filter' - $ref: '#/components/parameters/query_since' - $ref: '#/components/parameters/query_until' - $ref: '#/components/parameters/query_modified_since' - $ref: '#/components/parameters/query_unmodified_since' - $ref: '#/components/parameters/query_deals_sort_by' - $ref: '#/components/parameters/query_order' - $ref: '#/components/parameters/query_page' - $ref: '#/components/parameters/query_per_page' responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: deals: type: array items: properties: deal: $ref: '#/components/schemas/Deal' total_count: $ref: '#/components/schemas/Page_data/properties/total_count' page: $ref: '#/components/schemas/Page_data/properties/page' per_page: $ref: '#/components/schemas/Page_data/properties/per_page' max_page: $ref: '#/components/schemas/Page_data/properties/max_page' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /companies/{company_id}/notes: get: operationId: listCompanyNotes summary: Get notes associated with a specific company description: "Returns notes logged against the contacts that belong to this company, most recently updated first — the company's own contacts only, not contacts merely linked to it. Paging and date filters match GET /notes." tags: - Companies parameters: - $ref: '#/components/parameters/path_company_id' - $ref: '#/components/parameters/query_notes_date_filter' - $ref: '#/components/parameters/query_since' - $ref: '#/components/parameters/query_until' - $ref: '#/components/parameters/query_modified_since' - $ref: '#/components/parameters/query_unmodified_since' - $ref: '#/components/parameters/query_notes_sort_by' - $ref: '#/components/parameters/query_order' - $ref: '#/components/parameters/query_page' - $ref: '#/components/parameters/query_per_page' responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: notes: type: array items: properties: note: $ref: '#/components/schemas/Note' total_count: $ref: '#/components/schemas/Page_data/properties/total_count' page: $ref: '#/components/schemas/Page_data/properties/page' per_page: $ref: '#/components/schemas/Page_data/properties/per_page' max_page: $ref: '#/components/schemas/Page_data/properties/max_page' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /companies/{company_id}/calls: get: operationId: listCompanyCalls summary: Get calls associated with a specific company description: "Returns calls logged against the contacts that belong to this company, most recently updated first — the company's own contacts only, not contacts merely linked to it. Paging and date filters match GET /calls." tags: - Companies parameters: - $ref: '#/components/parameters/path_company_id' - $ref: '#/components/parameters/query_calls_date_filter' - $ref: '#/components/parameters/query_since' - $ref: '#/components/parameters/query_until' - $ref: '#/components/parameters/query_modified_since' - $ref: '#/components/parameters/query_unmodified_since' - $ref: '#/components/parameters/query_calls_sort_by' - $ref: '#/components/parameters/query_order' - $ref: '#/components/parameters/query_page' - $ref: '#/components/parameters/query_per_page' responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: calls: type: array items: properties: call: $ref: '#/components/schemas/Call' total_count: $ref: '#/components/schemas/Page_data/properties/total_count' page: $ref: '#/components/schemas/Page_data/properties/page' per_page: $ref: '#/components/schemas/Page_data/properties/per_page' max_page: $ref: '#/components/schemas/Page_data/properties/max_page' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /companies/{company_id}/meetings: get: operationId: listCompanyMeetings summary: Get meetings associated with a specific company description: "Returns meetings logged against the contacts that belong to this company, most recently updated first — the company's own contacts only, not contacts merely linked to it. Paging and date filters match GET /meetings." tags: - Companies parameters: - $ref: '#/components/parameters/path_company_id' - $ref: '#/components/parameters/query_meetings_date_filter' - $ref: '#/components/parameters/query_since' - $ref: '#/components/parameters/query_until' - $ref: '#/components/parameters/query_modified_since' - $ref: '#/components/parameters/query_unmodified_since' - $ref: '#/components/parameters/query_meetings_sort_by' - $ref: '#/components/parameters/query_order' - $ref: '#/components/parameters/query_page' - $ref: '#/components/parameters/query_per_page' responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: meetings: type: array items: properties: meeting: $ref: '#/components/schemas/Meeting' total_count: $ref: '#/components/schemas/Page_data/properties/total_count' page: $ref: '#/components/schemas/Page_data/properties/page' per_page: $ref: '#/components/schemas/Page_data/properties/per_page' max_page: $ref: '#/components/schemas/Page_data/properties/max_page' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /companies/{company_id}/linked_contacts: get: operationId: listCompanyLinkedContacts summary: Get contacts linked with a specific company description: "Returns contacts from other companies that have been linked to this company's own contacts. Each entry carries linked_with, listing which of this company's contacts it is linked to. Paging and sorting only — no filters." tags: - Companies parameters: - $ref: '#/components/parameters/path_company_id' - $ref: '#/components/parameters/query_contacts_sort_by' - $ref: '#/components/parameters/query_order' - $ref: '#/components/parameters/query_page' - $ref: '#/components/parameters/query_per_page' responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: linked_contacts: type: array items: properties: linked_contact: properties: contact: $ref: '#/components/schemas/Contact' next_actions: type: array items: $ref: '#/components/schemas/Action' next_action: $ref: '#/components/schemas/Action' queued_actions: type: array items: $ref: '#/components/schemas/Action' next_action_conflicts: type: array items: {} example: [] company: $ref: '#/components/schemas/Company' linked_with: type: array description: IDs of contacts, to which the contact/company is linked items: type: string format: bson-id example: 5aba31e99007ba0f570c92ab total_count: $ref: '#/components/schemas/Page_data/properties/total_count' page: $ref: '#/components/schemas/Page_data/properties/page' per_page: $ref: '#/components/schemas/Page_data/properties/per_page' max_page: $ref: '#/components/schemas/Page_data/properties/max_page' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' post: operationId: linkCompanyContact summary: Link a contact to a specific company description: >- Notes: Cannot link a contact to the company they already work at.; A company is not allowed to have more than 100 linked contacts. tags: - Companies parameters: - $ref: '#/components/parameters/path_company_id' requestBody: required: true content: application/json: schema: required: - contact_id properties: contact_id: type: string format: bson-id description: The ID of the contact to link with the company example: 5ae06ef9d55673108fe8877b responses: 201: description: Created content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: linked_contact: properties: contact: $ref: '#/components/schemas/Contact' next_actions: type: array items: $ref: '#/components/schemas/Action' next_action: $ref: '#/components/schemas/Action' queued_actions: type: array items: $ref: '#/components/schemas/Action' next_action_conflicts: type: array items: {} example: [] company: $ref: '#/components/schemas/Company' linked_with: type: array description: IDs of contacts, to which the contact/company is linked items: type: string format: bson-id example: 5aba31e99007ba0f570c92ab 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /companies/{company_id}/linked_contacts/{contact_id}: delete: operationId: unlinkCompanyContact summary: Unlink a contact from a company description: "Unlinks the contact from the company. A company that still holds data cannot lose its last contact." tags: - Companies parameters: - $ref: '#/components/parameters/path_company_id' - name: contact_id in: path required: true description: ID of the contact to be un-linked, from the company schema: type: string format: bson-id responses: 200: $ref: '#/components/responses/200' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /companies/{company_id}/synced_status: post: operationId: setCompanySyncedStatus summary: Enable company status sync description: >- Turns on sync so that all contacts in the specified company will have the same status. An initial `status_id` must be provided in the request body. Note: the statuses of this company's contacts will remain in sync, until sync is disabled for this company. tags: - Companies parameters: - $ref: '#/components/parameters/path_company_id' requestBody: required: true content: application/json: schema: properties: status_id: $ref: '#/components/schemas/Company/properties/synced_status_id' responses: 201: description: Created content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: company: $ref: '#/components/schemas/Company' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' delete: operationId: removeCompanySyncedStatus summary: Disable company status sync description: "Turns off status sync for the company. Contacts keep their current statuses." tags: - Companies parameters: - $ref: '#/components/parameters/path_company_id' responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: company: $ref: '#/components/schemas/Company' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /companies/{company_id}/pinned_attachments: get: operationId: listCompanyPinnedAttachments summary: Get the list of attachments pinned to this company description: The list of attachments is collected from the attachments pinned to all the contacts in this company. The list of attachments is sorted based on "pinned_at" field, i.e. most recent attachments come first, the list of attachments is paginated. tags: - Companies parameters: - $ref: '#/components/parameters/path_company_id' responses: 200: description: 'OK' content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: pinned_attachments: type: array items: $ref: '#/components/schemas/Attachment' total_count: $ref: '#/components/schemas/Page_data/properties/total_count' page: $ref: '#/components/schemas/Page_data/properties/page' per_page: $ref: '#/components/schemas/Page_data/properties/per_page' max_page: $ref: '#/components/schemas/Page_data/properties/max_page' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /companies/{company_id}/logo: patch: operationId: updateCompanyLogo summary: Update the company logo description: Update company logo with the given image. The previous logo is removed and then new image is set tags: - Companies parameters: - $ref: '#/components/parameters/path_company_id' requestBody: required: true content: application/json: schema: properties: image: $ref: '#/components/schemas/Company/properties/image' responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: company: $ref: '#/components/schemas/Company' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 415: $ref: '#/components/responses/415' 422: $ref: '#/components/responses/422' 500: $ref: '#/components/responses/500' delete: operationId: deleteCompanyLogo summary: Delete the company logo description: >- Delete logo in the given company. When successfully deleted the `photo_url` field value is `null` in the company tags: - Companies parameters: - $ref: '#/components/parameters/path_company_id' responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: company: $ref: '#/components/schemas/Company' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 500: $ref: '#/components/responses/500' /contacts: get: operationId: listContacts summary: Get a list of contacts description: "Returns the contacts you can access, sorted by name. Filter by company_id, email, phone, tag, status_id, starred, owner_id and more. has_actions and has_actions_for_me are mutually exclusive, as are lead_source and lead_source_id. sort_by accepts created_at, modified_at, first_name, last_name, company_name and name, each with order=asc or desc (ascending is the default). When results are filtered by a created_at or modified_at date range and no sort_by is given, they default to newest first." tags: - Contacts parameters: - $ref: '#/components/parameters/query_team' # Search field values - $ref: '#/components/parameters/query_contacts_search' - $ref: '#/components/parameters/query_contacts_phone' - $ref: '#/components/parameters/query_url' # Boolean flags/filters - $ref: '#/components/parameters/query_action_stream' - $ref: '#/components/parameters/query_has_actions' - $ref: '#/components/parameters/query_has_actions_for_me' - $ref: '#/components/parameters/query_has_actions_today' - $ref: '#/components/parameters/query_pending_deal' - $ref: '#/components/parameters/query_starred' - $ref: '#/components/parameters/query_waiting' # Related value constraints - $ref: '#/components/parameters/query_email' - $ref: '#/components/parameters/query_contacts_letter' - $ref: '#/components/parameters/query_custom_field_id' - $ref: '#/components/parameters/query_custom_field_value' - $ref: '#/components/parameters/query_lead_source' - $ref: '#/components/parameters/query_lead_source_id' - $ref: '#/components/parameters/query_status_id' - $ref: '#/components/parameters/query_not_linked_with' - $ref: '#/components/parameters/query_contacts_owner_id' - $ref: '#/components/parameters/query_contacts_company_id' - $ref: '#/components/parameters/query_contacts_tag' - $ref: '#/components/parameters/query_contacts_filter_id' # Include related resources - $ref: '#/components/parameters/query_contacts_fields' # Date filters - $ref: '#/components/parameters/query_date_filter' - $ref: '#/components/parameters/query_since' - $ref: '#/components/parameters/query_until' - $ref: '#/components/parameters/query_modified_since' - $ref: '#/components/parameters/query_unmodified_since' # Sort order - $ref: '#/components/parameters/query_contacts_sort_by' - $ref: '#/components/parameters/query_order' # Pagination - $ref: '#/components/parameters/query_page' - $ref: '#/components/parameters/query_per_page' responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: contacts: type: array items: properties: contact: $ref: '#/components/schemas/Contact' next_actions: type: array items: $ref: '#/components/schemas/Action' next_action: $ref: '#/components/schemas/Action' queued_actions: type: array items: $ref: '#/components/schemas/Action' next_action_conflicts: type: array items: {} example: [] company: $ref: '#/components/schemas/Company' deals: type: array description: Returned only when `fields=deals(all)` is supplied. Full deal objects. items: $ref: '#/components/schemas/Deal' notes: type: array description: Returned only when `fields=notes(all)` is supplied. Full note objects. items: $ref: '#/components/schemas/Note' calls: type: array description: Returned only when `fields=calls(all)` is supplied. Full call objects. items: $ref: '#/components/schemas/Call' meetings: type: array description: Returned only when `fields=meetings(all)` is supplied. Full meeting objects. items: $ref: '#/components/schemas/Meeting' pinned_attachments: type: array description: Returned only when `fields=pinned_attachments(all)` is supplied. Full attachment objects. items: $ref: '#/components/schemas/Attachment' total_count: $ref: '#/components/schemas/Page_data/properties/total_count' page: $ref: '#/components/schemas/Page_data/properties/page' per_page: $ref: '#/components/schemas/Page_data/properties/per_page' max_page: $ref: '#/components/schemas/Page_data/properties/max_page' lead_sources: type: array items: $ref: '#/components/schemas/Lead_source' statuses: type: array items: type: object properties: status: $ref: '#/components/schemas/Status' tags: properties: tags: type: array items: $ref: '#/components/schemas/Tag' system_tags: type: array items: $ref: '#/components/schemas/Tag' contacts_count: $ref: '#/components/schemas/Contacts_count' team_stream: $ref: '#/components/schemas/Team_stream' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' post: operationId: createContact summary: Create a contact description: "Creates a contact. Provide last_name or company_name — one of the two is required. owner_id defaults to the calling user and status_id to lead. company_name links the contact to an existing company (matched case-insensitively) or creates one; company_id is ignored on create. Optional next_action_name (max 140 characters) creates the contact's first next action, with next_action_date set to asap, waiting or a YYYY-MM-DD date." tags: - Contacts parameters: [] requestBody: required: true content: application/json: schema: properties: title: $ref: '#/components/schemas/Contact/properties/title' first_name: $ref: '#/components/schemas/Contact/properties/first_name' last_name: $ref: '#/components/schemas/Contact/properties/last_name' job_title: $ref: '#/components/schemas/Contact/properties/job_title' starred: $ref: '#/components/schemas/Contact/properties/starred' company_id: $ref: '#/components/schemas/Contact/properties/company_id' company_name: $ref: '#/components/schemas/Contact/properties/company_name' urls: $ref: '#/components/schemas/Contact/properties/urls' phones: $ref: '#/components/schemas/Contact/properties/phones' emails: $ref: '#/components/schemas/Contact/properties/emails' address_list: $ref: '#/components/schemas/Contact/properties/address_list' status_id: $ref: '#/components/schemas/Contact/properties/status_id' tags: $ref: '#/components/schemas/Contact/properties/tags' lead_source_id: $ref: '#/components/schemas/Lead_source/properties/id' background: $ref: '#/components/schemas/Contact/properties/background' owner_id: $ref: '#/components/schemas/Contact/properties/owner_id' custom_fields: type: array description: Extra user-configurable data fields for Contacts. Only editable by admins. items: type: object properties: custom_field: properties: id: type: string format: bson-id description: ID of the custom field example: 5aad9b039007ba28c9ebad56 value: type: string description: Value for the custom field example: Large responses: 201: description: Created content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: contact: $ref: '#/components/schemas/Contact' next_actions: type: array items: $ref: '#/components/schemas/Action' next_action: $ref: '#/components/schemas/Action' queued_actions: type: array items: $ref: '#/components/schemas/Action' next_action_conflicts: type: array items: {} example: [] company: $ref: '#/components/schemas/Company' lead_sources: type: array items: $ref: '#/components/schemas/Lead_source' statuses: type: array items: type: object properties: status: $ref: '#/components/schemas/Status' tags: properties: tags: type: array items: $ref: '#/components/schemas/Tag' system_tags: type: array items: $ref: '#/components/schemas/Tag' contacts_count: $ref: '#/components/schemas/Contacts_count' team_stream: $ref: '#/components/schemas/Team_stream' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /contacts/{contact_id}: get: operationId: getContact summary: Get a specific contact description: "Returns one contact — names, company link, status, tags, communication lists (phones, emails, urls, addresses) and custom fields." tags: - Contacts parameters: - $ref: '#/components/parameters/path_contact_id' responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: contact: $ref: '#/components/schemas/Contact' next_actions: type: array items: $ref: '#/components/schemas/Action' next_action: $ref: '#/components/schemas/Action' queued_actions: type: array items: $ref: '#/components/schemas/Action' next_action_conflicts: type: array items: {} example: [] company: $ref: '#/components/schemas/Company' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' put: operationId: updateContact summary: Update a specific contact description: "Updates a contact. Without partial=true this replaces the whole record: any writable field you leave out is cleared or reset to its default (tags and communication lists are emptied, status_id returns to lead). Pass partial=true to change only the fields you send — arrays still replace rather than merge. Company linking: company_name renames or moves, company_id moves to an existing company, and a full update sending neither removes the company. When updating a custom field, send its id (or name) together with value. To clear all addresses send an empty address_list." tags: - Contacts parameters: - $ref: '#/components/parameters/path_contact_id' requestBody: required: true content: application/json: schema: properties: title: $ref: '#/components/schemas/Contact/properties/title' first_name: $ref: '#/components/schemas/Contact/properties/first_name' last_name: $ref: '#/components/schemas/Contact/properties/last_name' job_title: $ref: '#/components/schemas/Contact/properties/job_title' starred: $ref: '#/components/schemas/Contact/properties/starred' company_id: $ref: '#/components/schemas/Contact/properties/company_id' company_name: $ref: '#/components/schemas/Contact/properties/company_name' urls: $ref: '#/components/schemas/Contact/properties/urls' phones: $ref: '#/components/schemas/Contact/properties/phones' emails: $ref: '#/components/schemas/Contact/properties/emails' address_list: $ref: '#/components/schemas/Contact/properties/address_list' status_id: $ref: '#/components/schemas/Contact/properties/status_id' tags: $ref: '#/components/schemas/Contact/properties/tags' lead_source_id: $ref: '#/components/schemas/Lead_source/properties/id' background: $ref: '#/components/schemas/Contact/properties/background' owner_id: $ref: '#/components/schemas/Contact/properties/owner_id' custom_fields: type: array description: Extra user-configurable data fields for Contacts. Only editable by admins. items: type: object properties: custom_field: properties: id: type: string format: bson-id description: ID of the custom field example: 5aad9b039007ba28c9ebad56 value: type: string description: Value for the custom field example: Large responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: contact: $ref: '#/components/schemas/Contact' next_actions: type: array items: $ref: '#/components/schemas/Action' next_action: $ref: '#/components/schemas/Action' queued_actions: type: array items: $ref: '#/components/schemas/Action' next_action_conflicts: type: array items: {} example: [] company: $ref: '#/components/schemas/Company' lead_sources: type: array items: $ref: '#/components/schemas/Lead_source' statuses: type: array items: type: object properties: status: $ref: '#/components/schemas/Status' tags: properties: tags: type: array items: $ref: '#/components/schemas/Tag' system_tags: type: array items: $ref: '#/components/schemas/Tag' contacts_count: $ref: '#/components/schemas/Contacts_count' team_stream: $ref: '#/components/schemas/Team_stream' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' delete: operationId: deleteContact summary: Delete a specific contact description: "Deletes a contact. Only users with the delete_contacts permission can delete contacts. Repeat the same request with undo=true to restore the most recent deletion for that ID — the restore window depends on the account plan, from 1 day up to 60 days." tags: - Contacts parameters: - $ref: '#/components/parameters/path_contact_id' - in: query name: undo description: Undo Contact deletion schema: type: boolean format: boolean example: true responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: type: object lead_sources: type: array items: $ref: '#/components/schemas/Lead_source' statuses: type: array items: type: object properties: status: $ref: '#/components/schemas/Status' tags: properties: tags: type: array items: $ref: '#/components/schemas/Tag' system_tags: type: array items: $ref: '#/components/schemas/Tag' contacts_count: $ref: '#/components/schemas/Contacts_count' team_stream: $ref: '#/components/schemas/Team_stream' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /contacts/{contact_id}/contact_photo: post: operationId: createContactPhoto summary: Add a contact photo description: >- Use this endpoint to add a new photo to an existing contact. It takes a parameter `image`, which must be a Base64 encoded string of the image data. Images will be cropped to a centered square and resized to 200x200 pixels. tags: - Contacts parameters: - $ref: '#/components/parameters/path_contact_id' requestBody: required: true content: application/json: schema: properties: image: type: string format: b64-encoded description: Base64 encoded string of image data example: >- iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4gkFCR0iiEuUHQAAA8tJREFUaN7tmX1IlHccwD/PvZRpGb0ZTcK6C9ksanIVvQ0rV4RTK5cy9keLbETOGmRBW1SMmX9sLCrbjDKrJfRqucqgyBoUW3EmRYZFXRmzFmmvXL502rM/vkIpPXenPl6Xe37wcHDP73e/3+f7/v2douai0g2GiW4yDBADxAAxQAwQA8QA+X+CNALNATzZq5Y9VT1BIhyQpULaeYhKAE8XAniAiLGQeFj2jFmgI8jwZPkcMhmSSuCbp+D4DkxWkVxnh9qigZh0SL8NaU6wzZV39s/92sM/ELWNfnv0hYk5kPESZu2FAaM6pqVmIHQwxG2GZSpMz4fw4d731hgW/zZs0H4X/YU8TyqhLAeuFYIZUHyYj30mOL6HyLgAOnv5z3LI5kbtOf0+ghl74NsmmPwT9OzX2iRUQDFD7ErIeAzJJ3WDAFD87hDVFlP4MBXGroaBY3yvubAWnD+KdmxzIOFI+0945xgcS/YpclO77NkM3DoIhR9DYTRc/937GvtcWacCwz4LgjwSFgnzr8GUXyBkgEj46U049RX8aoLzWdDwSEON7XPargUZ+TX0j4HY5bCoFlJOQeTUFmmrcHkD/DYQij+F6jOv1zXVeXd6HYelQ6uGzpCn7iFcyoErm8AKVJfC3VLoPQhGLobru8UcA3BP42ce0chIoRHwyUbIVCF+B4Tb5ND1NVCWDe5/gqzWqsiD6rPe58QshPku+LIMbCldW8Z0GKS+BoqmQ/4g8QdvjhvhgIQiWFoP9pQgrH5NQEMtnMuCzSY4vUAil6b3hUi+aQomEHNPiM+HEakSqUyII++Mhn2xklvei34kdoVUprMOQGY9TPgBrGESkWovw4k0yAuBi2vA4/YdJN4ZiMna2mTGrYXFbkgshsHjRUvNjeDMhi19oGQ2VJVIorQEBqRz29hmy/P8LlxaD1e3yy/eOQquozo10oqOGnEdAk+d9vvwKJi2TXqKuFwIHaJfEqzc4dcp/QN5VAFbwuB4Ejz42/vc0Zmw8D6knoP+ozp2+GcuKE2HTQq4inUOv1ag6jjsmwS7hkLFVu/zP5gC8QXtu7BwFcF+BxSMgMoC3w1ap66DLIC7Gs4ugVwF/swA9z2NXzf7NjHPC7i4DraGQsk8qCkXoQXM2ZU3ypfyPIiaJK1rq77jDXEqbWT20Cld541iOYXSuVs2fYJjD+Dfv+CPROgVDo5VUvpX5L02j8oCsM+TwOHMhidVsrtVn5igdMmfoSpSmlja2LjnLd8FRR7xZnZWjYDxzovGIB8GiAFigBggBogBYoB0J5D/ACApEz8hyMzGAAAAAElFTkSuQmCC responses: 201: description: Created content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: contact: $ref: '#/components/schemas/Contact' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' put: operationId: updateContactPhoto summary: Update a contact's photo description: > Use this endpoint to update the photo of an existing contact. It takes a parameter `image`, which must be a Base64 encoded string of the image data. Images will be cropped to a centered square and resized to 200x200 pixels. Note: updating a contact photo will remove the existing photo! tags: - Contacts parameters: - $ref: '#/components/parameters/path_contact_id' requestBody: required: true content: application/json: schema: properties: image: type: string format: b64-encoded description: Base64 encoded string of image data example: >- iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4gkFCR0iiEuUHQAAA8tJREFUaN7tmX1IlHccwD/PvZRpGb0ZTcK6C9ksanIVvQ0rV4RTK5cy9keLbETOGmRBW1SMmX9sLCrbjDKrJfRqucqgyBoUW3EmRYZFXRmzFmmvXL502rM/vkIpPXenPl6Xe37wcHDP73e/3+f7/v2douai0g2GiW4yDBADxAAxQAwQA8QA+X+CNALNATzZq5Y9VT1BIhyQpULaeYhKAE8XAniAiLGQeFj2jFmgI8jwZPkcMhmSSuCbp+D4DkxWkVxnh9qigZh0SL8NaU6wzZV39s/92sM/ELWNfnv0hYk5kPESZu2FAaM6pqVmIHQwxG2GZSpMz4fw4d731hgW/zZs0H4X/YU8TyqhLAeuFYIZUHyYj30mOL6HyLgAOnv5z3LI5kbtOf0+ghl74NsmmPwT9OzX2iRUQDFD7ErIeAzJJ3WDAFD87hDVFlP4MBXGroaBY3yvubAWnD+KdmxzIOFI+0945xgcS/YpclO77NkM3DoIhR9DYTRc/937GvtcWacCwz4LgjwSFgnzr8GUXyBkgEj46U049RX8aoLzWdDwSEON7XPargUZ+TX0j4HY5bCoFlJOQeTUFmmrcHkD/DYQij+F6jOv1zXVeXd6HYelQ6uGzpCn7iFcyoErm8AKVJfC3VLoPQhGLobru8UcA3BP42ce0chIoRHwyUbIVCF+B4Tb5ND1NVCWDe5/gqzWqsiD6rPe58QshPku+LIMbCldW8Z0GKS+BoqmQ/4g8QdvjhvhgIQiWFoP9pQgrH5NQEMtnMuCzSY4vUAil6b3hUi+aQomEHNPiM+HEakSqUyII++Mhn2xklvei34kdoVUprMOQGY9TPgBrGESkWovw4k0yAuBi2vA4/YdJN4ZiMna2mTGrYXFbkgshsHjRUvNjeDMhi19oGQ2VJVIorQEBqRz29hmy/P8LlxaD1e3yy/eOQquozo10oqOGnEdAk+d9vvwKJi2TXqKuFwIHaJfEqzc4dcp/QN5VAFbwuB4Ejz42/vc0Zmw8D6knoP+ozp2+GcuKE2HTQq4inUOv1ag6jjsmwS7hkLFVu/zP5gC8QXtu7BwFcF+BxSMgMoC3w1ap66DLIC7Gs4ugVwF/swA9z2NXzf7NjHPC7i4DraGQsk8qCkXoQXM2ZU3ypfyPIiaJK1rq77jDXEqbWT20Cld541iOYXSuVs2fYJjD+Dfv+CPROgVDo5VUvpX5L02j8oCsM+TwOHMhidVsrtVn5igdMmfoSpSmlja2LjnLd8FRR7xZnZWjYDxzovGIB8GiAFigBggBogBYoB0J5D/ACApEz8hyMzGAAAAAElFTkSuQmCC responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: contact: $ref: '#/components/schemas/Contact' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' delete: operationId: deleteContactPhoto summary: Remove a contact's photo description: "Removes a contact's photo and returns the updated contact, whose photo_url is then empty. No placeholder or default avatar is substituted by the API." tags: - Contacts parameters: - $ref: '#/components/parameters/path_contact_id' responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: contact: $ref: '#/components/schemas/Contact' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /contacts/filters/{filter_id}: get: operationId: listContactsByFilter summary: Show contacts that meet the criteria of a filter description: "Returns the contacts matching a saved filter, alongside the filter's own definition. Results come back in Action Stream order and are fixed at 25 per page — per_page is accepted but ignored here." tags: - Contacts parameters: - $ref: '#/components/parameters/path_filter_id' responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: filter: $ref: '#/components/schemas/Filter' total_count: $ref: '#/components/schemas/Page_data/properties/total_count' page: $ref: '#/components/schemas/Page_data/properties/page' per_page: $ref: '#/components/schemas/Page_data/properties/per_page' max_page: $ref: '#/components/schemas/Page_data/properties/max_page' contacts: type: array items: properties: contact: $ref: '#/components/schemas/Contact' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /contacts/delete: delete: operationId: deleteContacts summary: Delete multiple contacts description: "Deletes multiple contacts by ID. Only users with the delete_contacts permission can delete contacts." tags: - Contacts parameters: - $ref: '#/components/parameters/query_contacts_delete_ids' responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: type: object lead_sources: type: array items: $ref: '#/components/schemas/Lead_source' statuses: type: array items: type: object properties: status: $ref: '#/components/schemas/Status' tags: properties: tags: type: array items: $ref: '#/components/schemas/Tag' system_tags: type: array items: $ref: '#/components/schemas/Tag' contacts_count: $ref: '#/components/schemas/Contacts_count' team_stream: $ref: '#/components/schemas/Team_stream' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /contacts/{contact_id}/google_contacts: post: operationId: saveContactToGoogleContacts summary: Save a specific OnePageCRM contact to Google Contacts description: >- OnePageCRM must be authorized to save contacts to Google Contacts on your behalf, in order to complete this request. Please visit our integration page (https://app.onepagecrm.com/app/google_contacts) to authorize, or our help article (https://help.onepagecrm.com/article/370-how-to-save-contacts-to-google-contacts-from-onepagecrm) for more information. tags: - Contacts parameters: - $ref: '#/components/parameters/path_contact_id' responses: 201: description: Created content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: contact: $ref: '#/components/schemas/Contact' next_actions: type: array items: $ref: '#/components/schemas/Action' next_action: $ref: '#/components/schemas/Action' queued_actions: type: array items: $ref: '#/components/schemas/Action' next_action_conflicts: type: array items: $ref: '#/components/schemas/Action' company: $ref: '#/components/schemas/Company' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /contacts/{contact_id}/actions: get: operationId: listContactActions summary: Get all actions for a specific contact description: "Returns the actions on this contact, with the same paging, sorting and date filters as GET /actions. Pass status to narrow to asap, waiting, date, queued or done." tags: - Contacts parameters: - $ref: '#/components/parameters/path_contact_id' - $ref: '#/components/parameters/query_done' - $ref: '#/components/parameters/query_actions_status' - $ref: '#/components/parameters/query_assignee_id' - $ref: '#/components/parameters/query_actions_date_filter' - $ref: '#/components/parameters/query_since' - $ref: '#/components/parameters/query_until' - $ref: '#/components/parameters/query_modified_since' - $ref: '#/components/parameters/query_unmodified_since' - $ref: '#/components/parameters/query_sort_by' - $ref: '#/components/parameters/query_order' - $ref: '#/components/parameters/query_page' - $ref: '#/components/parameters/query_per_page' responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: actions: type: array items: properties: action: $ref: '#/components/schemas/Action' total_count: $ref: '#/components/schemas/Page_data/properties/total_count' page: $ref: '#/components/schemas/Page_data/properties/page' per_page: $ref: '#/components/schemas/Page_data/properties/per_page' max_page: $ref: '#/components/schemas/Page_data/properties/max_page' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' post: operationId: createContactAction summary: Create an action for a specific contact description: "Creates an action on this contact. text is required — the step to take, max 140 characters. status sets the action type: asap, date, date_time, waiting or queued (default date); assignee_id defaults to the calling user. A contact holds one ASAP action per assignee — creating a second demotes the existing one to a dated action for today." tags: - Contacts parameters: - $ref: '#/components/parameters/path_contact_id' requestBody: required: true content: application/json: schema: properties: assignee_id: $ref: '#/components/schemas/Action/properties/assignee_id' status: $ref: '#/components/schemas/Action/properties/status' text: $ref: '#/components/schemas/Action/properties/text' date: $ref: '#/components/schemas/Action/properties/date' exact_time: $ref: '#/components/schemas/Action/properties/exact_time' position: $ref: '#/components/schemas/Action/properties/position' responses: 201: description: Created content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: action: $ref: '#/components/schemas/Action' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /contacts/{contact_id}/deals: get: operationId: listContactDeals summary: Get all deals for a specific contact description: "Returns the deals on this contact, with the same paging, sorting and filters as GET /deals — including filtering by status, stage, pipeline_id or owner_id." tags: - Contacts parameters: - $ref: '#/components/parameters/path_contact_id' - $ref: '#/components/parameters/query_deals_name' - $ref: '#/components/parameters/query_deals_search' - $ref: '#/components/parameters/query_deals_status' - $ref: '#/components/parameters/query_stage' - $ref: '#/components/parameters/query_deals_owner_id' - $ref: '#/components/parameters/query_deals_date_filter' - $ref: '#/components/parameters/query_since' - $ref: '#/components/parameters/query_until' - $ref: '#/components/parameters/query_modified_since' - $ref: '#/components/parameters/query_unmodified_since' - $ref: '#/components/parameters/query_deals_sort_by' - $ref: '#/components/parameters/query_order' - $ref: '#/components/parameters/query_page' - $ref: '#/components/parameters/query_per_page' responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: deals: type: array items: properties: deal: $ref: '#/components/schemas/Deal' total_count: $ref: '#/components/schemas/Page_data/properties/total_count' page: $ref: '#/components/schemas/Page_data/properties/page' per_page: $ref: '#/components/schemas/Page_data/properties/per_page' max_page: $ref: '#/components/schemas/Page_data/properties/max_page' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' post: operationId: createContactDeal summary: Create a deal for a specific contact description: "Creates a deal on this contact. name is required (up to 60 characters; longer names are truncated). status is pending, won or lost (default pending); stage is a per-pipeline integer and applies to pending deals only. amount is the per-month deal value; for recurring deals the total is amount multiplied by the number of months." tags: - Contacts parameters: - $ref: '#/components/parameters/path_contact_id' requestBody: required: true content: application/json: schema: properties: owner_id: $ref: '#/components/schemas/Deal/properties/owner_id' name: $ref: '#/components/schemas/Deal/properties/name' text: $ref: '#/components/schemas/Deal/properties/text' stage: $ref: '#/components/schemas/Deal/properties/stage' status: $ref: '#/components/schemas/Deal/properties/status' expected_close_date: $ref: '#/components/schemas/Deal/properties/expected_close_date' close_date: $ref: '#/components/schemas/Deal/properties/close_date' date: $ref: '#/components/schemas/Deal/properties/date' amount: $ref: '#/components/schemas/Deal/properties/amount' months: $ref: '#/components/schemas/Deal/properties/months' cost: $ref: '#/components/schemas/Deal/properties/cost' commission_base: $ref: '#/components/schemas/Deal/properties/commission_base' commission_type: $ref: '#/components/schemas/Deal/properties/commission_type' commission: $ref: '#/components/schemas/Deal/properties/commission' commission_percentage: $ref: '#/components/schemas/Deal/properties/commission_percentage' deal_fields: type: array description: Extra user-configurable data fields for Deals. Only editable by admins. items: type: object properties: deal_field: properties: id: type: string format: bson-id description: ID of the deal field example: 5aad9b039007ba28c9ebad56 value: type: string description: Value for the deal field example: Large responses: 201: description: Created content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: deal: $ref: '#/components/schemas/Deal' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /contacts/{contact_id}/notes: get: operationId: listContactNotes summary: Get all notes for a specific contact description: "Returns the notes logged against this contact, most recently updated first, with the same paging and date filters as GET /notes. Each note carries its attachments and linked deal, if any." tags: - Contacts parameters: - $ref: '#/components/parameters/path_contact_id' - $ref: '#/components/parameters/query_notes_date_filter' - $ref: '#/components/parameters/query_since' - $ref: '#/components/parameters/query_until' - $ref: '#/components/parameters/query_modified_since' - $ref: '#/components/parameters/query_unmodified_since' - $ref: '#/components/parameters/query_notes_sort_by' - $ref: '#/components/parameters/query_order' - $ref: '#/components/parameters/query_page' - $ref: '#/components/parameters/query_per_page' responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: notes: type: array items: properties: note: $ref: '#/components/schemas/Note' total_count: $ref: '#/components/schemas/Page_data/properties/total_count' page: $ref: '#/components/schemas/Page_data/properties/page' per_page: $ref: '#/components/schemas/Page_data/properties/per_page' max_page: $ref: '#/components/schemas/Page_data/properties/max_page' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' post: operationId: createContactNote summary: Create a note for a specific contact description: "Logs a note against this contact. text carries the note body; link a deal with linked_deal_id. Logging a note updates the contact's last activity date." tags: - Contacts parameters: - $ref: '#/components/parameters/path_contact_id' requestBody: required: true content: application/json: schema: properties: text: $ref: '#/components/schemas/Note/properties/text' date: $ref: '#/components/schemas/Note/properties/date' linked_deal_id: type: string format: bson-id nullable: true example: '' user_ids_to_notify: type: array description: A list of user IDs to notify items: type: string format: bson-id example: 5aba31e99007ba0f570c12f7 responses: 201: description: Created content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: note: $ref: '#/components/schemas/Note' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /contacts/{contact_id}/calls: get: operationId: listContactCalls summary: Get all calls for a specific contact description: "Returns the calls logged against this contact, most recently updated first, with the same paging and date filters as GET /calls. Each call carries its result, call time and any attachments." tags: - Contacts parameters: - $ref: '#/components/parameters/path_contact_id' - $ref: '#/components/parameters/query_calls_date_filter' - $ref: '#/components/parameters/query_since' - $ref: '#/components/parameters/query_until' - $ref: '#/components/parameters/query_modified_since' - $ref: '#/components/parameters/query_unmodified_since' - $ref: '#/components/parameters/query_calls_sort_by' - $ref: '#/components/parameters/query_order' - $ref: '#/components/parameters/query_page' - $ref: '#/components/parameters/query_per_page' responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: calls: type: array items: properties: call: $ref: '#/components/schemas/Call' total_count: $ref: '#/components/schemas/Page_data/properties/total_count' page: $ref: '#/components/schemas/Page_data/properties/page' per_page: $ref: '#/components/schemas/Page_data/properties/per_page' max_page: $ref: '#/components/schemas/Page_data/properties/max_page' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' post: operationId: createContactCall summary: Create a call for a specific contact description: "Logs a phone call against this contact. Record the outcome with call_result (from the account's configured results), plus the number dialled and an optional recording link." tags: - Contacts parameters: - $ref: '#/components/parameters/path_contact_id' requestBody: required: true content: application/json: schema: properties: call_time_int: $ref: '#/components/schemas/Call/properties/call_time_int' text: $ref: '#/components/schemas/Call/properties/text' phone_number: $ref: '#/components/schemas/Call/properties/phone_number' call_result: $ref: '#/components/schemas/Call/properties/call_result' via: $ref: '#/components/schemas/Call/properties/via' recording_link: $ref: '#/components/schemas/Call/properties/recording_link' user_ids_to_notify: type: array description: A list of user IDs to notify items: type: string format: bson-id example: 5aba31e99007ba0f570c12f7 responses: 201: description: Created content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: call: $ref: '#/components/schemas/Call' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /contacts/{contact_id}/meetings: get: operationId: listContactMeetings summary: Get all meetings for a specific contact description: "Returns the meetings logged against this contact, most recently updated first, with the same paging and date filters as GET /meetings. Each meeting carries its time, place and any attachments." tags: - Contacts parameters: - $ref: '#/components/parameters/path_contact_id' - $ref: '#/components/parameters/query_meetings_date_filter' - $ref: '#/components/parameters/query_since' - $ref: '#/components/parameters/query_until' - $ref: '#/components/parameters/query_modified_since' - $ref: '#/components/parameters/query_unmodified_since' - $ref: '#/components/parameters/query_meetings_sort_by' - $ref: '#/components/parameters/query_order' - $ref: '#/components/parameters/query_page' - $ref: '#/components/parameters/query_per_page' responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: meetings: type: array items: properties: meeting: $ref: '#/components/schemas/Meeting' total_count: $ref: '#/components/schemas/Page_data/properties/total_count' page: $ref: '#/components/schemas/Page_data/properties/page' per_page: $ref: '#/components/schemas/Page_data/properties/per_page' max_page: $ref: '#/components/schemas/Page_data/properties/max_page' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' post: operationId: createContactMeeting summary: Create a meeting for a specific contact description: "Logs a meeting against this contact. place is free-form text (max 100 characters); meeting_time records when it happened." tags: - Contacts parameters: - $ref: '#/components/parameters/path_contact_id' requestBody: required: true content: application/json: schema: properties: meeting_time_int: $ref: '#/components/schemas/Meeting/properties/meeting_time_int' place: $ref: '#/components/schemas/Meeting/properties/place' text: $ref: '#/components/schemas/Meeting/properties/text' # meeting_result: # $ref: '#/components/schemas/Meeting/properties/meeting_result' user_ids_to_notify: type: array description: A list of user IDs to notify items: type: string format: bson-id example: 5aba31e99007ba0f570c12f7 responses: 201: description: Created content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: meeting: $ref: '#/components/schemas/Meeting' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /contacts/{contact_id}/relationships: get: operationId: listContactRelationships summary: Get all relationships for a specific contact description: "Returns the relationships this contact is part of. Each one is a single record naming both contacts, with the variant label that applies to each end. Filter by relationship_type_id or narrow to a specific pair." tags: - Contacts parameters: - $ref: '#/components/parameters/path_contact_id' - $ref: '#/components/parameters/query_relationships_type_id' - $ref: '#/components/parameters/query_relationships_contact_id_filter' - $ref: '#/components/parameters/query_relationships_variant_id_filter' - $ref: '#/components/parameters/query_relationships_search' - $ref: '#/components/parameters/query_relationship_symmetrical' - $ref: '#/components/parameters/query_date_filter' - $ref: '#/components/parameters/query_since' - $ref: '#/components/parameters/query_until' - $ref: '#/components/parameters/query_modified_since' - $ref: '#/components/parameters/query_unmodified_since' - $ref: '#/components/parameters/query_sort_by' - $ref: '#/components/parameters/query_order' - $ref: '#/components/parameters/query_page' - $ref: '#/components/parameters/query_per_page' responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: relationships: type: array items: properties: relationship: $ref: '#/components/schemas/Relationship' total_count: $ref: '#/components/schemas/Page_data/properties/total_count' page: $ref: '#/components/schemas/Page_data/properties/page' per_page: $ref: '#/components/schemas/Page_data/properties/per_page' max_page: $ref: '#/components/schemas/Page_data/properties/max_page' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' post: operationId: createContactRelationship summary: Create a relationships for a specific contact description: "Links this contact to another. related_contacts must hold exactly two entries — one of them this contact — each with the variant_id for its end. No reverse record is created; the relationship is a single document covering both. A contact can hold at most one relationship with any given other contact." tags: - Contacts parameters: - $ref: '#/components/parameters/path_contact_id' requestBody: required: true content: application/json: schema: properties: relationship_type_id: type: string format: bson-id description: ID of the relationship type example: 5aaa9b059007ba08c9ebaf58 related_contacts: minItems: 2 maxItems: 2 type: array description: Related contacts with relationship variant names items: type: object properties: contact_id: type: string format: bson-id description: ID of the contact example: 5aba31ea9007ba0f570c92d4 variant_id: type: string format: bson-id description: ID of the relationship variant example: 5aaa9b059007ba08c9ebaf59 example: - contact_id: 5aba31ea9007ba0f570c92d4 variant_id: 5aaa9b059007ba08c9ebaf59 - contact_id: 5aba31ea9007ba0f570c92d5 variant_id: 5aaa9b059007ba08c9ebaf59 responses: 201: description: Created content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: relationship: $ref: '#/components/schemas/Relationship' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /contacts/{contact_id}/relationships/{relationship_id}: get: operationId: getContactRelationship summary: Get a specific relationship description: "Returns one relationship for this contact, naming both parties and the variant label at each end. The contact in the path must be one of the two parties, otherwise the request is rejected as invalid." tags: - Contacts parameters: - $ref: '#/components/parameters/path_contact_id' - $ref: '#/components/parameters/path_relationship_id' responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: relationship: $ref: '#/components/schemas/Relationship' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' put: operationId: updateContactRelationship summary: Update a specific relationship description: "Replaces a relationship outright: send relationship_type_id and both related_contacts entries in full. The type can change and one contact can be swapped, but the path contact must remain a party." tags: - Contacts parameters: - $ref: '#/components/parameters/path_contact_id' - $ref: '#/components/parameters/path_relationship_id' requestBody: required: true content: application/json: schema: properties: relationship_type_id: type: string format: bson-id description: ID of the relationship type example: 5aaa9b059007ba08c9ebaf57 related_contacts: minItems: 2 maxItems: 2 type: array description: Related contacts with relationship variant names items: type: object properties: contact_id: type: string format: bson-id description: ID of the contact example: 5aba31ea9007ba0f570c92d4 variant_id: type: string format: bson-id description: ID of the relationship variant example: 5aaa9b059007ba08c9ebaf59 example: - contact_id: 5aba31ea9007ba0f570c92d4 variant_id: 5aaa9b059007ba08c9ebaf59 - contact_id: 5aba31ea9007ba0f570c92d5 variant_id: 5aaa9b059007ba08c9ebaf59 responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: relationship: $ref: '#/components/schemas/Relationship' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' delete: operationId: deleteContactRelationship summary: Delete a relationship description: "Deletes a relationship between two contacts. Repeat the same request with undo=true to restore it." tags: - Contacts parameters: - $ref: '#/components/parameters/path_contact_id' - $ref: '#/components/parameters/path_relationship_id' - in: query name: undo description: Undo relationship deletion schema: type: boolean format: boolean example: true responses: 200: $ref: '#/components/responses/200' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /contacts/{contact_id}/assign_tag/{tag_name}: put: operationId: assignContactTag summary: Assign a tag to a specific contact description: "Adds the tag to the contact. Tag names match the account's existing tags case-insensitively." tags: - Contacts parameters: - $ref: '#/components/parameters/path_contact_id' - $ref: '#/components/parameters/path_tag_name' responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: type: object lead_sources: type: array items: $ref: '#/components/schemas/Lead_source' statuses: type: array items: type: object properties: status: $ref: '#/components/schemas/Status' tags: properties: tags: type: array items: $ref: '#/components/schemas/Tag' system_tags: type: array items: $ref: '#/components/schemas/Tag' contacts_count: $ref: '#/components/schemas/Contacts_count' team_stream: $ref: '#/components/schemas/Team_stream' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /contacts/{contact_id}/unassign_tag/{tag_name}: put: operationId: unassignContactTag summary: Remove a tag from a specific contact description: "Removes the tag from the contact." tags: - Contacts parameters: - $ref: '#/components/parameters/path_contact_id' - $ref: '#/components/parameters/path_tag_name' responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: type: object lead_sources: type: array items: $ref: '#/components/schemas/Lead_source' statuses: type: array items: type: object properties: status: $ref: '#/components/schemas/Status' tags: properties: tags: type: array items: $ref: '#/components/schemas/Tag' system_tags: type: array items: $ref: '#/components/schemas/Tag' contacts_count: $ref: '#/components/schemas/Contacts_count' team_stream: $ref: '#/components/schemas/Team_stream' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /contacts/{contact_id}/change_status/{status_id}: put: operationId: changeContactStatus summary: Change the status of a specific contact description: "Sets the contact's status. The status must be one of the account's configured statuses." tags: - Contacts parameters: - $ref: '#/components/parameters/path_contact_id' - $ref: '#/components/parameters/path_status_id' responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: contact: $ref: '#/components/schemas/Contact' next_actions: type: array items: $ref: '#/components/schemas/Action' next_action: $ref: '#/components/schemas/Action' queued_actions: type: array items: $ref: '#/components/schemas/Action' next_action_conflicts: type: array items: {} example: [] company: $ref: '#/components/schemas/Company' lead_sources: type: array items: $ref: '#/components/schemas/Lead_source' statuses: type: array items: type: object properties: status: $ref: '#/components/schemas/Status' tags: properties: tags: type: array items: $ref: '#/components/schemas/Tag' system_tags: type: array items: $ref: '#/components/schemas/Tag' contacts_count: $ref: '#/components/schemas/Contacts_count' team_stream: $ref: '#/components/schemas/Team_stream' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /contacts/{contact_id}/change_owner/{owner_id}: put: operationId: changeContactOwner summary: Change the owner of a specific contact description: "Sets the contact's owner." tags: - Contacts parameters: - $ref: '#/components/parameters/path_contact_id' - $ref: '#/components/parameters/path_owner_id' responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: contact: $ref: '#/components/schemas/Contact' next_actions: type: array items: $ref: '#/components/schemas/Action' next_action: $ref: '#/components/schemas/Action' queued_actions: type: array items: $ref: '#/components/schemas/Action' next_action_conflicts: type: array items: {} example: [] company: $ref: '#/components/schemas/Company' lead_sources: type: array items: $ref: '#/components/schemas/Lead_source' statuses: type: array items: type: object properties: status: $ref: '#/components/schemas/Status' tags: properties: tags: type: array items: $ref: '#/components/schemas/Tag' system_tags: type: array items: $ref: '#/components/schemas/Tag' contacts_count: $ref: '#/components/schemas/Contacts_count' team_stream: $ref: '#/components/schemas/Team_stream' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /contacts/{contact_id}/star: put: operationId: starContact summary: Apply a star to a specific contact description: "Stars the contact for the calling user. Starring is per user — it does not change how teammates see the contact." tags: - Contacts parameters: - $ref: '#/components/parameters/path_contact_id' responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: contact: $ref: '#/components/schemas/Contact' next_actions: type: array items: $ref: '#/components/schemas/Action' next_action: $ref: '#/components/schemas/Action' queued_actions: type: array items: $ref: '#/components/schemas/Action' next_action_conflicts: type: array items: {} example: [] company: $ref: '#/components/schemas/Company' lead_sources: type: array items: $ref: '#/components/schemas/Lead_source' statuses: type: array items: type: object properties: status: $ref: '#/components/schemas/Status' tags: properties: tags: type: array items: $ref: '#/components/schemas/Tag' system_tags: type: array items: $ref: '#/components/schemas/Tag' contacts_count: $ref: '#/components/schemas/Contacts_count' team_stream: $ref: '#/components/schemas/Team_stream' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /contacts/{contact_id}/unstar: put: operationId: unstarContact summary: Remove star from a specific contact description: "Removes the calling user's star from the contact. Starring is per user." tags: - Contacts parameters: - $ref: '#/components/parameters/path_contact_id' responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: contact: $ref: '#/components/schemas/Contact' next_actions: type: array items: $ref: '#/components/schemas/Action' next_action: $ref: '#/components/schemas/Action' queued_actions: type: array items: $ref: '#/components/schemas/Action' next_action_conflicts: type: array items: {} example: [] company: $ref: '#/components/schemas/Company' lead_sources: type: array items: $ref: '#/components/schemas/Lead_source' statuses: type: array items: type: object properties: status: $ref: '#/components/schemas/Status' tags: properties: tags: type: array items: $ref: '#/components/schemas/Tag' system_tags: type: array items: $ref: '#/components/schemas/Tag' contacts_count: $ref: '#/components/schemas/Contacts_count' team_stream: $ref: '#/components/schemas/Team_stream' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /contacts/{contact_id}/close_sales_cycle: put: operationId: closeContactSalesCycle summary: Close the sales cycle for a specific contact description: >- Only do this when you are no longer actively trying to sell to this contact. Add an optional closing comment with the `comment` field in the request body. Note: cannot close sales cycle if the user has any active (not complete) actions with the contact. tags: - Contacts parameters: - $ref: '#/components/parameters/path_contact_id' requestBody: required: true content: application/json: schema: properties: comment: type: string maxLength: 140 example: Joe is not interested in buying windmills at this time. responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: contact: $ref: '#/components/schemas/Contact' next_actions: type: array items: $ref: '#/components/schemas/Action' next_action: $ref: '#/components/schemas/Action' queued_actions: type: array items: $ref: '#/components/schemas/Action' next_action_conflicts: type: array items: {} example: [] company: $ref: '#/components/schemas/Company' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /contacts/{contact_id}/force_close_sales_cycle: put: operationId: forceCloseContactSalesCycle summary: Force close the sales cycle for a specific contact description: >- This will first delete any actions assigned to the contact. Add an optional closing comment with the `comment` field in the request body. tags: - Contacts parameters: - $ref: '#/components/parameters/path_contact_id' requestBody: required: true content: application/json: schema: properties: comment: type: string maxLength: 140 example: Joe is not interested in buying windmills at this time. responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: contact: $ref: '#/components/schemas/Contact' next_actions: type: array items: $ref: '#/components/schemas/Action' next_action: $ref: '#/components/schemas/Action' queued_actions: type: array items: $ref: '#/components/schemas/Action' next_action_conflicts: type: array items: {} example: [] company: $ref: '#/components/schemas/Company' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /contacts/{contact_id}/reopen_sales_cycle: put: operationId: reopenContactSalesCycle summary: Reopen the sales cycle for a specific contact description: "Reopens a closed sales cycle for the contact, for the calling user." tags: - Contacts parameters: - $ref: '#/components/parameters/path_contact_id' responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: contact: $ref: '#/components/schemas/Contact' next_actions: type: array items: $ref: '#/components/schemas/Action' next_action: $ref: '#/components/schemas/Action' queued_actions: type: array items: $ref: '#/components/schemas/Action' next_action_conflicts: type: array items: {} example: [] company: $ref: '#/components/schemas/Company' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /contacts/{contact_id}/split: put: operationId: splitContact summary: Split a contact from their current company (and potentially to a new company) description: >- Contact is removed (split) from it's current company, and optionally joins another. Send the field `company_name` in the body with the new company's name, or leave blank. **Warning**: splitting the last contact from a company, will cause that company to be deleted, and loss of company data may occur e.g. company phone number or postal address. tags: - Contacts parameters: - $ref: '#/components/parameters/path_contact_id' requestBody: required: true content: application/json: schema: properties: company_name: type: string description: The name of the company the contact is joining (leave blank to remain without a company) maxLength: 55 example: Fancy New Company Inc. responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: contact: $ref: '#/components/schemas/Contact' next_actions: type: array items: $ref: '#/components/schemas/Action' next_action: $ref: '#/components/schemas/Action' queued_actions: type: array items: $ref: '#/components/schemas/Action' next_action_conflicts: type: array items: {} example: [] company: $ref: '#/components/schemas/Company' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /contacts/{contact_id}/pinned_attachments: get: operationId: listContactPinnedAttachments summary: Get a list of attachments pinned to this contact description: The list of pinned attachments is sorted based on "pinned_at" field, i.e. most recent attachments come first, the list of attachments is paginated. tags: - Contacts parameters: - $ref: '#/components/parameters/path_contact_id' responses: 200: description: 'OK' content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: pinned_attachments: type: array items: $ref: '#/components/schemas/Attachment' total_count: $ref: '#/components/schemas/Page_data/properties/total_count' page: $ref: '#/components/schemas/Page_data/properties/page' per_page: $ref: '#/components/schemas/Page_data/properties/per_page' max_page: $ref: '#/components/schemas/Page_data/properties/max_page' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /contacts/cascade: get: operationId: listContactsCascade summary: Get contacts past the 10,000 contact in the account description: >- Defaults to contacts owned by the logged user, alpha sorted. This endpoint can get contacts above the 10,000 contact. Results returned in batches of 100. Pass the last `contact_id` of the last request into the next request to get the next batch of 100 contacts. tags: - Contacts responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: contacts: type: array items: properties: contact: $ref: '#/components/schemas/Contact' next_actions: type: array items: $ref: '#/components/schemas/Action' next_action: $ref: '#/components/schemas/Action' queued_actions: type: array items: $ref: '#/components/schemas/Action' next_action_conflicts: type: array items: {} example: [] company: $ref: '#/components/schemas/Company' items_left: type: integer format: int32 description: Total number of items left readOnly: true example: 32500 next_set_url: type: string description: The URL to use to get the next batch of contacts readOnly: true example: https://app.onepagecrm.com/api/v3/contacts/cascade/5d2c8ca59b79b2ead94aa425 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /contacts/cascade/{last_id}: get: operationId: listContactsCascadeAfter summary: Get contacts past the 10,000 contact in the account. description: >- Defaults to contacts owned by the logged user, alpha sorted. This endpoint can get contacts above the 10,000 contact. Results returned in batches of 100. Pass the last `contact_id` of the last request into the next request to get the next batch of 100 contacts. tags: - Contacts parameters: - name: last_id in: path required: true description: Contact ID schema: type: string minimum: 1 responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: contacts: type: array items: properties: contact: $ref: '#/components/schemas/Contact' next_actions: type: array items: $ref: '#/components/schemas/Action' next_action: $ref: '#/components/schemas/Action' queued_actions: type: array items: $ref: '#/components/schemas/Action' next_action_conflicts: type: array items: {} example: [] company: $ref: '#/components/schemas/Company' items_left: type: integer format: int32 description: Total number of items left readOnly: true example: 32500 next_set_url: type: string description: The URL to use to get the next batch of contacts readOnly: true example: https://app.onepagecrm.com/api/v3/contacts/cascade/5d2c8ca59b79b2ead94aa425 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' #/contacts/cascade/{last_id} /action_stream: get: operationId: getActionStream summary: Get a list of contacts prioritized by their next action description: >- Defaults to the logged API users action stream. tags: - Action Stream parameters: - $ref: '#/components/parameters/query_team' # Search field values - $ref: '#/components/parameters/query_contacts_search' - $ref: '#/components/parameters/query_contacts_phone' - $ref: '#/components/parameters/query_url' # Boolean flags/filters - $ref: '#/components/parameters/query_action_stream' - $ref: '#/components/parameters/query_has_actions' - $ref: '#/components/parameters/query_has_actions_for_me' - $ref: '#/components/parameters/query_pending_deal' - $ref: '#/components/parameters/query_starred' - $ref: '#/components/parameters/query_waiting' # Related value constraints - $ref: '#/components/parameters/query_email' - $ref: '#/components/parameters/query_contacts_letter' - $ref: '#/components/parameters/query_custom_field_id' - $ref: '#/components/parameters/query_custom_field_value' - $ref: '#/components/parameters/query_lead_source' - $ref: '#/components/parameters/query_lead_source_id' - $ref: '#/components/parameters/query_status_id' - $ref: '#/components/parameters/query_contacts_owner_id' - $ref: '#/components/parameters/query_contacts_company_id' - $ref: '#/components/parameters/query_contacts_tag' - $ref: '#/components/parameters/query_contacts_filter_id' # Date filters - $ref: '#/components/parameters/query_date_filter' - $ref: '#/components/parameters/query_since' - $ref: '#/components/parameters/query_until' - $ref: '#/components/parameters/query_modified_since' - $ref: '#/components/parameters/query_unmodified_since' # Sort order - $ref: '#/components/parameters/query_contacts_sort_by' - $ref: '#/components/parameters/query_order' # Pagination - $ref: '#/components/parameters/query_page' - $ref: '#/components/parameters/query_per_page' responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: contacts: type: array items: properties: contact: $ref: '#/components/schemas/Contact' next_actions: type: array items: $ref: '#/components/schemas/Action' next_action: $ref: '#/components/schemas/Action' queued_actions: type: array items: $ref: '#/components/schemas/Action' next_action_conflicts: type: array items: {} example: [] company: $ref: '#/components/schemas/Company' total_count: $ref: '#/components/schemas/Page_data/properties/total_count' page: $ref: '#/components/schemas/Page_data/properties/page' per_page: $ref: '#/components/schemas/Page_data/properties/per_page' max_page: $ref: '#/components/schemas/Page_data/properties/max_page' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /team_stream: get: operationId: getTeamStream summary: Get a list of contacts prioritized by their next action description: >- Defaults to the action stream for entire account in a single list. See the action stream of account users, by providing the `user_id` param. tags: - Team Stream parameters: - $ref: '#/components/parameters/query_user_id' - $ref: '#/components/parameters/query_team' # Search field values - $ref: '#/components/parameters/query_contacts_search' - $ref: '#/components/parameters/query_contacts_phone' - $ref: '#/components/parameters/query_url' # Boolean flags/filters - $ref: '#/components/parameters/query_action_stream' - $ref: '#/components/parameters/query_has_actions' - $ref: '#/components/parameters/query_has_actions_for_me' - $ref: '#/components/parameters/query_pending_deal' - $ref: '#/components/parameters/query_starred' - $ref: '#/components/parameters/query_waiting' # Related value constraints - $ref: '#/components/parameters/query_email' - $ref: '#/components/parameters/query_contacts_letter' - $ref: '#/components/parameters/query_custom_field_id' - $ref: '#/components/parameters/query_custom_field_value' - $ref: '#/components/parameters/query_lead_source' - $ref: '#/components/parameters/query_lead_source_id' - $ref: '#/components/parameters/query_status_id' - $ref: '#/components/parameters/query_contacts_owner_id' - $ref: '#/components/parameters/query_contacts_company_id' - $ref: '#/components/parameters/query_contacts_tag' - $ref: '#/components/parameters/query_contacts_filter_id' # Date filters - $ref: '#/components/parameters/query_date_filter' - $ref: '#/components/parameters/query_since' - $ref: '#/components/parameters/query_until' - $ref: '#/components/parameters/query_modified_since' - $ref: '#/components/parameters/query_unmodified_since' # Sort order - $ref: '#/components/parameters/query_contacts_sort_by' - $ref: '#/components/parameters/query_order' # Pagination - $ref: '#/components/parameters/query_page' - $ref: '#/components/parameters/query_per_page' responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: contacts: type: array items: properties: contact: $ref: '#/components/schemas/Contact' next_actions: type: array items: $ref: '#/components/schemas/Action' next_action: $ref: '#/components/schemas/Action' queued_actions: type: array items: $ref: '#/components/schemas/Action' next_action_conflicts: type: array items: {} example: [] company: $ref: '#/components/schemas/Company' total_count: $ref: '#/components/schemas/Page_data/properties/total_count' page: $ref: '#/components/schemas/Page_data/properties/page' per_page: $ref: '#/components/schemas/Page_data/properties/per_page' max_page: $ref: '#/components/schemas/Page_data/properties/max_page' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /notifications: get: operationId: listNotifications summary: Get a list of notifications that user has description: >- Returns all notifications (except emails and links) for the given user tags: - Notifications parameters: # Pagination - $ref: '#/components/parameters/query_page' - $ref: '#/components/parameters/query_per_page' responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: notifications: type: array items: properties: notification: $ref: '#/components/schemas/Notification' total_count: $ref: '#/components/schemas/Page_data/properties/total_count' page: $ref: '#/components/schemas/Page_data/properties/page' per_page: $ref: '#/components/schemas/Page_data/properties/per_page' max_page: $ref: '#/components/schemas/Page_data/properties/max_page' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /notifications/{notification_id}: get: operationId: getNotification summary: Get serialised notification by ID description: "Returns one of your notifications by ID. The type field identifies what it is about — for example an assigned action, a note, call, meeting, email or contact assignment — and read shows whether it has been seen. Notifications are removed once 100 newer ones have been generated for you." tags: - Notifications parameters: - $ref: '#/components/parameters/path_notification_id' responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: notification: $ref: '#/components/schemas/Notification' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /notifications/{notification_id}/mark_as_read: post: operationId: markNotificationAsRead summary: Marks given notification as read description: Marks given notification as read tags: - Notifications parameters: - $ref: '#/components/parameters/path_notification_id' responses: 201: description: Created content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: notification: $ref: '#/components/schemas/Notification' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /notifications/mark_all_as_read: post: operationId: markAllNotificationsAsRead summary: Marks all users' notifications as read description: Marks all users' notifications as read tags: - Notifications parameters: [] responses: 201: description: Created content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: type: object 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /webhooks: get: operationId: listWebhooks summary: Get all webhooks (associated with the logged API user's account) description: "Returns the account's webhook subscriptions — each endpoint, its secret and the events it receives." tags: - Web Hooks parameters: [] responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: webhooks: type: array items: $ref: '#/components/schemas/Webhook' total_count: $ref: '#/components/schemas/Page_data/properties/total_count' page: $ref: '#/components/schemas/Page_data/properties/page' per_page: $ref: '#/components/schemas/Page_data/properties/per_page' max_page: $ref: '#/components/schemas/Page_data/properties/max_page' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /webhooks/{webhook_id}: get: operationId: getWebhook summary: Get a specific webhook description: "Returns one webhook subscription." tags: - Web Hooks parameters: - $ref: '#/components/parameters/path_webhook_id' responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: $ref: '#/components/schemas/Webhook' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' delete: operationId: deleteWebhook summary: Delete a specific webhook description: "Deletes a webhook subscription. OnePageCRM stops posting events to its endpoint." tags: - Web Hooks parameters: - $ref: '#/components/parameters/path_webhook_id' responses: 200: $ref: '#/components/responses/200' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /pipelines: get: operationId: listPipelines summary: Get all pipelines (associated with the logged API user's account) description: "Returns the account's deal pipelines, each with its ordered stages. default marks the pipeline that is default for you specifically, and stages carry a numeric position and a label." tags: - Pipelines parameters: [] responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: pipelines: type: array items: properties: pipeline: $ref: '#/components/schemas/Pipeline' total_count: $ref: '#/components/schemas/Page_data/properties/total_count' page: $ref: '#/components/schemas/Page_data/properties/page' per_page: $ref: '#/components/schemas/Page_data/properties/per_page' max_page: $ref: '#/components/schemas/Page_data/properties/max_page' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' /pipelines/{pipeline_id}: get: operationId: getPipeline summary: Get a specific pipeline description: "Returns one pipeline with its ordered stages. Each stage has a numeric stage position and a label; a pipeline holds between one and nine stages. default reflects whether it is your own default pipeline." tags: - Pipelines parameters: - $ref: '#/components/parameters/path_pipeline_id' responses: 200: description: OK content: application/json: schema: properties: status: $ref: '#/components/schemas/Success/properties/status' message: $ref: '#/components/schemas/Success/properties/message' timestamp: $ref: '#/components/schemas/Success/properties/timestamp' data: properties: pipeline: $ref: '#/components/schemas/Pipeline' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 409: $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' components: schemas: Bootstrap: description: >- Bootstrap is a general wrapper around useful information you might need to interact with your OnePageCRM account using the API. properties: user_id: type: string format: bson-id description: ID of the logged API user readOnly: true example: 5aba31e99007ba0f570c12f7 auth_key: type: string description: Key used to sign API requests as a means of authentication readOnly: true example: c+g0Y3VGHdIztKbHcjVcOuwf34EmFlXI9Qot5hTvb2F= user: $ref: '#/components/schemas/User' team: type: array description: List of users who make up the rest of the logged API users team readOnly: true items: $ref: '#/components/schemas/User' account_type: type: string description: Descriptor for the type of the logged API user's account enum: - pro - trial - free readOnly: true example: pro settings: $ref: '#/components/schemas/Settings' cost_setup: $ref: '#/components/schemas/Cost_setup' custom_fields: type: array description: List of custom fields for the logged API user's account readOnly: true items: $ref: '#/components/schemas/Custom_field' company_fields: type: array description: List of company fields for the logged API user's account readOnly: true items: $ref: '#/components/schemas/Company_field' deal_fields: type: array description: List of deal fields for the logged API user's account readOnly: true items: $ref: '#/components/schemas/Deal_field' filters: type: array description: List of custom filters for the logged API's users account readOnly: true items: $ref: '#/components/schemas/Filter' call_results: type: object description: Map of call result keys to their display labels for the logged API's users account additionalProperties: type: string readOnly: true example: interested: Interested not_interested: Not interested left_message: Left message no_answer: No answer other: Other call_results_order: type: array description: Order for the list of call results for the logged API's users account items: type: string readOnly: true example: - interested - not_interested - left_message - no_answer - other next_action_dates: type: array description: Quick date options for ease of date selection when creating new actions readOnly: true items: properties: number: type: integer format: int32 description: Number of periods readOnly: true example: 5 period: type: string description: Period type enum: - days - weeks - months readOnly: true example: days predefined_actions: description: "The account's predefined actions (called 'Saved Actions' in the app)." type: array readOnly: true items: $ref: '#/components/schemas/Predefined_action' contact_titles: type: array description: List of titles which can be used to prefix the names of contacts items: type: string maxLength: 7 readOnly: true example: - Mr - Mrs - Ms User: description: >- Useful information about the logged user and other members of the team. Each can update their own info. Admins can update all. properties: id: type: string format: bson-id description: ID of the user readOnly: true example: 5aba31e99007ba0f570c12f7 first_name: type: string description: First name of the user example: Jane last_name: type: string description: Last name of the user example: Doe email: type: string description: Email address of the user example: jane.doe@example.com company_name: type: string description: Name of the company that the user works for example: Big Company Inc. account_rights: type: array description: List of permissions which the user possesses readOnly: true items: type: string enum: - account_owner - admin - activity - create_report - edit_target - deal_items - delete_contacts - delete_deals - pipeline - export - private_contacts - bulk_status - bulk_owner - save_to_google_contacts - download_contact_vcard - emails_full_sync - manage_autoflows - webforms example: - activity - edit_target - pipeline - export - private_contacts photo_url: type: string description: URL of the user’s profile picture readOnly: true example: https://{foo.bar}/jane-doe.jpg country_code: type: string description: ISO-3166 country code of the users address readOnly: true example: IE bcc_email: type: string description: BCC email dropbox address of the user (you only see your own) readOnly: true example: 5abg31e93007ba0f470c92q6@users.onepagecrm.com google_contacts_email: type: string description: Google Contacts email address of the user (you only see your own) readOnly: true example: jane.doe@example.com Contact: description: >- Information about the people you are actively trying to sell to, and related sub-resources like Actions, Deals, Notes, Calls and Meetings. properties: id: type: string format: bson-id description: ID of the contact readOnly: true example: 5aba31ea9007ba0f570c92d4 title: type: string description: The title of the contact enum: [ Mr, Mrs, Ms ] example: Mr first_name: type: string description: First name of the contact maxLength: 25 example: Joe last_name: type: string description: Last name of the contact maxLength: 25 example: Bloggs job_title: type: string description: Job title of the contact maxLength: 1000 example: Engineer starred: type: boolean description: Is the contact starred? example: true default: false photo_url: type: string description: URL of the contact's photo readOnly: true example: https://{foo.bar}/joe-bloggs.jpg company_id: type: string format: bson-id description: ID of the company, to which the contact belongs example: 5aba31ea9007ba0f570c92d5 company_name: type: string description: Name of the company, to whom the contact belongs maxLength: 55 example: Morgan's Forensic Lab urls: type: array description: URLs associated with the contact items: properties: type: type: string description: The type of URL enum: [website, blog, twitter, linkedin, xing, facebook, google_plus, other] example: linkedin value: type: string description: The URL associated with the contact example: https://www.linkedin.com/{joe.bloggs} phones: type: array description: Phone numbers associated with the contact items: properties: type: type: string description: The type of phone number enum: [work, mobile, home, direct, fax, company, other] example: work value: type: string description: The phone number associated with the contact example: (912) 644-1770 emails: type: array description: Email addresses associated with the contact items: properties: type: type: string description: The type of email address enum: [work, home, other] example: work value: type: string description: The email address associated with the contact example: joe.bloggs@example.com address_list: description: An array of contact addresses. type: array maxItems: 2 items: $ref: '#/components/schemas/Typed_address' status: type: string description: Status of the contact readOnly: true example: Prospect status_id: type: string format: bson-id description: ID of the status of the contact example: 5e31e030849d781e837b6ba1 tags: description: "Tags on the contact — free-form strings from the account's tag list." type: array items: type: string example: [ Java, Android, iOS ] lead_source_id: type: string description: ID of the lead source of the contact example: email_web lead_source: type: string description: Display name of the lead source of the contact example: Email or Web background: type: string description: Background infomation about the contact maxLength: 10240 example: >- I met Joe Bloggs at the annual Eco Conference in Florida. Her company currently provides solar panels (along with a lot of other stuff) to the State Government of California, Nevada, Oregon, Arizona and Utah for capital building projects. Her current supplier is crazy expensive! I've asked to be able to tender for their next order. owner_id: type: string format: bson-id description: ID of the user, to whom the contact belongs. Defaults to the logged API user's ID. example: 5aba31e99007ba0f570c92a5 custom_fields: description: "Custom field values on the contact, as custom field and value pairs." type: array items: type: object properties: custom_field: $ref: '#/components/schemas/Custom_field' value: type: string description: Value for the custom field example: Summer letter: type: string description: The first letter of the contacts last name readOnly: true example: b pending_deal: type: boolean description: Does the contact have one or more pending deals? readOnly: true example: true total_pendings: type: number description: The total value of all pending deals for the contact readOnly: true example: 999.99 total_deals_count: type: integer format: int32 description: Number of deals associated with the contact readOnly: true example: 3 company_size: type: integer format: int32 description: Number of contacts within the contact's company readOnly: true example: 1 sales_closed_for: type: array description: A list of user IDs, for whom the sales cycle is closed readOnly: true items: type: string example: [ 5aba31e99007ba0f570c12f7 ] closed_sales: type: array description: A list of closed sales objects readOnly: true items: properties: user_id: type: string format: bson-id description: ID of the user, for whom the sales cycle is closed readOnly: true example: 5aba31e99007ba0f570c12f7 closed_at: type: integer format: unix-timestamp description: Time that the sales cycle was closed readOnly: true example: 1524818902 comment: type: string maxLength: 140 description: An optional message detailing why the sales cycle was closed readOnly: true example: Client is no longer interested google_contacts_data: description: The google contacts data associated with this contact readOnly: true properties: account_email: type: string description: Google contacts email readOnly: true example: jane.doe@example.com id: type: string description: Google contact id readOnly: true example: 342c5b5c08d4b0b2 saved_at: type: integer format: unix-timestamp description: Time the contact was saved to google readOnly: true example: 1522840153 created_at: type: string format: date-time description: Creation time of the contact readOnly: true example: '2018-05-16T11:52:09Z' modified_at: type: string format: date-time description: Last modification time of the contact readOnly: true example: '2018-05-16T11:52:09Z' Company: description: >- Referred to as 'organizations' in the web application. Companies are logical collections of Contacts and related sub-resources e.g. Deals, Actions and some basic info on the org. e.g. postal address, website. A Company may not be created directly or exist without a Contact. required: - name properties: id: type: string format: bson-id description: ID of the company readOnly: true example: 5aba31e99007ba0f570c92ac image: type: string description: Base64 encoded binary image example: data:image/png;base64,iVBORw... name: type: string description: Name of the company maxLength: 55 example: Crockett & Tubbs Security description: type: string description: Description of the company maxLength: 10240 example: For all your security needs phone: type: string description: Phone number of the company example: (912) 644-1771 photo_url: type: string description: URL to company logo example: https://example.com/someimage.png url: type: string description: URL of the company example: https://{foo.bar} address: description: "The company's postal address." $ref: '#/components/schemas/Address' company_fields: description: "Custom field values on the company." type: array items: type: object properties: company_field: $ref: '#/components/schemas/Company_field' value: type: string description: Value for the company field example: Large syncing_status: type: boolean description: Should all contacts in this company share the same status? example: true synced_status_id: type: string format: bson-id description: ID of the status, that all contacts within this company are synced to example: 5aaa9b039007ba08c9ebaf0a syncing_tags: type: boolean description: Should all contacts in this company share the same tags? example: true synced_tags: type: array description: Tags that all contacts within this company share items: type: string example: [ Java, Android, iOS ] contacts_count: type: integer format: int32 description: Number of contacts in this company readOnly: true example: 3 won_deals_count: type: integer format: int32 description: Number of deals closed with contacts in this company readOnly: true example: 5 total_won_amount: type: number description: The total value of the won deals with contacts in this company readOnly: true example: 999.99 pending_deals_count: type: integer format: int32 description: Number of the pending deals with contacts in this company readOnly: true example: 1 total_pending_amount: type: number description: The total value of the pending deals with contacts in this company readOnly: true example: 99.99 contacts: description: List of contacts in the comapny type: array readOnly: true items: type: object properties: contact: $ref: '#/components/schemas/Contact' next_actions: type: array items: $ref: '#/components/schemas/Action' next_action: $ref: '#/components/schemas/Action' queued_actions: type: array items: $ref: '#/components/schemas/Action' next_action_conflicts: type: array items: {} example: [] pending_deals: description: "Pending deals across the company's contacts." type: array readOnly: true items: type: object properties: deal: $ref: '#/components/schemas/Deal' created_at: type: string format: date-time description: Creation time of the company readOnly: true example: '2018-05-16T11:52:09Z' modified_at: type: string format: date-time description: Last modification time of the company readOnly: true example: '2018-05-16T11:52:09Z' Action: description: >- Completable tasks related to Contacts. ASAP first, then dated actions ordered by due date (overdue first), followed by waiting for (blocked) and finally queued actions (without any date). required: - assignee_id - contact_id - text properties: id: type: string format: bson-id description: ID of the action readOnly: true example: 5aeac8789007ba56ffca92b9 assignee_id: type: string format: bson-id description: ID of the user, to whom the action is assigned. Defaults to the logged API user's ID. example: 5aaa9b009007ba08c9ebaef7 contact_id: type: string format: bson-id description: ID of the contact, with whom the action is associated example: 5aba31ea9007ba0f570c92d4 text: type: string description: The main text/description of the action maxLength: 140 example: '#1 Email Jane introducing our organization' status: type: string description: Status of the action enum: - asap - date - date_time - waiting - queued - queued_with_date - done example: date_time default: date date: type: string format: date description: >- Due date for the action (status must be one of `date`, `date_time` or `queued_with_date`). Defaults to today's date. example: '2018-05-16' exact_time: type: integer format: unix-timestamp description: The UNIX Epoch time in seconds the action is due (status must be `date_time`) example: 1526472000 position: type: integer format: int32 description: The position of the action (in the list of queued actions) example: 1 done: type: boolean description: Has the action been marked as complete? readOnly: true example: false done_at: type: string format: date description: The date the action was completed (only returned, if action complete) readOnly: true example: '2018-05-16' externally_controlled: type: boolean description: >- True while this action mirrors an external event (for example a booked meeting) that has not happened yet. Such an action cannot be rescheduled, completed or deleted — it can only be reassigned. The external provider owns `text`, `date`, `exact_time`, `status` and `done`. Call `PUT /actions/{action_id}/unlink` to detach the action and regain full control. The flag clears by itself once the event time has passed. readOnly: true example: false created_at: type: string format: date-time description: Creation time of the action readOnly: true example: '2018-05-16T11:52:09Z' modified_at: type: string format: date-time description: Last modification time of the action readOnly: true example: '2018-05-16T12:52:09Z' Deal: description: >- Represent (potential) financial transactions with your contacts. Deals include information like amount, deal stage, closed date or expected close date. Deals support file attachments. required: - contact_id - owner_id - name properties: id: type: string format: bson-id description: ID of the deal readOnly: true example: 5aaa9b059007ba08c9ebaf58 contact_id: type: string format: bson-id description: ID of the contact, to whom the deal belongs example: 5aaa9b059007ba08c9ebaf58 owner_id: type: string format: bson-id description: ID of the user, to whom the deal belongs. Defaults to the logged API user's ID. example: 5aba31e99007ba0f570c12f7 pipeline_id: type: string format: bson-id description: ID of a pipeline the deal belongs to example: 5cfa87a4849d7873db082f98 sales_pipeline_id: type: string format: bson-id description: ID of a sales pipeline the deal belongs to example: 5cfa87a4849d7873db082f98 name: type: string description: Name of the deal maxLength: 60 example: Solar panels text: type: string description: Extra notes related to the deal (supports `[b]bold[/b]` and `[i]italic[/i]` formatting) maxLength: 7168 example: Fingers crossed! stage: type: integer format: int32 description: >- A numerical representation of the progress of a pending deal (number ranging from 0 to 100 exclusive) example: 50 status: type: string description: Status of the deal enum: - pending - won - lost example: pending default: pending expected_close_date: type: string format: date description: The date the deal is expected to close (status should be `pending`). Defaults to today's date. example: '2018-04-15' close_date: type: string format: date description: The date the deal actually closed (status should be `won` or `lost`). Defaults to today's date. example: '2018-04-15' date: type: string format: date description: Creation date of the deal. Defaults to today's date. example: '2018-04-15' amount: type: number format: float description: The monitary value of the deal (per month, if multi-month deal) example: 99.99 default: 0.0 months: type: integer format: int32 description: Number of months the deal is to be paid for (1 for regular deals, 2+ for multi-month) example: 1 default: 1 cost: type: number format: float description: The monitary cost of the deal example: 0.0 default: 0.0 margin: type: number format: float description: Profit margin for the deal (`amount` minus `cost`) readOnly: true example: 99.99 total_amount: type: number format: float description: Product of amount and months (will only differ from `amount` field, if multi-month deal) readOnly: true example: 99.99 total_cost: type: number format: float description: Product of cost and months (will only differ from `cost` field, if multi-month deal) readOnly: true example: 0 commission_base: type: string description: Base used to calculate the commission of the deal enum: - amount - margin example: amount commission_type: type: string description: Type of commission for the deal enum: - none - percentage - absolute example: none default: none commission: type: number format: float description: Commission payable for the deal example: 0.0 default: 0.0 commission_percentage: type: number format: float description: Commission percentage for the deal example: 0.0 default: 0.0 reason_lost_id: type: string format: bson-id description: ID of the reason lost readOnly: true example: 5aaa9b059007ba08c9ebaf58 deal_fields: description: "Custom field values on the deal." type: array items: type: object properties: deal_field: $ref: '#/components/schemas/Deal_field' value: type: string description: Value for the deal field example: Large has_deal_items: type: boolean description: Does the deal have deal items? default: false example: true deal_items: description: "Line items on the deal — each with a name, quantity, price, cost and amount." type: array items: $ref: '#/components/schemas/Deal_item' author: type: string description: Shortened name of the creator of the deal. Defaults to the logged API user. example: Jane D. has_related_notes: type: boolean description: Does the deal have related notes? readOnly: true example: true attachments: description: "Files attached to the deal." type: array readOnly: true items: $ref: '#/components/schemas/Attachment' contact_info: description: Information about the contact, to whom the deal belongs (read only). readOnly: true properties: contact_name: type: string description: Name of the contact associated with the deal readOnly: true example: Joe Bloggs company: type: string description: Name of the company associated with the deal readOnly: true example: Big Company Inc. owner: description: Information about the deal owner (read only). readOnly: true properties: id: type: string description: ID of the deal owner readOnly: true example: 5aba31e99007ba0f570c12f7 name: type: string description: Name of the deal owner readOnly: true example: Joe Bloggs email: type: string description: Email address of the deal owner readOnly: true example: joe.bloggs@example.com previous_pipeline_stages: description: Returns the last stage in which the deal was for each pipeline (pipeline_id => stage) This field is returned only when 'include_history=true' param is supplied in query string type: object readOnly: true example: "5da7b67a849d78737812437c": 40 created_at: type: string format: date-time description: Creation time of the deal readOnly: true example: '2018-03-15T16:10:45Z' modified_at: type: string format: date-time description: Last modification time of the deal readOnly: true example: '2018-03-15T16:10:45Z' linked_contacts: type: array readOnly: true description: >- Short form of contacts linked to the deal. Always returned with the deal payload (on both `GET /deals` and `GET /deals/{deal_id}`). For full contact objects use `fields=contacts(all)` on `GET /deals`. items: type: object readOnly: true properties: id: type: string format: bson-id description: ID of the linked contact readOnly: true example: 68b5edd78b3ee61b685c8692 contact_name: type: string description: Full display name of the linked contact readOnly: true example: Sajed Almorsy company: type: string description: Display name of the company the contact belongs to (empty string if none) readOnly: true example: OnePageCRM photo_url: type: string description: URL of the contact's profile picture (empty string if none) readOnly: true example: '' example: - id: 68b5edd78b3ee61b685c8692 contact_name: Sajed Almorsy company: OnePageCRM photo_url: '' Note: description: >- Allow you to keep track of additional information related to your contacts. Notes can include any information you feel is relevant e.g. interactions with that contact. Notes support file attachments. required: - contact_id - text properties: id: type: string format: bson-id description: ID of the note readOnly: true example: 5afc1b69d556730b580596cb contact_id: type: string format: bson-id description: ID of the contact, to whom the note belongs example: 5ae06ef9d55673108fe8877f text: type: string description: Extra details related to the note(supports `[b]bold[/b]` and `[i]italic[/i]` formatting) maxLength: 7168 example: I met Jane Doe at the ABC conference. She's interested in hearing about XYZ. date: type: string format: date description: Creation date of the note. Defaults to today's date. example: '2018-05-16' linked_deal_id: type: string format: bson-id description: ID the of the deal, to which the note is linked (`null` if no linked deal) nullable: true example: '' linked_deal_name: type: string description: Name of the deal, to which the note is linked (`""` if no linked deal) example: '' author: type: string description: Shortened name of the creator of the note. Defaults to the logged API user. example: Jane D. attachments: description: "Files attached to the note." type: array readOnly: true items: $ref: '#/components/schemas/Attachment' created_at: type: string format: date-time description: Creation time of the note readOnly: true example: '2018-05-16T11:52:09Z' modified_at: type: string format: date-time description: Last modification time of the note readOnly: true example: '2018-05-16T11:52:09Z' Call: description: >- Allow you to keep track of phone calls made to your contacts. Calls include information like the phone number dialled and the call result. Calls support file attachments. required: - contact_id properties: id: type: string format: bson-id description: ID of the call readOnly: true example: 5afc1b69d556730b580596cb contact_id: type: string format: bson-id description: ID of the contact, to whom the call belongs example: 5ae06ef9d55673108fe8877f text: type: string description: Extra details related to the call (supports `[b]bold[/b]` and `[i]italic[/i]` formatting) maxLength: 7168 example: Mary is interested in coming into the office on Tuesday. call_result: type: string description: Key of the `call_result` which best describes the result of the call example: interested call_time_int: type: integer format: unix-timestamp description: >- Time the call occurred in UNIX Epoch time in seconds (defaults to current time, if left blank). example: 1525273653 via: type: string description: Through which application did the call take place enum: - unknown - jabber - talkdesk - phone example: phone default: unknown phone_number: type: string description: Phone number used to make the call example: (912) 644-1770 (mobile) recording_link: type: string description: URL of the recording of the call conversation nullable: true example: '' author: type: string description: Shortened name of the creator of the call. Defaults to the logged API user. example: Jane D. readOnly: true attachments: description: "Files attached to the call." type: array readOnly: true items: $ref: '#/components/schemas/Attachment' created_at: type: string format: date-time description: Creation time of the call readOnly: true example: '2018-05-16T11:52:09Z' modified_at: type: string format: date-time description: Last modification time of the call readOnly: true example: '2018-05-16T11:52:09Z' index: type: integer format: int32 description: Index of the call (in the results set) readOnly: true example: 1 Meeting: description: >- Allow you to keep track of meetings held with your contacts. Meetings include information like the place and the meeting result. Meetings support file attachments. required: - contact_id properties: id: type: string format: bson-id description: ID of the meeting readOnly: true example: 5afc1b69d556730b580596cb contact_id: type: string format: bson-id description: ID of the contact, to whom the meeting belongs example: 5ae06ef9d55673108fe8877f text: type: string description: Extra details related to the meeting (supports `[b]bold[/b]` and `[i]italic[/i]` formatting) maxLength: 7168 example: Mary is interested in coming into the office on Tuesday. # meeting_result: # type: string # format: bson-id # description: ID of the `meeting_result` which best describes the result of the meeting # example: interested meeting_time_int: type: integer format: unix-timestamp description: >- Time the meeting occurred in UNIX Epoch time (defaults to current time, if left blank) example: 1525273653 place: type: string description: The place in which the meeting take place maxLength: 100 example: Meeting room 1 author: type: string description: Shortened name of the creator of the meeting. Defaults to the logged API user. example: Jane D. readOnly: true attachments: description: "Files attached to the meeting." type: array readOnly: true items: $ref: '#/components/schemas/Attachment' created_at: type: string format: date-time description: Creation time of the meeting readOnly: true example: '2018-05-16T11:52:09Z' modified_at: type: string format: date-time description: Last modification time of the meeting readOnly: true example: '2018-05-16T11:52:09Z' index: type: integer format: int32 description: Index of the meeting (in the results set) readOnly: true example: 1 Address: description: The physical address of a contact or company. properties: address: type: string description: Property name/number and street name example: Unit 5, Business Innovation Centre city: type: string description: Name of the city example: Upper Newcastle state: type: string description: Name of the state example: Galway zip_code: type: string description: Zip code example: H91 Y0T0 country_code: type: string description: ISO-3166 country code example: IE Typed_address: description: The physical address of a contact or company. properties: address: description: "Street address." $ref: '#/components/schemas/Address/properties/address' city: description: "City." $ref: '#/components/schemas/Address/properties/city' state: description: "State, province or region." $ref: '#/components/schemas/Address/properties/state' zip_code: description: "Postal or ZIP code." $ref: '#/components/schemas/Address/properties/zip_code' country_code: description: "ISO 3166 country code, upper-case." $ref: '#/components/schemas/Address/properties/country_code' type: type: string description: Type of the address default: work enum: - work - home - billing - delivery - other example: delivery Attachment: description: >- Additional files associated with Deals, Notes, Calls or Meetings. They can be uploaded and stored in S3, or stored in external providers i.e. Google Drive, Dropbox, Evernote. required: - filename - size properties: id: type: string format: bson-id description: ID of the attachment readOnly: true example: 5afc1ea9d556730b780096db filename: type: string description: Name of the attachment file example: mario.jpg custom_filename: type: string description: Custom name of the attachment file example: another_mario.jpg pinned: type: boolean description: Show if the attachment is pinned to its owner contact example: true pinned_at: type: string description: Shows pinned at timestamp. Is null if pinned == false example: '2022-01-24T10:42:39Z' size: type: integer format: int32 description: Size of the attachment file (in bytes) example: 3841 storage_provider: type: string description: Name of the storage provider (where the attachment file is stored) readOnly: true enum: - amazon - google_drive - dropbox - evernote example: amazon url: type: string description: External URL of the attachment file readOnly: true example: https://{foo.bar}/mario.jpg url_expires_at: type: string format: date-time description: The time the attachment URL expires readOnly: true example: '2018-05-16T13:06:53Z' thumbnail: type: object description: >- An image preview of the attachment file (if one exists) properties: url: readOnly: true type: string description: External URL of the attachment's thumbnail example: https://{foo.bar}/mario-thumbnail.jpg Relationship_Type: description: >- The relationship types that identifies the relationships between the contacts. required: - relationship_variants properties: id: type: string format: bson-id description: ID of the relationship type readOnly: true example: 5aaa9b059007ba08c9ebaf58 symmetrical: type: boolean description: Is the relationship symmetrical? (read only). readOnly: true example: true relationship_variants: description: "The directional variants of this relationship type." type: array items: type: object properties: id: type: string format: bson-id description: ID of the relationship type readOnly: true example: 5aaa9b059007ba08c9ebaf59 name: type: string description: The relationship variant name example: Partner created_at: type: string format: date-time description: Creation time of the relationship type readOnly: true example: '2018-03-15T16:10:45Z' modified_at: type: string format: date-time description: Last modification time of the relationship type readOnly: true example: '2018-03-15T16:10:45Z' Related_contact: minItems: 2 maxItems: 2 type: array description: The contacts participating in the relationship along with their associated variant names items: type: object properties: variant_id: type: string format: bson-id description: ID of the relationship variant example: 5aaa9b059007ba08c9ebaf59 variant_name: type: string description: The name of the variant maxLength: 35 readOnly: true example: Partner contact_id: type: string format: bson-id description: ID of the contact example: 5aba31ea9007ba0f570c92d4 first_name: type: string description: The first name of the contact maxLength: 35 readOnly: true example: Joe last_name: type: string description: The last name of the contact maxLength: 35 readOnly: true example: Bloggs photo_url: type: string description: URL of the contact’s photo readOnly: true example: "https://{foo.bar}/joe-bloggs.jpg" company_id: type: string format: bson-id description: ID of the company, to which the contact belongs readOnly: true example: 5aba31ea9007ba0f570c92d5 company_name: type: string description: Name of the company, to whom the contact belongs maxLength: 55 readOnly: true example: Morgan's Forensic Lab owner_id: type: string format: bson-id description: ID of the user, to whom the contact belongs readOnly: true example: 5aba31e99007ba0f570c92a5 example: - variant_id: 5aaa9b059007ba08c9ebaf59 variant_name: Partner contact_id: 5aba31ea9007ba0f570c92d4 first_name: Joe last_name: Bloggs company_id: 5aba31ea9007ba0f570c92f1 company_name: Morgan's Forensic Lab photo_url: https://{foo.bar}/joe-bloggs.jpg owner_id: 5aba31ea9007ba0f570c92c3 - variant_id: 5aaa9b059007ba08c9ebaf59 variant_name: Partner contact_id: 5aba31ea9007ba0f570c92d5 first_name: Jane last_name: Doe company_id: 5aba31ea9007ba0f570c92f3 company_name: Acme Inc photo_url: https://{foo.bar}/jane-doe.jpg owner_id: 5aba31ea9007ba0f570c92c3 Relationship: description: >- The relationship mapping between contacts required: - relationship_type_id - related_contacts properties: id: type: string format: bson-id description: ID of the relationship readOnly: true example: 5aaa9b059007ba08c9ebaf57 relationship_type_id: type: string format: bson-id description: ID of the relationship type example: 5aaa9b059007ba08c9ebaf58 related_contacts: $ref: '#/components/schemas/Related_contact' created_at: type: string format: date-time description: Creation time of the relationship readOnly: true example: '2018-03-15T16:10:45Z' modified_at: type: string format: date-time description: Last modification time of the relationship readOnly: true example: '2018-03-15T16:10:45Z' Email_address: description: Email address with name to represent email header properties: address: type: string description: Email address example: 'joes.boss@example.com' name: type: string nullable: true description: Name associated with the email address example: 'Joes Boss' Notification: description: A serialised notification. There are different types of notifications, each can have its own properties properties: id: type: string format: bson-id description: ID of the notification readOnly: true example: 5aead4809007ba56ffca942e type: type: string description: Type of the notification enum: - assigned_action - action_with_time - contact_assigned - call - meeting - email - link - note readOnly: true example: assigned_action by: type: string description: User name that caused the notification readOnly: true example: Vlad K. read: type: boolean description: Tells if notification was marked as read example: true user_id: type: string format: bson-id description: The ID of affected user, ID of assignee user readOnly: true example: 5aead4809007ba56ffca942e contact_id: type: string format: bson-id description: The ID of a contact related to which the notification has been created readOnly: true example: 5aead4809007ba56ffca942e created_at: type: string #format: iso8601 description: Date which tells when the notification was created readOnly: true example: '2019-06-21T16:53:12Z' modified_at: type: string #format: iso8601 description: Date which tells when the notification was last updated readOnly: true example: '2019-06-21T16:53:12Z' mobile_data: type: object description: Data created for the purpose of push notifications for mobile apps readOnly: true properties: title: type: string description: Title of push notification readOnly: true example: 'Action assigned to you (by User N.)' body: type: string description: Body of push notification readOnly: true example: '17:13: in bulk' action_type: type: string description: Type of action readOnly: true example: 'action_with_time' Settings: description: Application settings for the logged API user e.g. localization and for the account e.g. deal stages. properties: reminder: $ref: '#/components/schemas/Reminder' time_zone: type: string description: The time zone, for the API logged user example: America/Los_Angeles not_working_days: type: string description: >- The days of the week, on which the user does not work (used to calculate the due date of promoted actions) enum: - none - weekend - sunday example: weekend default: none date_format: type: string description: The logged API users preferred format for date strings example: '%d/%m/%Y' time_with_ampm: type: boolean description: Use AM/PM (12-hour clock) for the time component of dates example: true listing_size: type: integer format: int32 description: The number of items requested per page when scrolling example: 10 default: 25 currency: type: string description: The currency for the account (only editable by admins) example: USD currency_symbol: type: string description: The currency symbol for the account (only editable by admins) example: $ separator: type: string description: Symbol used to represent a decimal separator example: '.' delimiter: type: string description: Symbol used to represent a thousands delimiter example: ',' popular_countries: type: array description: The last 5 countries that were used in contact/company addresses items: type: string readOnly: true example: - US - UK - IE - AU - DE deal_stages: description: "The account's configured deal stages." type: array items: $ref: '#/components/schemas/Deal_stage' pipelines: description: "The account's pipelines." type: array items: properties: pipeline: $ref: '#/components/schemas/Pipeline' default_contact_type: type: string description: Denotes whether the logged API user, thinks of sales as people or organizations enum: - company - individual example: company show_tidy_stream: type: boolean description: Only show contacts with actions in the action stream? example: false show_company_fields_with_contact: type: boolean description: Show organizational fields in contact view? example: true company_phone_enabled: type: boolean description: Is the company phone field enabled? example: true company_url_enabled: type: boolean description: Is the company URL field enabled? example: true company_address_enabled: type: boolean description: Is the company address field enabled? example: true company_description_enabled: type: boolean description: Is the company description field enabled? example: true send_push_notifications: type: boolean description: Should the user receive push notifications? example: true clipper_beta: type: boolean description: Has the user enabled the clipper beta feature? example: false bcc_email_enabled: type: boolean description: Has the user enabled the Bcc Capture address? example: true Status: description: >- Values which help qualify where contacts are in the sales pipeline. The list of Statuses is already populated but it may be updated if needed, to better fit your organization. required: - text - color properties: id: type: string format: bson-id description: ID of the status readOnly: true example: 5aead4809007ba56ffca942e status: description: Type of the status type: string enum: - lead - prospect - customer - inactive - general - custom1 - custom2 - customX readOnly: true example: prospect default: lead text: type: string description: Display text of the status maxLength: 20 example: Prospect description: type: string description: Longer description of what the status is for maxLength: 33 example: Actively selling to these people color: type: string format: hex-color description: The color of the status (six character hex value) enum: - '666666' - '3399ff' - 'cc0000' - 'f96600' - '000000' - 'ff00ff' - '009900' example: 'f96600' counts: type: integer format: int32 description: Number of contacts the (logged API) user owns, with the status readOnly: true example: 3 total_count: type: integer format: int32 description: Number of contacts the entire team owns, with the status readOnly: true example: 3 action_stream_count: type: integer format: int32 description: Number of contacts the (logged API) user has actions with, who also have the status readOnly: true example: 2 team_counts: type: array description: Number of contacts, with the status (for each team member) readOnly: true items: properties: user_id: $ref: '#/components/schemas/User/properties/id' counts: type: integer format: int32 description: Number of contacts the team member owns, with the status readOnly: true example: 4 Lead_source: description: >- A way to classify the source of any contact that is added to OnePageCRM. Like Statuses, this list is pre-populated, and can be later edited to fit individual needs. required: - text properties: id: type: string description: ID of the lead source readOnly: true example: advertisement text: type: string description: Description of the lead source maxLength: 40 example: Advertisement counts: type: integer format: int32 description: Number of contacts the (logged API) user owns, with the lead source readOnly: true example: 4 total_count: type: integer format: int32 description: Number of contacts the entire team owns, with the lead source readOnly: true example: 7 action_stream_count: type: integer format: int32 description: Number of contacts the (logged API) user has actions with, who also have the lead source readOnly: true example: 2 team_counts: type: array description: Number of contacts, with the lead source (for each team member) readOnly: true items: properties: user_id: $ref: '#/components/schemas/User/properties/id' counts: type: integer format: int32 description: Number of contacts the team member owns, with the lead source readOnly: true example: 4 Filter: description: >- Allow you to query contacts in your own custom way. These filters can only be created on the website but they can be used through the API. properties: id: type: string format: bson-id description: ID of the custom filter readOnly: true example: 5b606e239007ba1e528d9557 name: type: string description: Name of the custom filter readOnly: true example: Jane's large deals conditions: type: array description: Conditions of the custom filter readOnly: true items: type: array items: type: string example: - - deal_owner_id - is - 5aba31e99007ba0f570c12f7 - - deal_value - greater - '1000' Tag: description: >- An additional means of labeling and/or identifying contacts in OnePageCRM. properties: name: type: string description: Name of the tag example: VIP counts: type: integer format: int32 description: Number of contacts the (logged API) user owns, with the tag readOnly: true example: 2 total_count: type: integer format: int32 description: Number of contacts the entire team owns, with the tag readOnly: true example: 4 action_stream_count: type: integer format: int32 description: Number of contacts the (logged API) user has actions with, who also have the tag readOnly: true example: 1 Predefined_action: description: >- Template actions users may use frequently in their sales process. Referred to as 'Saved Actions' in the web application. required: - text - days properties: id: type: string format: bson-id description: ID of the predefined action readOnly: true example: 5acddaa7d556733c507ff405 text: type: string description: Description text of the predefined action example: '#1 Email [firstname] introducing our organization' days: type: integer format: int32 description: Suggested number of days until the action becomes due example: 4 Predefined_action_group: description: >- A grouping of predefined actions. Useful if actions can be assigned together as part of a workflow. properties: id: type: string format: bson-id description: ID of the predefined action group readOnly: true example: 5c79510e9007ba3f7519e820 text: type: string description: Name of the predefined action group example: Follow-up sequence position: type: integer format: int32 description: Position of the group in the list of predefined action groups readOnly: true example: 0 action_ids: type: array description: List of IDs of the predefined actions in the predefined action group items: type: string format: bson-id example: - 5acddaa7d556733c507ff405 - 5acddaa7d556733c507ff406 Predefined_item: description: >- A user-configured item which can aid in the creation of deal items properties: id: type: string format: bson-id description: ID of the predefined item readOnly: true example: 5c79510e9007ba3f7519e819 name: type: string description: Name of the predefined item example: Solar panels description: type: string description: Description text of the predefined item example: Photovoltaic solar panels (2019 model) cost: type: number format: float description: Cost of the predefined item example: 95.00 price: type: number format: float description: Price of the predefined item example: 149.99 position: type: integer format: int32 description: Position of the predefined item in the items list readOnly: true example: 1 item_group_id: type: string format: bson-id description: ID of the predefined item group (or empty if the item is not in a group) readOnly: true example: 5c9a53599007ba58f13c8119 Deal_item: description: >- A user-configured item representing a product or service, which can be used to standardize deal creation required: - name - description - cost - price - qty properties: id: type: string format: bson-id readOnly: true description: ID of the deal item example: 5c7973019007ba3f7519e86a name: type: string description: Name of the deal item example: Solar panels description: type: string description: Description text of the deal item example: Photovoltaic solar panels (2019 model) cost: type: number format: float description: Cost of the deal item example: 95.00 price: type: number format: float description: Price of the deal item example: 149.99 amount: type: number format: float readOnly: true description: Amount of the deal items example: 299.98 qty: type: integer format: int32 description: Quantity of deal items example: 2 deal_id: type: string format: bson-id readOnly: true description: ID of the parent deal example: 5aaa9b059007ba08c9ebaf58 predefined_item_id: type: string format: bson-id description: ID of the predefined item used for deal item creation (can be empty) example: 5c6abf565481dd28ff1bc6a8 position: type: integer format: int32 readOnly: true description: Position of the predefined item in the items list example: 1 created_at: type: string format: date-time readOnly: true description: Creation time of the deal item example: '2019-03-01T17:59:29Z' modified_at: type: string format: date-time readOnly: true description: Last modification time of the deal item example: '2019-03-01T17:59:29Z' Predefined_item_group: description: >- A grouping of predefined/deal items. Useful if items can be sold as part of a package or compliment one another properties: id: type: string format: bson-id description: ID of the predefined item group readOnly: true example: 5c79510e9007ba3f7519e819 name: type: string description: Name of the predefined item group example: Electronics position: type: integer format: int32 description: Position of the group in the list of predefined item groups readOnly: true example: 1 count: type: integer format: int32 description: Number of predefined items in the predefined item group readOnly: true example: 2 item_ids: type: array description: List of IDs of the predefined/deal items in the predefined item group readOnly: true items: type: string format: bson-id example: - 5c79510e9007ba3f7519e819 - 5c9a53349007ba58f13c8118 Custom_field: description: Extra user-configurable data fields for Contacts. Only editable by admins. required: - name - type properties: id: type: string format: bson-id description: ID of the custom field readOnly: true example: 5aad9b039007ba18c9ebad13 name: type: string description: Name of the custom field maxLength: 60 example: Favorite season type: type: string description: >- Type of the custom field. There are several types of custom fields that may store data in different formats. External ID type is a special type introduced for referencing entities in the external systems. Its value is unique amid the whole system. Section divider type is introduced just for visual purpose: it allows grouping custom fields. If custom fields in the section don't have values then they are hidden in the 'view' UI (but always shown in 'edit' UI). This logic is applied in the API: if a contact doesn't have values for all the custom fields in the section then this section divider custom field isn't exposed in the API (along with other custom fields inside the section). enum: - anniversary - date - multi_line_text - multiple_choice - number - select_box - single_line_text - external_id - section_divider example: select_box position: type: integer format: int32 description: The position of the custom field in the list example: 2 choices: description: >- A list of possible choices (for fields of type `multiple_choice` or `select_box`) type: array items: type: string maxItems: 60 example: - Spring - Summer - Autumn - Winter Company_field: description: Extra user-configurable data fields for Companies. Only editable by admins. required: - name - type properties: id: type: string format: bson-id description: ID of the company field readOnly: true example: 5aad9b039007ba28c9ebad56 name: type: string description: Name of the company field maxLength: 60 example: Company size type: type: string description: >- Type of the company field. There are several types of custom fields that may store data in different formats. External ID type is a special type introduced for referencing entities in the external systems. Its value is unique amid the whole system. Section divider type is introduced just for visual purpose: it allows grouping custom fields. If custom fields in the section don't have values then they are hidden in the 'view' UI (but always shown in 'edit' UI). This logic is applied in the API: if a company doesn't have values for all the custom fields in the section then this section divider custom field isn't exposed in the API (along with other custom fields inside the section). enum: - date - multi_line_text - multiple_choice - number - select_box - single_line_text - external_id - section_divider example: select_box position: type: integer format: int32 description: The position of the company field in the list example: 2 choices: description: >- A list of possible choices (for fields of type `multiple_choice` or `select_box`) type: array items: type: string maxItems: 60 example: - Small - Medium - Large Deal_field: description: Extra user-configurable data fields for Deals. Only editable by admins. required: - name - type properties: id: type: string format: bson-id description: ID of the deal field readOnly: true example: 5aad9b039007ba28c9ebad56 name: type: string description: Name of the deal field maxLength: 60 example: Deal size type: description: >- Type of the deal field. There are several types of custom fields that may store data in different formats. External ID type is a special type introduced for referencing entities in the external systems. Its value is unique amid the whole system. Section divider type is introduced just for visual purpose: it allows grouping custom fields. If custom fields in the section don't have values then they are hidden in the 'view' UI (but always shown in 'edit' UI). This logic is applied in the API: if a deal doesn't have values for all the custom fields in the section then this section divider custom field isn't exposed in the API (along with other custom fields inside the section). type: string enum: - date - multi_line_text - multiple_choice - number - select_box - single_line_text - external_id - section_divider example: select_box position: type: integer format: int32 description: The position of the deal field in the list example: 2 choices: description: >- A list of possible choices (for fields of type `multiple_choice` or `select_box`) type: array items: type: string maxItems: 60 example: - Small - Medium - Large Cost_setup: description: Settings related to deals e.g. cost, commission. Disabled by default. required: - commission_base properties: cost_enabled: type: boolean description: Is the cost field enabled for deals? example: true readOnly: true cost_required: type: boolean description: Is the cost field required when saving a deal? deprecated: true example: false readOnly: true commission_base: type: string description: The base by which commission is to be calculated for deals enum: - amount - margin example: amount commission_percentage: type: number format: float description: The default percentage by which the commission is to be calculated for deals (in the range 0.0 < commission_percentage < 100.0) example: 12.5 default: 10.0 Deal_stage: description: The various stages that a deal goes through in the sales pipeline. properties: stage: type: integer format: int32 description: >- Integer in the range 0 to 100 (exclusive) indicating how close a deal is to being closed readOnly: true example: 80 label: type: string description: Text description for the deal stage of the deal readOnly: true example: Negotiation Contacts_count: description: >- Counters showing the number of contacts per letter. The `all` object represents the entire account, while the `users` array contains the same breakdown but per user. properties: all: description: Counters for the entire account type: array items: properties: '1': type: integer format: int32 description: Contacts who's name begins with a non-alphabetic character readOnly: true example: 1 a: type: integer format: int32 description: Contacts who's name begins with A readOnly: true example: 2 b: type: integer format: int32 description: Contacts who's name begins with B readOnly: true example: 2 c: type: integer format: int32 description: Contacts who's name begins with C readOnly: true example: 1 d: type: integer format: int32 description: Contacts who's name begins with D readOnly: true example: 1 e: type: integer format: int32 description: Contacts who's name begins with E readOnly: true example: 0 f: type: integer format: int32 description: Contacts who's name begins with F readOnly: true example: 0 g: type: integer format: int32 description: Contacts who's name begins with G readOnly: true example: 3 h: type: integer format: int32 description: Contacts who's name begins with H readOnly: true example: 0 i: type: integer format: int32 description: Contacts who's name begins with I readOnly: true example: 3 j: type: integer format: int32 description: Contacts who's name begins with J readOnly: true example: 0 k: type: integer format: int32 description: Contacts who's name begins with K readOnly: true example: 0 l: type: integer format: int32 description: Contacts who's name begins with L readOnly: true example: 2 m: type: integer format: int32 description: Contacts who's name begins with M readOnly: true example: 2 n: type: integer format: int32 description: Contacts who's name begins with N readOnly: true example: 3 o: type: integer format: int32 description: Contacts who's name begins with O readOnly: true example: 0 p: type: integer format: int32 description: Contacts who's name begins with P readOnly: true example: 2 q: type: integer format: int32 description: Contacts who's name begins with Q readOnly: true example: 0 r: type: integer format: int32 description: Contacts who's name begins with R readOnly: true example: 0 s: type: integer format: int32 description: Contacts who's name begins with S readOnly: true example: 0 t: type: integer format: int32 description: Contacts who's name begins with T readOnly: true example: 1 u: type: integer format: int32 description: Contacts who's name begins with U readOnly: true example: 1 v: type: integer format: int32 description: Contacts who's name begins with V readOnly: true example: 1 w: type: integer format: int32 description: Contacts who's name begins with W readOnly: true example: 0 x: type: integer format: int32 description: Contacts who's name begins with X readOnly: true example: 1 y: type: integer format: int32 description: Contacts who's name begins with Y readOnly: true example: 1 z: type: integer format: int32 description: Contacts who's name begins with Z readOnly: true example: 0 total_count: type: integer format: int32 readOnly: true example: 27 users: description: Counters per user type: array items: properties: '1': type: integer format: int32 description: Contacts who's name begins with a non-alphabetic character readOnly: true example: 1 a: type: integer format: int32 description: Contacts who's name begins with A readOnly: true example: 2 b: type: integer format: int32 description: Contacts who's name begins with B readOnly: true example: 2 c: type: integer format: int32 description: Contacts who's name begins with C readOnly: true example: 1 d: type: integer format: int32 description: Contacts who's name begins with D readOnly: true example: 1 e: type: integer format: int32 description: Contacts who's name begins with E readOnly: true example: 0 f: type: integer format: int32 description: Contacts who's name begins with F readOnly: true example: 0 g: type: integer format: int32 description: Contacts who's name begins with G readOnly: true example: 3 h: type: integer format: int32 description: Contacts who's name begins with H readOnly: true example: 0 i: type: integer format: int32 description: Contacts who's name begins with I readOnly: true example: 3 j: type: integer format: int32 description: Contacts who's name begins with J readOnly: true example: 0 k: type: integer format: int32 description: Contacts who's name begins with K readOnly: true example: 0 l: type: integer format: int32 description: Contacts who's name begins with L readOnly: true example: 2 m: type: integer format: int32 description: Contacts who's name begins with M readOnly: true example: 2 n: type: integer format: int32 description: Contacts who's name begins with N readOnly: true example: 3 o: type: integer format: int32 description: Contacts who's name begins with O readOnly: true example: 0 p: type: integer format: int32 description: Contacts who's name begins with P readOnly: true example: 2 q: type: integer format: int32 description: Contacts who's name begins with Q readOnly: true example: 0 r: type: integer format: int32 description: Contacts who's name begins with R readOnly: true example: 0 s: type: integer format: int32 description: Contacts who's name begins with S readOnly: true example: 0 t: type: integer format: int32 description: Contacts who's name begins with T readOnly: true example: 1 u: type: integer format: int32 description: Contacts who's name begins with U readOnly: true example: 1 v: type: integer format: int32 description: Contacts who's name begins with V readOnly: true example: 1 w: type: integer format: int32 description: Contacts who's name begins with W readOnly: true example: 0 x: type: integer format: int32 description: Contacts who's name begins with X readOnly: true example: 1 y: type: integer format: int32 description: Contacts who's name begins with Y readOnly: true example: 1 z: type: integer format: int32 description: Contacts who's name begins with Z readOnly: true example: 0 total_count: type: integer format: int32 readOnly: true example: 27 user_id: $ref: '#/components/schemas/User/properties/id' Team_stream: description: >- Counters showing the number of entries in the action stream. The `all` object represents the entire account, while the `users` array contains the same breakdown but per user. properties: all: type: integer format: int32 description: Counters for the entire account (`team_stream`/`action_stream?team=true`) readOnly: true example: 10 users: type: array description: Counters broken down per user (`team_stream?user_id={ID}`) readOnly: true items: properties: user_id: $ref: '#/components/schemas/User/properties/id' counts: type: integer format: int32 description: The number of entries in the action steam for the user readOnly: true example: 5 Webhook: description: >- A simple, effective way to be notified when things happen in OnePageCRM. For more information, go to the 'WebHooks & More' tab at the top of the page. properties: id: type: string format: bson-id description: ID of the webhook readOnly: true example: 5417f8291da41712270a0042 name: type: string description: Name of the webhook maxLength: 140 example: Awesome integration hook_url: type: string description: URL of the webhook example: https://{webhook.catching.machine} secretkey: type: string description: Secret key of the webhook example: '' Pipeline: description: >- Information about the sales process of products or services, including deal stages. properties: id: type: string format: bson-id description: ID of the pipeline readOnly: true example: 5c96306b849d78b896b6f8ca name: type: string description: Name of the pipeline example: Default pipeine type: type: string description: Type of the pipeline (sales or delivery) example: sales default: type: boolean description: Is this pipeline the default pipeline in the account? example: true won_column_enabled: type: boolean description: Specifies if the `WON` column is enabled for the pipeline example: false won_column_name: type: string description: Name of the `WON` column for the pipeline example: Payment stages: type: array description: Deal stages defined for the pipeline items: $ref: '#/components/schemas/Deal_stage' Reminder: description: Details about the sales action reminder email. properties: type: type: string description: The criteria which should cause a sales reminder email to be sent enum: - never - every_day - new_task example: new_task hour: type: integer format: int32 description: The time the sales reminder time is to be sent (assuming the criteria is met) example: 6 Success: description: Structure of response for successful request. properties: status: type: integer format: int32 description: Response code readOnly: true example: 0 message: type: string description: Response message readOnly: true example: OK timestamp: type: integer format: unix-timestamp description: Response time readOnly: true example: 1528373119 data: description: "The response payload. Keys depend on the endpoint; list responses include pagination fields alongside the records." type: object properties: total_count: $ref: '#/components/schemas/Page_data/properties/total_count' page: $ref: '#/components/schemas/Page_data/properties/page' per_page: $ref: '#/components/schemas/Page_data/properties/per_page' max_page: $ref: '#/components/schemas/Page_data/properties/max_page' Page_data: description: Pagination meta-data related to response. properties: total_count: type: integer format: int32 description: Total number of items readOnly: true example: 1 page: type: integer format: int32 description: Current page number readOnly: true example: 1 per_page: type: integer format: int32 description: Number of items returned in each page readOnly: true example: 10 max_page: type: integer format: int32 description: The page number of the last page of items readOnly: true example: 1 parameters: path_user_id: name: user_id in: path required: true description: User ID schema: type: string minimum: 1 path_lead_source_id: name: lead_source_id in: path required: true description: Lead Source ID schema: type: string minimum: 1 path_status_id: name: status_id in: path required: true description: Status ID schema: type: string minimum: 1 path_deal_field_id: name: deal_field_id in: path required: true description: Deal Field ID schema: type: string minimum: 1 path_custom_field_id: name: custom_field_id in: path required: true description: Custom Field ID schema: type: string minimum: 1 path_company_field_id: name: company_field_id in: path required: true description: Company Field ID schema: type: string minimum: 1 path_predefined_action_id: name: predefined_action_id in: path required: true description: Predefined Action ID schema: type: string minimum: 1 path_predefined_action_group_id: name: predefined_action_group_id in: path required: true description: Predefined Action Group ID schema: type: string minimum: 1 path_predefined_item_id: name: predefined_item_id in: path required: true description: Predefined Item ID schema: type: string minimum: 1 path_predefined_item_group_id: name: predefined_item_group_id in: path required: true description: Predefined Item Group ID schema: type: string minimum: 1 path_note_id: name: note_id in: path required: true description: Note ID schema: type: string minimum: 1 path_deal_id: name: deal_id in: path required: true description: Deal ID schema: type: string minimum: 1 path_call_id: name: call_id in: path required: true description: Call ID schema: type: string minimum: 1 path_meeting_id: name: meeting_id in: path required: true description: Meeting ID schema: type: string minimum: 1 path_attachment_id: name: attachment_id in: path required: true description: Attachment ID schema: type: string minimum: 1 path_action_id: name: action_id in: path required: true description: Action ID schema: type: string minimum: 1 path_relationship_type_id: name: relationship_type_id in: path required: true description: Relationship type ID schema: type: string minimum: 1 path_relationship_id: name: relationship_id in: path required: true description: Relationship ID schema: type: string minimum: 1 path_company_id: name: company_id in: path required: true description: Company ID schema: type: string minimum: 1 path_contact_id: name: contact_id in: path required: true description: Contact ID schema: type: string minimum: 1 path_tag_name: name: tag_name in: path required: true description: Tag name schema: type: string minimum: 1 path_owner_id: name: owner_id in: path required: true description: Owner ID schema: type: string minimum: 1 path_webhook_id: name: webhook_id in: path required: true description: Webhook ID schema: type: string minimum: 1 path_pipeline_id: name: pipeline_id in: path required: true description: Pipeline ID schema: type: string minimum: 1 path_filter_id: name: filter_id in: path required: true description: Filter ID schema: type: string minimum: 1 path_notification_id: name: notification_id in: path required: true description: Notification ID schema: type: string minimum: 1 query_companies_name: name: name in: query required: false description: Search companies by name schema: type: string example: Big Company Inc query_deals_name: name: name in: query required: false description: Search deals by name schema: type: string example: Solar panels query_contacts_phone: name: phone in: query required: false description: Search contacts by phone number schema: type: string example: '3736344458' query_companies_phone: name: phone in: query required: false description: Search companies by phone number schema: type: string example: '3736344458' query_contacts_letter: name: letter in: query required: false description: >- Return contacts whose last name begins with specified letter (or company name, if last name not present) schema: type: string example: a query_companies_letter: name: letter in: query required: false description: >- Return company whose name begins with specified letter schema: type: string example: a query_assignee_id: name: assignee_id in: query required: false description: Return actions assigned to a specific user schema: type: string example: 5aba36b19007ba0f570c9523 query_done: name: done in: query required: false description: Should only return completed actions (i.e. have status `done`)? schema: type: boolean example: false query_actions_status: name: status in: query required: false description: >- Return actions of a particular status (i.e. `asap`, `date`, `date_time`, `waiting`, `queued`, `queued_with_date`, or `done`) schema: type: string example: date_time query_deals_status: name: status in: query required: false description: >- Return deals of a particular status (i.e. `pending`, `won`, `lost`, or `closed`) schema: type: string example: pending query_stage: name: stage in: query required: false description: Return deals (of status `pending`) with specified deal stage schema: type: integer example: 60 query_user_id: name: user_id in: query required: false description: >- Get the action stream of another user (leave blank for entire account in a single list) schema: type: string example: 5aaa9b009007ba08c9ebaef7 query_contacts_search: name: search in: query required: false description: Search contacts by contact name, company name or phone number schema: type: string example: Jane Doe query_deals_search: name: search in: query required: false description: Search deals by deal name, contact name or company name schema: type: string example: Solar panels query_relationship_types_search: name: search in: query required: false description: Search relationship types by relationship variants schema: type: string example: Partner query_relationships_search: name: search in: query required: false description: Search relationships by contact name or relationship-variant name schema: type: string example: Jack Aranda query_contacts_owner_id: name: owner_id in: query required: false description: Return contacts owned by a specific user schema: type: string example: 5aba36b19007ba0f570c9523 query_deals_owner_id: name: owner_id in: query required: false description: >- Return deals owned by a specific user schema: type: string example: 5aba36b19007ba0f570c9523 query_contacts_tag: name: tag in: query required: false description: >- Filter contacts by tag (only use one of `company_id`, `tag` or `filter_id` at a time) schema: type: string example: VIP query_deals_tag: name: tag in: query required: false description: >- Filter deals by tag (only use one of `contact_id`, `company_id`, `tag` or `filter_id` at a time) schema: type: string example: VIP query_contacts_filter_id: name: filter_id in: query required: false description: >- Apply filter to contact listing (only use one of `company_id`, `tag` or `filter_id` at a time) schema: type: string example: 5ae9cc2a9007ba5b856c7bb8 query_contacts_fields: name: fields in: query required: false description: | Include related resources alongside each contact in the response. Syntax: `fields=(all)`. Use a comma-separated list to request multiple resources. Each requested resource is returned as an array of full objects nested under the matching key inside the contact entry (e.g. `fields=calls(all)` adds a `calls` array next to `contact` for each item in the `contacts` array). Supported resources: `deals`, `notes`, `calls`, `meetings`, `pinned_attachments`. Examples: `fields=calls(all)` `fields=calls(all),notes(all)` `fields=deals(all),notes(all),calls(all),meetings(all),pinned_attachments(all)` schema: type: string example: calls(all),notes(all) query_deals_filter_id: name: filter_id in: query required: false description: >- Apply filter to deal listing (only use one of `contact_id`, `company_id`, `tag` or `filter_id` at a time) schema: type: string example: 5ae9cc2a9007ba5b856c7bb8 query_deals_fields: name: fields in: query required: false description: | Include related resources alongside each deal in the response. Syntax: `fields=(all)`. Use a comma-separated list to request multiple resources. Supported resources: `contacts`. When `fields=contacts(all)` is supplied, each deal entry includes a `contacts` array of full `Contact` objects (the primary contact plus any linked contacts). The short-form `linked_contacts` array on each deal is always returned regardless of this parameter. Example: `fields=contacts(all)` schema: type: string example: contacts(all) query_actions_date_filter: name: date_filter in: query required: false description: >- Signals which date field to be used for only returning resources, added or edited, in a specified date range (only to be used with `since` and/or `until`, not with `modified_since` or `unmodified_since`) schema: type: string enum: - created_at - modified_at - updated_at - date - close_date query_deals_date_filter: name: date_filter in: query required: false description: >- Signals which date field to be used for only returning resources, added or edited, in a specified date range (only to be used with `since` and/or `until`, not with `modified_since` or `unmodified_since`) schema: type: string enum: - created_at - modified_at - updated_at - date - close_date - expected_close_date query_notes_date_filter: name: date_filter in: query required: false description: >- Signals which date field to be used for only returning resources, added or edited, in a specified date range (only to be used with `since` and/or `until`, not with `modified_since` or `unmodified_since`) schema: type: string enum: - created_at - modified_at - updated_at - date query_calls_date_filter: name: date_filter in: query required: false description: >- Signals which date field to be used for only returning resources, added or edited, in a specified date range (only to be used with `since` and/or `until`, not with `modified_since` or `unmodified_since`) schema: type: string enum: - created_at - modified_at - updated_at - call_time query_meetings_date_filter: name: date_filter in: query required: false description: >- Signals which date field to be used for only returning resources, added or edited, in a specified date range (only to be used with `since` and/or `until`, not with `modified_since` or `unmodified_since`) schema: type: string enum: - created_at - modified_at - updated_at - meeting_time query_date_filter: name: date_filter in: query required: false description: >- Signals which date field to be used for only returning resources, added or edited, in a specified date range (only to be used with `since` and/or `until`, not with `modified_since` or `unmodified_since`) schema: type: string enum: - created_at - modified_at - updated_at query_since: name: since in: query required: false description: >- Specifies the start of the date range to filter resources, which have been added or edited (use with `date_filter` - date must be in format `YYYY-MM-DD` or UNIX timestamp) schema: type: string example: '2018-07-01' query_until: in: query name: until description: >- Specifies the end of the date range to filter resources, which have been added or edited (use with `date_filter` - date must be in format `YYYY-MM-DD` or UNIX timestamp) schema: type: string example: '2018-07-31' query_modified_since: in: query name: modified_since description: >- Return only resources that were modified since specified time (cannot be used with `date_filter` - date must be in format `YYYY-MM-DD` or UNIX timestamp) schema: type: string example: '2018-07-01' query_unmodified_since: in: query name: unmodified_since description: >- Return only resources that were unmodified since specified time (cannot be used with `date_filter` - date must be in format `YYYY-MM-DD` or UNIX timestamp) schema: type: string example: '2018-07-01' query_actions_contact_id: name: contact_id in: query description: >- Return actions for a specific contact (only use one of `contact_id` or `company_id` at a time) required: false schema: type: string example: 5ae06ef9d55673108fe8877b query_deals_contact_id: name: contact_id in: query description: >- Return deals for a specific contact (only use one of `contact_id`, `company_id`, `tag` or `filter_id` at a time) required: false schema: type: string example: 5ae06ef9d55673108fe8877b query_notes_contact_id: name: contact_id in: query description: >- Return notes for a specific contact (only use one of `contact_id` or `company_id` at a time) required: false schema: type: string example: 5ae06ef9d55673108fe8877b query_calls_contact_id: name: contact_id in: query description: >- Return calls for a specific contact (only use one of `contact_id` or `company_id` at a time) required: false schema: type: string example: 5ae06ef9d55673108fe8877b query_meetings_contact_id: name: contact_id in: query description: >- Return meetings for a specific contact (only use one of `contact_id` or `company_id` at a time) required: false schema: type: string example: 5ae06ef9d55673108fe8877b query_contacts_company_id: name: company_id in: query description: >- Return contacts from a specific company (only use one of `company_id`, `tag` or `filter_id` at a time) required: false schema: type: string example: 6se06df9d55673108re84745 query_deals_company_id: name: company_id in: query description: >- Return deals for a specific company (only use one of `contact_id`, `company_id`, `tag` or `filter_id` at a time) required: false schema: type: string example: 6se06df9d55673108re84745 query_actions_company_id: name: company_id in: query description: >- Return actions for a specific company (only use one of `contact_id` or `company_id` at a time) required: false schema: type: string example: 6se06df9d55673108re84745 query_notes_company_id: name: company_id in: query description: >- Return notes for a specific company (only use one of `contact_id` or `company_id` at a time) required: false schema: type: string example: 6se06df9d55673108re84745 query_calls_company_id: name: company_id in: query description: >- Return calls for a specific company (only use one of `contact_id` or `company_id` at a time) required: false schema: type: string example: 6se06df9d55673108re84745 query_meetings_company_id: name: company_id in: query description: >- Return meetings for a specific company (only use one of `contact_id` or `company_id` at a time) required: false schema: type: string example: 6se06df9d55673108re84745 query_action_stream: name: action_stream in: query description: Only return results that are also in action stream required: false schema: type: boolean example: true query_email: name: email in: query description: >- Return contacts whose email matches that provided with this query param required: false schema: type: string example: abc@example.com query_has_actions: name: has_actions in: query description: >- Only return contacts who are owned by the logged user, and have actions for any user (can not query by `has_actions` and `has_actions_for_me` at the same time) required: false schema: type: boolean example: true query_has_actions_for_me: name: has_actions_for_me in: query description: >- Only return contacts who are owned by, and have actions for, the logged user (can not query by `has_actions` and `has_actions_for_me` at the same time) required: false schema: type: boolean example: true query_has_actions_today: name: has_actions_today in: query description: >- Only return contacts who are owned by, and have actions today for, the logged user required: false schema: type: boolean example: true query_lead_source: name: lead_source in: query description: >- Return contacts of a specific lead source (only use one of `lead_source` and `lead_source_id` at a time) required: false schema: type: string example: '' query_lead_source_id: name: lead_source_id in: query description: >- Return contacts of a specific lead source (only use one of `lead_source` and `lead_source_id` at a time) required: false schema: type: string example: 5aec63769007ba365a4e9ba0 query_pending_deal: name: pending_deal in: query description: >- Only return contacts who have a pending deal required: false schema: type: boolean example: true query_starred: name: starred in: query description: >- Only return contacts who are starred required: false schema: type: boolean example: false query_status_id: name: status_id in: query description: Return contacts of a particular status required: false schema: type: string example: 5aaa9b039007ba08c9ebaf0b query_team: name: team in: query description: Include contacts owned by other users required: false schema: type: boolean example: true query_url: name: url in: query description: Search contacts by web address required: false schema: type: string example: https://example.com query_waiting: name: waiting in: query description: Only return contacts, for whom I have a next action, of status `waiting` required: false schema: type: boolean example: false query_not_linked_with: name: not_linked_with in: query description: >- Only return contacts who are not linked to a particular company (company's id expected here - cannot be used in conjunction with `company_id` param) required: false schema: type: string example: 5aba31e99007ba0f570c92ac query_custom_field_id: name: custom_field_id in: query description: Filter contacts by custom field value (combine with `custom_field_value`) required: false schema: type: string example: 5afaf6299007ba5c417f0d72 query_custom_field_value: name: custom_field_value in: query description: Filter contacts by custom field value (combine with `custom_field_id`) required: false schema: type: string query_order: in: query name: order description: >- Specify the order (ascending or descending) of the sort of the results (use in conjunction with `sort_by`) schema: type: string enum: - asc - desc query_sort_by: name: sort_by in: query description: >- Specify field by which to order the results (use in conjunction with `order`) schema: type: string enum: - created_at - modified_at query_contacts_sort_by: name: sort_by in: query description: >- Specify field by which to order the results (use in conjunction with `order`) schema: type: string enum: - created_at - modified_at - first_name - last_name - company_name - name query_companies_sort_by: name: sort_by in: query description: >- Specify field by which to order the results (use in conjunction with `order`) schema: type: string enum: - created_at - modified_at - name query_deals_sort_by: name: sort_by in: query description: >- Specify field by which to order the results (use in conjunction with `order`) schema: type: string enum: - created_at - modified_at - date - close_date - expected_close_date query_notes_sort_by: name: sort_by in: query description: >- Specify field by which to order the results (use in conjunction with `order`) schema: type: string enum: - created_at - modified_at - updated_at - date query_calls_sort_by: name: sort_by in: query description: >- Specify field by which to order the results (use in conjunction with `order`) schema: type: string enum: - created_at - modified_at - updated_at query_meetings_sort_by: name: sort_by in: query description: >- Specify field by which to order the results (use in conjunction with `order`) schema: type: string enum: - created_at - modified_at - updated_at query_custom_fields_sort_by: name: sort_by in: query description: >- Specify field by which to order the results (use in conjunction with `order`) schema: type: string enum: - created_at - modified_at - updated_at - position query_per_page: name: per_page in: query description: Number of records to return. Maximum 100 allowed. Default is 10. required: false schema: type: integer default: 10 example: 10 query_page: name: page in: query required: false description: Page number. Starts from 1. Default is 1. schema: type: integer default: 1 example: 1 query_contacts_delete_ids: name: ids in: query required: true description: Comma separated list of contact IDs, to be deleted schema: type: string minimum: 1 query_pipeline_id: name: pipeline_id in: query required: false description: Return deals from the specified pipeline only schema: type: string example: 5cfa87a4849d7873db082f98 query_sales_pipeline_id: name: sales_pipeline_id in: query required: false description: Return deals referencing a specified sales pipeline only schema: type: string example: 5cfa87a4849d7873db082f98 query_include_history: name: include_history in: query required: false description: | Returns deal stages history, i.e. the most recent stages for each pipeline for the deal This field is returned only when 'include_history=true' param is supplied in request (query string or request body) Format: pipeline_id => stage schema: type: boolean example: true query_relationship_symmetrical: name: symmetrical in: query required: false description: Filter only symmetrical/non-symmetrical relationship types schema: type: boolean example: false query_relationships_type_id: name: relationship_type_id in: query required: false description: >- Return relationships of a specific type schema: type: string example: 5aaa9b059007ba08c9ebaf58 query_relationships_contact_id_filter: name: contact_id_filter in: query required: false description: >- Return relationships in which the provided contact participate schema: type: string example: 5aaa9b059007ba08c9ebaf58 query_relationships_variant_id_filter: name: variant_id_filter in: query required: false description: >- Return relationships in which the provided variant participate schema: type: string example: 5aaa9b059007ba08c9ebaf58 responses: '200': description: OK '400': description: >- Bad Request. The request is malformed — missing or invalid parameters, or a body that does not match the expected format. Fix the request before retrying. The example below shows the error envelope used for all responses in the 4XX range. content: application/json: schema: properties: status: type: integer format: int32 description: HTTP status code of the response readOnly: true example: 400 message: type: string description: Summary of the reason for the failure readOnly: true example: Some generic error message error_name: type: string description: Key used to identify which error has occurred readOnly: true example: some_generic_error_message error_message: type: string description: Message to be shown to the user with more details about the error readOnly: true example: Could not find suitable error message, initiating self-destruct sequence... errors: description: Specific errors (commonly associated with invalid parameters) readOnly: true properties: attribute_name: type: string description: Reason why this parameter is invalid readOnly: true example: '{attribute_name} is invalid or missing' '401': description: >- Unauthorized. Authentication is missing, invalid or expired. Check the user_id and api_key pair. content: application/json: schema: properties: status: type: integer format: int32 description: HTTP status code of the response readOnly: true example: 401 message: type: string description: Summary of the reason for the failure readOnly: true example: Authorization data not found error_name: type: string description: Key used to identify which error has occurred readOnly: true example: authorization_data_not_found error_message: type: string description: Message to be shown to the user with more details about the error readOnly: true example: Cannot find suitable authorization data or data provided is not complete. errors: type: object readOnly: true '403': description: >- Forbidden. The authenticated user does not have permission for this operation, or an account limit has been reached. Note the request-rate throttle also answers 403 with a plain-text body — check the content type before treating a 403 as a permission error. '404': description: Not Found. No resource exists for the ID you provided. '409': description: >- Conflict. The current state of the record does not allow this operation — for example, adding an ASAP action to a contact that already has one for that user. '415': description: >- The request entity has a media type which the server or resource does not support. For example, the client uploads an image as image/svg+xml, but the server requires that images use a different format. '422': description: The request was well-formed (i.e., syntactically correct) but could not be processed. '500': description: >- Internal Server Error. Something went wrong on our side. Retry later, and contact support if it persists. securitySchemes: BasicAuth: type: http scheme: basic