openapi: 3.0.0 info: version: 1.0.0 title: 'Encharge API' description: 'The Encharge.io API' license: name: MIT contact: url: 'https://help.encharge.io' name: unknown tags: - name: Authentication x-displayName: Authentication description: "\n" - name: enduser_model x-displayName: 'EndUser (Person) Model' description: "A EndUser (also called person) in your account in Encharge.\n\n" - name: person_fields_model x-displayName: 'Person Field Model' description: "Represents a field (i.e. property) of a person (EndUser).\n\n" - name: Webhooks x-displayName: Webhooks description: "Subscribe to events happening in Encharge.\nCurrently supported events are:\n- `newUser`\n - Triggers when an enduser (person) is created in Encharge.\n\n- `updatedUser`\n - Triggers when an enduser (person) is updated in Encharge.\n\n- `unsubscribedUser`\n - Triggers when an enduser (person) has unsubscribed from receiving emails in Encharge.\n\n- `added-tag-{tag}`\n - Triggers when an enduser (person) is tagged.\n\n For example, event named `added-tag-signed-up` will trigger when a person is tagged with a tag called \"signed-up\".\n\n- `removed-tag-{tag}`\n - Triggers when an enduser (person) is untagged.\n\n For example, event named `removed-tag-demo` will trigger when a person is removed with a tag called \"demo\". \n\n- `native-form-submitted-{formId}`\n - Triggers when an Encharge native form is submitted.\n\n For example, event named `native-form-submitted-123` will trigger when a native form with ID 123 is submitted.\n\n- `newObject-{objectType}`\n - Triggers when an custom object or a company is created.\n\n For example, event named `newObject-company` will trigger when a new company is created. \n \n- `updatedObject-{objectType}`\n - Triggers when an custom object or a company is updated.\n\n For example, event named `updatedObject-invoice` will trigger when an invoice is updated.\n\n- `deletedObject-{objectType}`\n - Triggers when an custom object or a company is deleted.\n\n For example, event named `deletedObject-company` will trigger when a company is deleted.\n\n- `newAssociation-{associationId}`\n - Triggers when a new association with a specific ID is created.\n\n For example, event named `newAssociation-123` will trigger when a new association of ID 123 is created between objects.\n\n \n__Webhook payload__\n\n`url` will be posted with the data of the person performing the event, as follows:\n```\n{\n // endUserData is an array of people who performed the event.\n // Only supplied for events related to a person, e.g. `newUser`, `updatedUser`, `unsubscribedUser`, `added-tag-{tag}`, `removed-tag-{tag}`, `native-form-submitted-{formId}`.\n \"endUserData\": [\n {\n ... // See the Person Field Model for available properties.\n }\n ],\n \"eventPayload\": {\n ... // Any other data about the event. E.g. the tag applied to the user.\n }\n}\n```\n" - name: Account - name: People - name: Tags components: parameters: PeopleQuery: in: query name: people required: true description: "People can be specified by any ID. \nFor example, for a person with an email `slav@encharge.io` use the following query: \n\n`?people[0][email]=slav@encharge.io`\n\nFor multiple people, pass multiple ids in the query like so:\n\n`?people[0][userId]=abc&people[1][userId]=xyz`. \n\nThis will specify people who have userId of `abc` and `xyz`.\n\nEmails, userIds and other IDs can used together in a single query.\n" schema: {$ref: '#/components/schemas/EndUserIdentifiers'} schemas: EndUser: type: object description: 'This is the exposed EndUser class that proxies the unproxied one.' properties: {id: {type: string}, email: {type: string}, userId: {type: string}, name: {type: string}, firstName: {type: string}, lastName: {type: string}} additionalProperties: {description: 'See [Person Fields](#tag/PersonFields) for other available properties.'} ABEmailTestVariantByEmail: properties: {emailId: {type: number, format: double}, type: {type: string, enum: [email], nullable: false}, variantId: {type: string}} required: [type] type: object ABEmailTestVariantByEmailDetails: properties: {preheader: {type: string}, fromName: {type: string}, fromEmail: {type: string}, subject: {type: string}, type: {type: string, enum: [emailDetails], nullable: false}, variantId: {type: string}} required: [type] type: object ABEmailTestVariant: anyOf: [{$ref: '#/components/schemas/ABEmailTestVariantByEmail'}, {$ref: '#/components/schemas/ABEmailTestVariantByEmailDetails'}] ABTestConfig: properties: {enabled: {type: boolean}, variants: {items: {$ref: '#/components/schemas/ABEmailTestVariant'}, type: array}, pickWinner: {type: boolean}, pickWinnerBy: {type: string, enum: [open, click]}, waitBeforeWinnerPeriod: {type: number, format: double}, waitBeforeWinnerPeriodType: {type: string, enum: [hours, days]}, winner: {$ref: '#/components/schemas/ABEmailTestVariant'}, distribution: {items: {type: number, format: double}, type: array}, winnerPickedAt: {type: string}} required: [enabled, variants, pickWinner] type: object additionalProperties: false MetricCachedData: properties: {delivered: {type: number, format: double}, click: {type: number, format: double}, open: {type: number, format: double}} required: [delivered, click, open] type: object additionalProperties: false CachedMetric: properties: {updatedAt: {type: string, format: date-time}, data: {$ref: '#/components/schemas/MetricCachedData'}, isStale: {type: boolean}} type: object additionalProperties: false Broadcast: properties: {id: {type: number, format: double, description: 'Broadcast Id.'}, name: {type: string, description: 'Broadcast name.'}, status: {type: string, enum: [draft, scheduled, sending, sent, ab-testing, ab-test-sending-winner, canceled, failed], description: 'Broadcast status'}, audience: {properties: {segmentId: {type: number, format: double}, type: {type: string, enum: [segment], nullable: false}}, required: [segmentId, type], type: object, description: 'Audience to send the broadcast to. Currently, the only supported audience is a segment.'}, emailId: {type: number, format: double, description: 'Id of the email associated with this broadcast.'}, time: {properties: {useContactsTimezones: {type: boolean}}, type: object, description: 'Whether to send the broadcast in the contacts'' timezones.'}, sendAt: {type: string, format: date-time, description: 'Date and Time to begin sending the broadcast. Accepted format: ISO 8601 datetime.'}, followUp: {properties: {newSubjectLine: {type: string}, emailId: {type: number, format: double}, time: {properties: {period: {type: number, format: double}}, required: [period], type: object}, audience: {type: string, enum: [not-opened, not-clicked]}}, required: [time, audience], type: object, description: 'Not implemented.'}, abTest: {$ref: '#/components/schemas/ABTestConfig', description: 'Config for the A/B Test associated with this broadcast.'}, createdAt: {type: string, description: 'Date the broadcast was created.'}, updatedAt: {type: string, description: 'Date the broadcast was last updated.'}, accountId: {type: number, format: double, description: 'Id of the account this broadcast belongs to.'}, createdBy: {type: number, format: double, description: 'Not implemented. User that created the broadcast'}, integrationId: {type: number, format: double, nullable: true, description: 'Internal. Id of the flow used to send this broadcast.'}, trackReplies: {type: boolean, description: "Track replies to this broadcast. When on, the send step substitutes the\nReply-To with an Encharge address, forwards replies to the original sender,\nand records reply email-events attributed to this broadcast. Default off."}, cachedMetric: {$ref: '#/components/schemas/CachedMetric'}, sentEmailVersionId: {type: number, format: double, description: "Internal. Id of the email_content_versions row captured when the broadcast started sending.\nRecords which email version recipients actually received, even if emails.data is mutated later."}, peopleEntered: {type: number, format: double, description: 'Internal. Number of people who entered this broadcast.'}, peopleExited: {type: number, format: double, description: 'Internal. Number of people who exited this broadcast.'}} required: [id, name, status, accountId, peopleEntered, peopleExited] type: object additionalProperties: false CustomObject: description: "This is the base unproxied enduser class.\nIt shouldn't be used without a proxy as defined below." ICustomObjectCreatable: properties: {externalId: {type: string}, id: {type: number, format: double}} additionalProperties: {} type: object Exclude_JSONSchema6TypeName.object-or-array-or-null_: type: string enum: [string, number, boolean, integer, any] description: 'Exclude from T those types that are assignable to U' PersonFieldFormat: type: string enum: [date, date-time] nullable: true description: 'Format of the field. Applies to String fields only. JSON schema compatible' FieldDisplayType: type: string enum: [text, textarea, date, datetime, number, select, multiselect, checkbox, radio, email, url, phone, integer, decimal, currency, currencyCents] IPersonField: description: 'Represents a field (i.e. property) of a person in Encharge.' properties: {name: {type: string, description: "Unique ID of the field.\n\nUse this \"name\" to refer to this field in any API operations."}, title: {type: string, description: 'Human readable name of the field.'}, type: {$ref: '#/components/schemas/Exclude_JSONSchema6TypeName.object-or-array-or-null_', description: 'Type of the field. JSON schema compatible'}, format: {$ref: '#/components/schemas/PersonFieldFormat', description: 'Format of the field. Applies to String fields only. JSON schema compatible'}, displayType: {$ref: '#/components/schemas/FieldDisplayType', description: "Reserved for future use.\nHow to display the field in the UI. If empty, the display will be deduced from the field type and format."}, readOnly: {type: boolean, description: 'Whether this field can be changed by the user or via the API.'}, tooltip: {type: string, description: 'More information about this field (to be shown in a tooltip)'}, icon: {type: string, description: 'Field icon, if set.'}, array: {type: boolean, description: 'Whether this field holds an array of values.'}, enum: {items: {type: string}, type: array, description: 'Possible values for this field'}, enumNames: {items: {type: string}, type: array, description: 'Labels for enum values. If be omitted, the enum values will be used as enum labels.'}, allowNewEnumValues: {type: boolean, description: 'If we allow other values than the ones in the "enum" property.'}, canMapFrom: {type: boolean, description: Internal}, firstClassField: {type: boolean, description: Internal.}, createdBy: {type: string, description: 'Internal. Field creator.'}} required: [name, type] type: object additionalProperties: false CustomObjectField: $ref: '#/components/schemas/IPersonField' CustomObjectSchemaAssociation: properties: {type: {type: string, enum: ['1:1', '1:M', 'M:M'], description: 'Type of the association. 1 to 1, 1 to many, many to many'}, name: {type: string, description: 'Optional name of the association. E.g. if defining a relation between a Person and a Company this can be "Employee", "Owner", "Manager", etc.'}, toObject: {type: string, description: 'The name of the custom object that''s the other side of this association. Associations are automatically defined as two-way. I.e. there is no need to associate from -> to and to -> from.'}, fromObject: {type: string, description: 'The name of the custom object that''s a side to this association. Associations are automatically defined as two-way. I.e. there is no need to associate from -> to and to -> from.'}, id: {type: number, format: double, description: 'Id of the association'}} required: [type, toObject, fromObject, id] type: object CustomObjectSchema: properties: {associations: {items: {$ref: '#/components/schemas/CustomObjectSchemaAssociation'}, type: array}, fields: {items: {$ref: '#/components/schemas/CustomObjectField'}, type: array, description: 'The fields of the custom object'}, secondaryFields: {items: {type: string}, type: array, description: 'Designate a list of secondary field used when displaying this object.'}, primaryField: {type: string, description: 'Designate a primary field used when displaying this object.'}, searchableFields: {items: {type: string}, type: array, description: 'Fields that will be indexed for searching.'}, displayNamePlural: {type: string, description: 'The display name of multiple instances the custom object. E.g. "Invoices"'}, displayNameSingular: {type: string, description: 'The display name of one instance the custom object. E.g. "Invoice"'}, description: {type: string, description: 'Description of the custom object'}, name: {type: string, description: 'The name of the custom object'}} required: [displayNamePlural, displayNameSingular, name] type: object Pick_CustomObjectSchemaCreatable.Exclude_keyofCustomObjectSchemaCreatable.searchableFields__: properties: {name: {type: string, description: 'The name of the custom object'}, description: {type: string, description: 'Description of the custom object'}, displayNameSingular: {type: string, description: 'The display name of one instance the custom object. E.g. "Invoice"'}, displayNamePlural: {type: string, description: 'The display name of multiple instances the custom object. E.g. "Invoices"'}, primaryField: {type: string, description: 'Designate a primary field used when displaying this object.'}, secondaryFields: {items: {type: string}, type: array, description: 'Designate a list of secondary field used when displaying this object.'}} required: [name, displayNameSingular, displayNamePlural] type: object description: 'From T, pick a set of properties whose keys are in the union K' Omit_CustomObjectSchemaCreatable.searchableFields_: $ref: '#/components/schemas/Pick_CustomObjectSchemaCreatable.Exclude_keyofCustomObjectSchemaCreatable.searchableFields__' description: 'Construct a type with the properties of T except for those in type K.' Partial_Omit_CustomObjectSchema.fields-or-associations-or-name__: properties: {description: {type: string, description: 'Description of the custom object'}, displayNameSingular: {type: string, description: 'The display name of one instance the custom object. E.g. "Invoice"'}, displayNamePlural: {type: string, description: 'The display name of multiple instances the custom object. E.g. "Invoices"'}, searchableFields: {items: {type: string}, type: array, description: 'Fields that will be indexed for searching.'}, primaryField: {type: string, description: 'Designate a primary field used when displaying this object.'}, secondaryFields: {items: {type: string}, type: array, description: 'Designate a list of secondary field used when displaying this object.'}} type: object description: 'Make all properties in T optional' CustomObjectSchemaUpdatable: $ref: '#/components/schemas/Partial_Omit_CustomObjectSchema.fields-or-associations-or-name__' PersonField: properties: {name: {type: string, description: "Unique ID of the field.\n\nUse this \"name\" to refer to this field in any API operations."}, title: {type: string, description: 'Human readable name of the field.'}, type: {$ref: '#/components/schemas/Exclude_JSONSchema6TypeName.object-or-array-or-null_', description: 'Type of the field. JSON schema compatible'}, format: {$ref: '#/components/schemas/PersonFieldFormat', description: 'Format of the field. Applies to String fields only. JSON schema compatible'}, displayType: {$ref: '#/components/schemas/FieldDisplayType', description: "Reserved for future use.\nHow to display the field in the UI. If empty, the display will be deduced from the field type and format."}, readOnly: {type: boolean, description: 'Whether this field can be changed by the user or via the API.'}, tooltip: {type: string, description: 'More information about this field (to be shown in a tooltip)'}, icon: {type: string, description: 'Field icon, if set.'}, array: {type: boolean, description: 'Whether this field holds an array of values.'}, enum: {items: {type: string}, type: array, description: 'Possible values for this field'}, enumNames: {items: {type: string}, type: array, description: 'Labels for enum values. If be omitted, the enum values will be used as enum labels.'}, allowNewEnumValues: {type: boolean, description: 'If we allow other values than the ones in the "enum" property.'}, canMapFrom: {type: boolean, description: Internal}, firstClassField: {type: boolean, description: Internal.}, createdBy: {type: string, description: 'Internal. Field creator.'}} required: [name, type, title, format, readOnly, canMapFrom, firstClassField, array, createdBy] type: object additionalProperties: false Partial_Pick_CustomObjectField.title-or-tooltip-or-displayType-or-icon-or-enumNames-or-enum-or-type-or-format__: properties: {title: {type: string, description: 'Human readable name of the field.'}, tooltip: {type: string, description: 'More information about this field (to be shown in a tooltip)'}, displayType: {$ref: '#/components/schemas/FieldDisplayType', description: "Reserved for future use.\nHow to display the field in the UI. If empty, the display will be deduced from the field type and format."}, icon: {type: string, description: 'Field icon, if set.'}, enumNames: {items: {type: string}, type: array, description: 'Labels for enum values. If be omitted, the enum values will be used as enum labels.'}, enum: {items: {type: string}, type: array, description: 'Possible values for this field'}, type: {$ref: '#/components/schemas/Exclude_JSONSchema6TypeName.object-or-array-or-null_', description: 'Type of the field. JSON schema compatible'}, format: {$ref: '#/components/schemas/PersonFieldFormat', description: 'Format of the field. Applies to String fields only. JSON schema compatible'}} type: object description: 'Make all properties in T optional' CustomObjectFieldEdit: $ref: '#/components/schemas/Partial_Pick_CustomObjectField.title-or-tooltip-or-displayType-or-icon-or-enumNames-or-enum-or-type-or-format__' Pick_CustomObjectSchemaAssociation.Exclude_keyofCustomObjectSchemaAssociation.id__: properties: {name: {type: string, description: 'Optional name of the association. E.g. if defining a relation between a Person and a Company this can be "Employee", "Owner", "Manager", etc.'}, type: {type: string, enum: ['1:1', '1:M', 'M:M'], description: 'Type of the association. 1 to 1, 1 to many, many to many'}, fromObject: {type: string, description: 'The name of the custom object that''s a side to this association. Associations are automatically defined as two-way. I.e. there is no need to associate from -> to and to -> from.'}, toObject: {type: string, description: 'The name of the custom object that''s the other side of this association. Associations are automatically defined as two-way. I.e. there is no need to associate from -> to and to -> from.'}} required: [type, fromObject, toObject] type: object description: 'From T, pick a set of properties whose keys are in the union K' Omit_CustomObjectSchemaAssociation.id_: $ref: '#/components/schemas/Pick_CustomObjectSchemaAssociation.Exclude_keyofCustomObjectSchemaAssociation.id__' description: 'Construct a type with the properties of T except for those in type K.' CustomObjectSchemaAssociationCreatable: $ref: '#/components/schemas/Omit_CustomObjectSchemaAssociation.id_' EmailDomainDNSRecordResponse: description: 'DNS record for domain verification.' properties: {type: {type: string, enum: [CNAME, TXT]}, host: {type: string}, data: {type: string}, valid: {type: boolean}, reason: {type: string}, optional: {type: boolean}} required: [type, host, data, valid] type: object additionalProperties: false EmailDomainResponse: description: 'Email domain (verification status and DNS records).' properties: {id: {type: number, format: double}, domain: {type: string}, status: {type: string}, dns: {items: {$ref: '#/components/schemas/EmailDomainDNSRecordResponse'}, type: array}, accountId: {type: number, format: double}, isSES: {type: boolean}, error: {type: string}, hasRestrictiveSubdomainPolicy: {type: boolean}, externalIds: {properties: {sendgridAccountName: {type: string}, sendgridDomainAuthentication: {type: number, format: double}}, type: object}, dnsRecordsExpiredAt: {type: string, nullable: true}, dnsRecordsExpiredCount: {type: number, format: double}, dontRecheckDNSRecords: {type: boolean}} required: [id, domain, status, dns, accountId] type: object additionalProperties: false EmailDomainCreateBody: description: 'Request body for adding an email domain for verification.' properties: {domain: {type: string, description: 'Domain name to verify (e.g. example.com)'}} required: [domain] type: object additionalProperties: false EmailContent: {} EmailContentCreate: properties: {name: {type: string, description: 'Name of the email template'}, subject: {type: string, description: 'Subject of the email.'}, fromEmail: {type: string, description: 'From address to send the email from'}, fromName: {type: string, description: 'Name that most inboxes use to display instead of the From email address.'}, replyEmail: {type: string, description: 'Address that recipients will reply to by default.'}, replyName: {type: string, description: 'Name that most inboxes use to display instead of the Reply email address.'}, type: {type: string, enum: [HTML, text], description: 'Type of the email. HTML or plain-text. Currently only HTML is supported.'}, html: {type: string, description: 'HTML content of the email.'}, editor: {description: 'Internal representation of the email template to enable editing in the Encharge UI.'}, previewImage: {type: string, description: 'Thumbnail of the email contents'}, preheader: {type: string, description: 'The preheader is a summary text that follows a subject line when the email is viewed in an inbox.'}, cc: {type: string, description: 'CC recipients of this email. Please note that using CC in mass emails is not advised, as it will quickly flood the CCed inbox.'}, bcc: {type: string, description: 'BCC recipients of this email. Please note that using BCC in mass emails is not advised, as it will quickly flood the BCCed inbox.'}, communicationCategoryId: {type: number, format: double, description: 'The category of this email template'}, mergeTags: {items: {properties: {label: {type: string}, value: {type: string}}, required: [value], type: object}, type: array, description: 'Custom merge tags for the email'}, isStandalone: {type: boolean, description: 'Whether this email template is standalone or part of a broadcast.'}, aiGenerated: {type: boolean, description: 'Whether this email template was generated by the AI assistant.'}} required: [name, subject, fromEmail] type: object additionalProperties: false EmailMergeTag: properties: {value: {type: string}, label: {type: string}} required: [value] type: object additionalProperties: false EmailMergeTags: items: {$ref: '#/components/schemas/EmailMergeTag'} type: array Partial_IEmailContent_: properties: {id: {type: number, format: double}, archived: {type: boolean}, isStandalone: {type: boolean}, accountId: {type: number, format: double}, name: {type: string}, subject: {type: string}, fromEmail: {type: string}, fromName: {type: string}, replyName: {type: string}, replyEmail: {type: string}, type: {type: string, enum: [HTML, text]}, html: {type: string}, editor: {}, previewImage: {type: string}, preheader: {type: string}, cc: {type: string}, bcc: {type: string}, canSpamCompliance: {type: string, enum: [approved, pending, rejected, manually_approved]}, communicationCategoryId: {type: number, format: double}, mergeTags: {$ref: '#/components/schemas/EmailMergeTags'}, aiGenerated: {type: boolean}} type: object description: 'Make all properties in T optional' EmailContentVersion: {} CommonObjectsSegmentFolderType: type: string enum: [objects-company, objects-person, objects-invoice, objects-contact, objects-deal, objects-product, objects-opportunity, objects-lead, objects-account, objects-case, objects-task, objects-event] ObjectsSegmentFolderType: anyOf: [{$ref: '#/components/schemas/CommonObjectsSegmentFolderType'}, {type: string}] FolderType: anyOf: [{$ref: '#/components/schemas/ObjectsSegmentFolderType'}, {type: string, enum: [segments, emails, flows, personFields, broadcasts, tags, forms, eventManagement]}] GenericFolderAPI: properties: {type: {type: string, enum: [folder], nullable: false}, folderType: {$ref: '#/components/schemas/FolderType'}, id: {type: string}, root: {type: boolean}, name: {type: string}, expanded: {type: boolean}, childrenIds: {items: {anyOf: [{type: string}, {type: number, format: double}]}, type: array}, autoFolderType: {type: string, enum: [favorites], nullable: false}, color: {type: string}, createdAt: {type: string}, updatedAt: {type: string}} required: [type, folderType, id, name] type: object additionalProperties: false Partial_GenericFolderAPI_: properties: {type: {type: string, enum: [folder], nullable: false}, folderType: {$ref: '#/components/schemas/FolderType'}, id: {type: string}, root: {type: boolean}, name: {type: string}, expanded: {type: boolean}, childrenIds: {items: {anyOf: [{type: string}, {type: number, format: double}]}, type: array}, autoFolderType: {type: string, enum: [favorites], nullable: false}, color: {type: string}, createdAt: {type: string}, updatedAt: {type: string}} type: object description: 'Make all properties in T optional' ConditionPerformed: type: string enum: [has, 'has not'] SegmentEventConditionGroup: properties: {type: {type: string, enum: [group], nullable: false}, operator: {type: string, enum: [and, or]}, conditions: {items: {anyOf: [{$ref: '#/components/schemas/SegmentEventConditionGroup'}, {$ref: '#/components/schemas/SegmentEventProperty'}]}, type: array}, system: {type: boolean}, uuid: {type: string}} required: [type, operator, conditions] type: object additionalProperties: false ConditionGeneric: type: string enum: [is, 'is not', 'is empty', 'is not empty', 'is any', 'is any of', 'is not any of'] ConditionText: type: string enum: [is, 'is not', 'is empty', 'is not empty', 'is any', 'is any of', 'is not any of', 'starts with', 'does not start with', 'ends with', 'does not end with', contains, 'does not contain'] ConditionNumber: type: string enum: [is, 'is not', 'is empty', 'is not empty', 'is any', 'is any of', 'is not any of', 'is more than', 'is less than', 'at least'] ConditionDateAbsolute: type: string enum: ['is empty', 'is not empty', 'is any', after, before, on] EventPropertyConditionAll: anyOf: [{$ref: '#/components/schemas/ConditionGeneric'}, {$ref: '#/components/schemas/ConditionText'}, {$ref: '#/components/schemas/ConditionNumber'}, {$ref: '#/components/schemas/ConditionDateAbsolute'}] SegmentEventProperty: properties: {uuid: {type: string}, value: {}, condition: {$ref: '#/components/schemas/EventPropertyConditionAll'}, field: {type: string}, type: {type: string, enum: [field], nullable: false}} required: [condition, field, type] type: object ConditionNumberOnly: type: string enum: ['is more than', 'is less than', 'at least'] SegmentEventFrequencyCondition: properties: {type: {type: string, enum: [frequencyCondition], nullable: false}, value: {type: number, format: double}, condition: {$ref: '#/components/schemas/ConditionNumberOnly'}} required: [type, value, condition] type: object additionalProperties: false ConditionDate: type: string enum: ['is empty', 'is not empty', 'is any', after, before, on, 'after period', 'before period', 'on period'] SegmentEventRecencyCondition: properties: {type: {type: string, enum: [recencyCondition], nullable: false}, value: {anyOf: [{type: number, format: double}, {type: string}]}, condition: {$ref: '#/components/schemas/ConditionDate'}} required: [type, value, condition] type: object additionalProperties: false SegmentEventCondition: properties: {type: {type: string, enum: [event], nullable: false}, condition: {$ref: '#/components/schemas/ConditionPerformed'}, systemConditions: {$ref: '#/components/schemas/SegmentEventConditionGroup', description: "System conditions are conditions that added to the segment by the system.\nThey are not editable by the user.\nFor example, for email conditions we automatically add a condition that the event type is \"email\"."}, propertiesConditions: {$ref: '#/components/schemas/SegmentEventConditionGroup'}, frequencyCondition: {$ref: '#/components/schemas/SegmentEventFrequencyCondition'}, recencyCondition: {$ref: '#/components/schemas/SegmentEventRecencyCondition'}} required: [type, condition, systemConditions] type: object additionalProperties: false SegmentTagCondition: properties: {type: {type: string, enum: [tag], nullable: false}, value: {}, condition: {$ref: '#/components/schemas/ConditionPerformed'}} required: [type, value, condition] type: object additionalProperties: false ConditionAll: anyOf: [{$ref: '#/components/schemas/ConditionGeneric'}, {$ref: '#/components/schemas/ConditionText'}, {$ref: '#/components/schemas/ConditionNumber'}, {$ref: '#/components/schemas/ConditionDate'}] SegmentPropertyCondition: properties: {type: {type: string, enum: [field], nullable: false}, field: {type: string}, condition: {$ref: '#/components/schemas/ConditionAll'}, value: {}} required: [type, field, condition] type: object additionalProperties: false ConditionNestedSegment: type: string enum: [in, 'not in'] SegmentNestedSegmentCondition: properties: {type: {type: string, enum: [segment], nullable: false}, value: {type: number, format: double}, condition: {$ref: '#/components/schemas/ConditionNestedSegment'}} required: [type, value, condition] type: object additionalProperties: false SegmentConditionGroup: properties: {type: {type: string, enum: [group], nullable: false}, operator: {type: string, enum: [and, or]}, conditions: {items: {$ref: '#/components/schemas/SegmentCondition'}, type: array}} required: [type, operator, conditions] type: object additionalProperties: false AssociationCondition: properties: {type: {anyOf: [{$ref: '#/components/schemas/ConditionNumberOnly'}, {type: string, enum: [any, none, exactly]}]}, value: {type: number, format: double}} required: [type] type: object additionalProperties: false SegmentAssociationCondition: properties: {type: {type: string, enum: [association], nullable: false}, condition: {$ref: '#/components/schemas/AssociationCondition'}, value: {type: number, format: double}, associationConditions: {$ref: '#/components/schemas/SegmentConditionGroup'}} required: [type, condition, value] type: object additionalProperties: false ConditionGoal: type: string enum: [in, 'not in'] SegmentGoalCondition: properties: {type: {type: string, enum: [goal], nullable: false}, condition: {$ref: '#/components/schemas/ConditionGoal'}, value: {type: number, format: double}} required: [type, condition, value] type: object additionalProperties: false SegmentCondition: allOf: [{anyOf: [{$ref: '#/components/schemas/SegmentEventCondition'}, {$ref: '#/components/schemas/SegmentTagCondition'}, {$ref: '#/components/schemas/SegmentPropertyCondition'}, {$ref: '#/components/schemas/SegmentNestedSegmentCondition'}, {$ref: '#/components/schemas/SegmentConditionGroup'}, {$ref: '#/components/schemas/SegmentAssociationCondition'}, {$ref: '#/components/schemas/SegmentGoalCondition'}]}, {properties: {uuid: {type: string}}, type: object}] Segment: properties: {version: {type: number, enum: [1, 2], description: 'Segment version. Should be 2 for non-legacy segments'}, id: {type: number, format: double, description: 'Id of the segment'}, name: {type: string, description: 'Name of the segment'}, objectName: {type: string, description: 'Type of object this segment is for'}, conditions: {$ref: '#/components/schemas/SegmentConditionGroup', description: 'Segment conditions'}, accountId: {type: number, format: double, description: 'Account that owns the segment'}, readOnly: {type: boolean, description: 'Readonly segments cannot be modified. They are created by the system'}, autoSegment: {type: boolean, description: Internal.}, color: {type: string, description: 'Hex color associated with the segment'}, templateId: {type: string, description: 'Name of the template this segment is based on'}} required: [version, id, name, objectName, accountId, conditions, autoSegment, color, templateId] type: object additionalProperties: false Partial_Omit_ISegment.id-or-accountId-or-version__: properties: {name: {type: string, description: 'Name of the segment'}, objectName: {type: string, description: 'Type of object this segment is for'}, conditions: {$ref: '#/components/schemas/SegmentConditionGroup', description: 'Segment conditions'}, readOnly: {type: boolean, description: 'Readonly segments cannot be modified. They are created by the system'}, autoSegment: {type: boolean, description: Internal.}, color: {type: string, description: 'Hex color associated with the segment'}, templateId: {type: string, description: 'Name of the template this segment is based on'}} type: object description: 'Make all properties in T optional' SegmentCreatable: $ref: '#/components/schemas/Partial_Omit_ISegment.id-or-accountId-or-version__' Partial_ISegment_: properties: {version: {type: number, enum: [1, 2], description: 'Segment version. Should be 2 for non-legacy segments'}, id: {type: number, format: double, description: 'Id of the segment'}, name: {type: string, description: 'Name of the segment'}, objectName: {type: string, description: 'Type of object this segment is for'}, conditions: {$ref: '#/components/schemas/SegmentConditionGroup', description: 'Segment conditions'}, accountId: {type: number, format: double, description: 'Account that owns the segment'}, readOnly: {type: boolean, description: 'Readonly segments cannot be modified. They are created by the system'}, autoSegment: {type: boolean, description: Internal.}, color: {type: string, description: 'Hex color associated with the segment'}, templateId: {type: string, description: 'Name of the template this segment is based on'}} type: object description: 'Make all properties in T optional' EndUserIdentifiers: properties: {id: {type: string, description: "Encharge ID of the person. An UUID.\n\nAt least one of id/userId/email must be specified."}, userId: {type: string, description: "UserID of the person.\n\nAt least one of id/userId/email must be specified."}, email: {type: string, description: "Email of the person.\n\nAt least one of id/userId/email must be specified."}} additionalProperties: {} type: object Tag: properties: {color: {type: string}, count: {type: number, format: double}, createdAt: {type: string, format: date-time}, description: {type: string}, tag: {type: string}} required: [tag] type: object examples: {} headers: {} requestBodies: {} responses: {} securitySchemes: apiKeyHeader: description: "You can use API key authentication if you are using the API for your Encharge account. If you are building an app for others to use, please use the OAuth2 authentication below. Find your API key from https://app.encharge.io/account/info . \n\n While all operations in the API specify oauth2 security, instead you can use an API key in the header or query string." type: apiKey in: header name: X-Encharge-Token apiKeyQuery: description: "You can use API key authentication if you are using the API for your Encharge account. \n\nIf you are building an app for others to use, please use the OAuth2 authentication below. Find your API key from https://app.encharge.io/account/info \n\n While all operations in the API specify oauth2 security, instead you can use an API key in the header or query string." type: apiKey in: query name: token oauth2: type: oauth2 description: "The Encharge API uses OAuth 2 with the authorization code flow. \n\nGet for your OAuth credentials (Client ID and Client Secret) by filling out [this form](https://research.typeform.com/to/I680YtLA)." flows: {authorizationCode: {authorizationUrl: 'https://api.encharge.io/v1/oauth/authorize', tokenUrl: 'https://api.encharge.io/v1/oauth/token', refreshUrl: 'https://api.encharge.io/v1/oauth/token', scopes: {}}} paths: /event-subscriptions: post: responses: {'201': {description: Created, content: {application/json: {schema: {properties: {subscription: {properties: {id: {type: number, format: double}}, required: [id], type: object}}, required: [subscription], type: object}}}}} requestBody: {required: true, content: {application/json: {schema: {properties: {eventType: {type: string, description: 'Event to trigger on'}, url: {type: string, description: 'URL to post the webhook to.'}, eventName: {type: string, nullable: true, default: null}, handlerData: {}, service: {type: string}, operation: {type: string}}, required: [eventType, url, eventType], type: object}}}} operationId: CreateWebhook description: 'Subscribe to events happening in Encharge.' tags: [Webhooks] security: [{oauth2: ['account:write']}] parameters: [] /people: delete: operationId: ArchivePeople responses: {'204': {description: Deleted}} description: "Archive or delete one or multiple people.\n\nArchiving is the preferred method of removing users in Encharge.\n\nAlternatively, you can delete a person and all their data for GDPR purposes.\n" tags: [People] security: [{oauth2: ['people:write']}] parameters: [{$ref: '#/components/parameters/PeopleQuery'}, {name: force, description: 'If set to `true`, will delete the person''s data. This is useful for GDPR-compliant removal of user data.', in: query, required: false, schema: {type: boolean}}] get: operationId: GetSpecificPeople description: 'Retrive specific people in your account.' responses: {'200': {description: Ok, content: {application/json: {schema: {description: 'Sample description', properties: {users: {items: {$ref: '#/components/schemas/EndUser'}, type: array}}, required: [users], type: object}}}}} tags: [People] security: [{oauth2: ['people:read']}] parameters: [{$ref: '#/components/parameters/PeopleQuery'}, {name: attributes, description: 'Comma separated list of custom fields to retrieve.', in: query, required: false, schema: {type: string}}, {name: includeArchived, description: 'Whether to include archived people in the response. By default archived people are not included.', in: query, required: false, schema: {type: boolean}}] post: operationId: CreateUpdatePeople summary: 'Create/Update People' description: "Create or update people in Encharge.\n\nIf the people exist (identified by id/userId/email/another ID), they will be updated. Otherwise, people will be created.\n" responses: {'200': {description: Ok, content: {application/json: {schema: {properties: {users: {items: {$ref: '#/components/schemas/EndUser'}, type: array}}, required: [users], type: object}}}}} tags: [People] security: [{oauth2: ['people:write']}] requestBody: {required: true, content: {application/json: {schema: {description: 'Array of EndUser objects.', type: array, items: {$ref: '#/components/schemas/EndUser'}}}}} /accounts/info: get: operationId: GetInfo responses: {'200': {description: Ok, content: {application/json: {schema: {properties: {peopleCount: {type: number, format: double}, status: {type: string, enum: [active, canceled, trial, trialExpired]}, timezone: {type: string}, services: {}, activeServices: {items: {type: string}, type: array}, site: {type: string}, name: {type: string}, accountId: {type: number, format: double}}, required: [peopleCount, status, timezone, services, activeServices, site, name, accountId], type: object}}}}} description: 'Get information about your account.' tags: [Account] security: [{oauth2: []}] parameters: [] '/accounts/form/{formId}': get: operationId: GetAccountInfoByFormId responses: {'200': {description: Ok, content: {application/json: {schema: {properties: {accountInfo: {properties: {site: {type: string}, logo: {type: string}, name: {type: string}, id: {type: number, format: double}}, required: [site, logo, name, id], type: object}}, required: [accountInfo], type: object}}}}} description: 'Get non-sensitive account information by form Id without authentication' tags: [Account] security: [] parameters: [{in: path, name: formId, required: true, schema: {type: string}}] '/broadcasts/{id}/send': post: operationId: SendBroadcast responses: {'200': {description: Ok, content: {application/json: {schema: {properties: {item: {$ref: '#/components/schemas/Broadcast'}}, required: [item], type: object}}}}} description: "Confirm that broadcast is ready for sending.\nNote: If modified, a confirmed broadcast will need to be confirmed again." tags: [Broadcasts] security: [{oauth2: ['broadcasts:write']}] parameters: [{in: path, name: id, required: true, schema: {format: double, type: number}}] '/objects/{objectName}': get: operationId: GetCustomObjects responses: {'200': {description: Ok, content: {application/json: {schema: {properties: {objects: {items: {$ref: '#/components/schemas/CustomObject'}, type: array}}, required: [objects], type: object}}}}} description: 'Get multiple custom objects/companies.' tags: [CustomObjects] security: [{oauth2: []}] parameters: [{in: path, name: objectName, required: true, schema: {type: string}}, {in: query, name: attributes, required: false, schema: {type: array, items: {type: string}}}, {in: query, name: sort, required: false, schema: {type: string}}, {in: query, name: order, required: false, schema: {type: string, enum: [asc, desc]}}, {in: query, name: offset, required: false, schema: {format: double, type: number}}, {in: query, name: limit, required: false, schema: {format: double, type: number}}] post: operationId: CreateCustomObjects responses: {'200': {description: Ok, content: {application/json: {schema: {properties: {objects: {items: {$ref: '#/components/schemas/CustomObject'}, type: array}}, required: [objects], type: object}}}}} description: 'Create new custom objects/companies.' tags: [CustomObjects] security: [{oauth2: []}] parameters: [{in: path, name: objectName, required: true, schema: {type: string}}] requestBody: {description: 'Objects to create.', required: true, content: {application/json: {schema: {items: {$ref: '#/components/schemas/ICustomObjectCreatable'}, type: array, description: 'Objects to create.'}}}} put: operationId: CreateOrUpdateCustomObjects responses: {'200': {description: Ok, content: {application/json: {schema: {properties: {created: {type: boolean}, object: {$ref: '#/components/schemas/CustomObject'}}, required: [created, object], type: object}}}}} description: 'Create or Update (Upsert) a custom object/company.' tags: [CustomObjects] security: [{oauth2: []}] parameters: [{in: path, name: objectName, required: true, schema: {type: string}}] requestBody: {description: 'Objects to create.', required: true, content: {application/json: {schema: {$ref: '#/components/schemas/ICustomObjectCreatable', description: 'Objects to create.'}}}} '/objects/{objectName}/segments/{segmentId}': get: operationId: GetCustomObjectsInSegment responses: {'200': {description: Ok, content: {application/json: {schema: {properties: {objects: {items: {$ref: '#/components/schemas/CustomObject'}, type: array}}, required: [objects], type: object}}}}} description: 'Get custom objects/companies in a segment.' tags: [CustomObjects] security: [{oauth2: []}] parameters: [{in: path, name: objectName, required: true, schema: {type: string}}, {in: path, name: segmentId, required: true, schema: {format: double, type: number}}, {in: query, name: attributes, required: false, schema: {type: array, items: {type: string}}}, {in: query, name: sort, required: false, schema: {type: string}}, {in: query, name: order, required: false, schema: {type: string, enum: [asc, desc]}}, {in: query, name: offset, required: false, schema: {format: double, type: number}}, {in: query, name: limit, required: false, schema: {format: double, type: number}}] '/objects/{objectName}/count': get: operationId: GetCustomObjectsCount responses: {'200': {description: Ok, content: {application/json: {schema: {properties: {count: {type: number, format: double}}, required: [count], type: object}}}}} description: 'Get custom objects/companies count.' tags: [CustomObjects] security: [{oauth2: []}] parameters: [{in: path, name: objectName, required: true, schema: {type: string}}] '/objects/{objectName}/segments/{segmentId}/count': get: operationId: GetCustomObjectsInSegmentCount responses: {'200': {description: Ok, content: {application/json: {schema: {properties: {count: {type: number, format: double}}, required: [count], type: object}}}}} description: 'Get count of custom objects/companies in a segment.' tags: [CustomObjects] security: [{oauth2: []}] parameters: [{in: path, name: objectName, required: true, schema: {type: string}}, {in: path, name: segmentId, required: true, schema: {format: double, type: number}}] '/objects/{objectName}/search': get: operationId: SearchCustomObjects responses: {'200': {description: Ok, content: {application/json: {schema: {properties: {objects: {}}, required: [objects], type: object}}}}} description: 'Search custom objects/companies by their searchable fields' tags: [CustomObjects] security: [{oauth2: []}] parameters: [{in: path, name: objectName, required: true, schema: {type: string}}, {in: query, name: query, required: true, schema: {type: string}}, {description: 'Id of segment to search in. If not specified, will search in all objects.', in: query, name: segmentId, required: false, schema: {format: double, type: number}}, {in: query, name: offset, required: false, schema: {format: double, type: number}}, {in: query, name: limit, required: false, schema: {format: double, type: number}}] '/objects/{objectName}/{id}': get: operationId: GetCustomObjectById responses: {'200': {description: Ok, content: {application/json: {schema: {properties: {object: {$ref: '#/components/schemas/CustomObject'}}, required: [object], type: object}}}}} description: 'Get custom object/company by id' tags: [CustomObjects] security: [{oauth2: []}] parameters: [{in: path, name: objectName, required: true, schema: {type: string}}, {in: path, name: id, required: true, schema: {format: double, type: number}}] patch: operationId: UpdateCustomObject responses: {'200': {description: Ok, content: {application/json: {schema: {properties: {object: {$ref: '#/components/schemas/CustomObject'}}, required: [object], type: object}}}}} description: 'Update custom object/company.' tags: [CustomObjects] security: [{oauth2: ['account:write']}] parameters: [{in: path, name: objectName, required: true, schema: {type: string}}, {in: path, name: id, required: true, schema: {format: double, type: number}}] requestBody: {description: 'Custom object. Must have an id or externalId.', required: true, content: {application/json: {schema: {allOf: [{$ref: '#/components/schemas/ICustomObjectCreatable'}, {properties: {}, additionalProperties: {}, type: object}], description: 'Custom object. Must have an id or externalId.'}}}} delete: operationId: DeleteCustomObject responses: {'204': {description: Deleted}} description: 'Remove custom object/company by Id' tags: [CustomObjects] security: [{oauth2: ['account:write']}] parameters: [{in: path, name: objectName, required: true, schema: {type: string}}, {in: path, name: id, required: true, schema: {format: double, type: number}}] '/objects/{objectName}/externalId/{externalId}': get: operationId: GetCustomObjectByExternalId responses: {'200': {description: Ok, content: {application/json: {schema: {properties: {object: {$ref: '#/components/schemas/CustomObject'}}, required: [object], type: object}}}}} description: 'Get custom object/company by external ID' tags: [CustomObjects] security: [{oauth2: []}] parameters: [{in: path, name: objectName, required: true, schema: {type: string}}, {in: path, name: externalId, required: true, schema: {type: string}}] patch: operationId: UpdateCustomObjectByExternalId responses: {'200': {description: Ok, content: {application/json: {schema: {properties: {object: {$ref: '#/components/schemas/CustomObject'}}, required: [object], type: object}}}}} description: 'Update custom object/company by external ID' tags: [CustomObjects] security: [{oauth2: ['account:write']}] parameters: [{in: path, name: objectName, required: true, schema: {type: string}}, {in: path, name: externalId, required: true, schema: {type: string}}] requestBody: {description: 'Custom object. Must have an id or externalId.', required: true, content: {application/json: {schema: {$ref: '#/components/schemas/ICustomObjectCreatable', description: 'Custom object. Must have an id or externalId.'}}}} delete: operationId: DeleteCustomObjectByExternalId responses: {'204': {description: Deleted}} description: 'Remove custom object/company by external Id' tags: [CustomObjects] security: [{oauth2: ['account:write']}] parameters: [{in: path, name: objectName, required: true, schema: {type: string}}, {in: path, name: externalId, required: true, schema: {type: string}}] '/objects/{objectName}/{id}/associations/{associationId}': get: operationId: GetObjectsByAssociation responses: {'200': {description: Ok, content: {application/json: {schema: {properties: {objects: {items: {}, type: array}}, required: [objects], type: object}}}}} description: 'Get objects by association with given custom object' tags: [CustomObjects] security: [{oauth2: ['account:write']}] parameters: [{description: 'Name of the custom object to get associated objects for, e.g. "person" or "company".', in: path, name: objectName, required: true, schema: {type: string}}, {description: 'Id of the custom object to get associated objects for.', in: path, name: id, required: true, schema: {}}, {description: 'Id of the association schema.', in: path, name: associationId, required: true, schema: {format: double, type: number}}, {in: query, name: attributes, required: false, schema: {type: array, items: {type: string}}}, {in: query, name: sort, required: false, schema: {type: string}}, {in: query, name: order, required: false, schema: {type: string, enum: [asc, desc]}}, {in: query, name: offset, required: false, schema: {format: double, type: number}}, {in: query, name: limit, required: false, schema: {format: double, type: number}}] '/objects/{objectName}/{id}/associations': get: operationId: GetAllAssociatedObjects responses: {'200': {description: Ok, content: {application/json: {schema: {properties: {objects: {properties: {}, additionalProperties: {items: {}, type: array}, type: object}}, required: [objects], type: object}}}}} description: 'Retrieve all objects associated in any way with a given custom object' tags: [CustomObjects] security: [{oauth2: ['account:write']}] parameters: [{in: path, name: objectName, required: true, schema: {type: string}}, {in: path, name: id, required: true, schema: {}}, {in: query, name: limit, required: false, schema: {format: double, type: number}}] '/objects/{objectName}/{id}/associations/default/{targetObjectName}/{targetId}': post: operationId: AssociateObjectsByDefaultAssociation responses: {'201': {description: Created}} description: "Associate a custom object with another object, using the default association.\n\nIf there is only one association between the objects (e.g. a contact and a company),\nyou might use this endpoint to associate them without passing the association id." tags: [CustomObjects] security: [{oauth2: ['account:write']}] parameters: [{description: 'Name of the custom object on one side of the association, e.g. "person" or "company".', in: path, name: objectName, required: true, schema: {type: string}}, {description: 'Id of the custom object on one side of the association.', in: path, name: id, required: true, schema: {}}, {description: 'Name of the custom object on the other side of the association.', in: path, name: targetObjectName, required: true, schema: {type: string}}, {description: 'Id of the custom object on the other side of the association.', in: path, name: targetId, required: true, schema: {}}] '/objects/{objectName}/{id}/associations/{associationId}/{targetId}': post: operationId: AssociateCustomObjects responses: {'201': {description: Created}} description: 'Associate an object with another object' tags: [CustomObjects] security: [{oauth2: ['account:write']}] parameters: [{description: 'Name of the custom object on one side of the association, e.g. "person" or "company".', in: path, name: objectName, required: true, schema: {type: string}}, {description: 'Id of the custom object on one side of the association.', in: path, name: id, required: true, schema: {}}, {description: 'Id of the association schema.', in: path, name: associationId, required: true, schema: {format: double, type: number}}, {description: 'Id of the custom object on the other side of the association.', in: path, name: targetId, required: true, schema: {}}] delete: operationId: RemoveCustomObjectsAssociation responses: {'204': {description: Deleted}} description: 'Remove association between objects' tags: [CustomObjects] security: [{oauth2: ['account:write']}] parameters: [{description: 'Name of the custom object on one side of the association, e.g. "person" or "company".', in: path, name: objectName, required: true, schema: {type: string}}, {description: 'Id of the custom object on one side of the association.', in: path, name: id, required: true, schema: {}}, {description: 'Id of the association schema.', in: path, name: associationId, required: true, schema: {format: double, type: number}}, {description: 'Id of the custom object on the other side of the association.', in: path, name: targetId, required: true, schema: {}}] /schemas: get: operationId: GetCustomObjectsSchema responses: {'200': {description: Ok, content: {application/json: {schema: {properties: {objects: {items: {$ref: '#/components/schemas/CustomObjectSchema'}, type: array}}, required: [objects], type: object}}}}} description: 'Get all custom objects.' tags: [CustomObjectsSchema] security: [{oauth2: []}] parameters: [] post: operationId: CreateCustomObjectSchema responses: {'200': {description: Ok, content: {application/json: {schema: {properties: {object: {$ref: '#/components/schemas/CustomObjectSchema'}}, required: [object], type: object}}}}} description: 'Get custom objects counts.' tags: [CustomObjectsSchema] security: [{oauth2: []}] parameters: [] requestBody: {description: 'Objects to add.', required: true, content: {application/json: {schema: {$ref: '#/components/schemas/Omit_CustomObjectSchemaCreatable.searchableFields_', description: 'Objects to add.'}}}} '/schemas/{objectName}': get: operationId: GetCustomObjectSchema responses: {'200': {description: Ok, content: {application/json: {schema: {properties: {object: {$ref: '#/components/schemas/CustomObjectSchema'}}, required: [object], type: object}}}}} description: 'Get custom object by name.' tags: [CustomObjectsSchema] security: [{oauth2: []}] parameters: [{in: path, name: objectName, required: true, schema: {type: string}}] patch: operationId: UpdateCustomObjectSchema responses: {'200': {description: Ok, content: {application/json: {schema: {properties: {object: {$ref: '#/components/schemas/CustomObjectSchema'}}, required: [object], type: object}}}}} description: 'Update custom object.' tags: [CustomObjectsSchema] security: [{oauth2: ['account:write']}] parameters: [{in: path, name: objectName, required: true, schema: {type: string}}] requestBody: {description: 'Update data', required: true, content: {application/json: {schema: {$ref: '#/components/schemas/CustomObjectSchemaUpdatable', description: 'Update data'}}}} delete: operationId: DeleteCustomObjectSchema responses: {'204': {description: Deleted}} description: "Remove custom object definition.\n\nNote that this will delete all data stored in these custom objects." tags: [CustomObjectsSchema] security: [{oauth2: ['account:write']}] parameters: [{in: path, name: objectName, required: true, schema: {type: string}}] '/schemas/{objectName}/fields': post: operationId: CreateObjectFields responses: {'200': {description: Ok, content: {application/json: {schema: {properties: {fields: {items: {$ref: '#/components/schemas/PersonField'}, type: array}}, required: [fields], type: object}}}}} description: 'Create fields for Custom Object' tags: [CustomObjectsSchema] security: [{oauth2: ['personFields:write']}] parameters: [{in: path, name: objectName, required: true, schema: {type: string}}] requestBody: {required: true, content: {application/json: {schema: {items: {$ref: '#/components/schemas/CustomObjectField'}, type: array}}}} '/schemas/{objectName}/fields/{fieldName}': patch: operationId: EditObjectField responses: {'200': {description: Ok, content: {application/json: {schema: {properties: {field: {$ref: '#/components/schemas/PersonField'}}, required: [field], type: object}}}}} description: "Modify field for Custom Object.\n\nNote: Field type and format can only be changed for People fields." tags: [CustomObjectsSchema] security: [{oauth2: ['personFields:write']}] parameters: [{in: path, name: fieldName, required: true, schema: {type: string}}, {in: path, name: objectName, required: true, schema: {type: string}}] requestBody: {required: true, content: {application/json: {schema: {$ref: '#/components/schemas/CustomObjectFieldEdit'}}}} delete: operationId: DeleteObjectField responses: {'204': {description: Deleted}} description: 'Delete Person Field' tags: [CustomObjectsSchema] security: [{oauth2: ['personFields:write']}] parameters: [{in: path, name: fieldName, required: true, schema: {type: string}}, {in: path, name: objectName, required: true, schema: {type: string}}] /schemas/associations: post: operationId: DefineCustomObjectsAssociationSchema responses: {'200': {description: Ok, content: {application/json: {schema: {properties: {association: {$ref: '#/components/schemas/CustomObjectSchemaAssociation'}}, required: [association], type: object}}}}} description: 'Define association between custom objects.' tags: [CustomObjectsSchema] security: [{oauth2: ['account:write']}] parameters: [] requestBody: {description: 'Association Data', required: true, content: {application/json: {schema: {$ref: '#/components/schemas/CustomObjectSchemaAssociationCreatable', description: 'Association Data'}}}} '/schemas/associations/{id}': delete: operationId: RemoveCustomObjectsAssociationSchema responses: {'204': {description: Deleted}} description: 'Remove a defined association between custom objects.' tags: [CustomObjectsSchema] security: [{oauth2: ['account:write']}] parameters: [{in: path, name: id, required: true, schema: {format: double, type: number}}] /settings/email/domains: get: operationId: GetDomains responses: {'200': {description: Ok, content: {application/json: {schema: {properties: {domains: {items: {$ref: '#/components/schemas/EmailDomainResponse'}, type: array}}, required: [domains], type: object}}}}} description: 'List all email domains for the account.' security: [{oauth2: []}] parameters: [] post: operationId: CreateDomain responses: {'200': {description: Created, content: {application/json: {schema: {properties: {domain: {$ref: '#/components/schemas/EmailDomainResponse'}}, required: [domain], type: object}}}}} description: "Add an email domain for verification.\nStarts the domain verification process; DNS records must be added to complete verification." security: [{oauth2: ['emailSettings:write']}] parameters: [] requestBody: {required: true, content: {application/json: {schema: {$ref: '#/components/schemas/EmailDomainCreateBody'}}}} '/settings/email/domains/{id}': get: operationId: GetDomain responses: {'200': {description: Ok, content: {application/json: {schema: {properties: {domain: {$ref: '#/components/schemas/EmailDomainResponse'}}, required: [domain], type: object}}}}} description: 'Get a single email domain by ID.' security: [{oauth2: []}] parameters: [{in: path, name: id, required: true, schema: {format: double, type: number}}] delete: operationId: DeleteDomain responses: {'204': {description: 'No Content'}} description: 'Remove an email domain and its verification.' security: [{oauth2: ['emailSettings:write']}] parameters: [{in: path, name: id, required: true, schema: {format: double, type: number}}] '/settings/email/domains/{id}/verify': post: operationId: VerifyDomain responses: {'200': {description: Ok, content: {application/json: {schema: {properties: {domain: {$ref: '#/components/schemas/EmailDomainResponse'}}, required: [domain], type: object}}}}} description: "Trigger verification check for an email domain.\nRe-checks DNS records and updates verification status." security: [{oauth2: ['emailSettings:write']}] parameters: [{in: path, name: id, required: true, schema: {format: double, type: number}}] '/emails/{id}': get: operationId: GetEmail responses: {'200': {description: Ok, content: {application/json: {schema: {properties: {email: {}}, required: [email], type: object}}}}} description: 'Get email template' tags: [EmailTemplates] security: [{oauth2: ['emails:read']}] parameters: [{in: path, name: id, required: true, schema: {format: double, type: number}}] patch: operationId: ModifyEmail responses: {'200': {description: Ok, content: {application/json: {schema: {properties: {email: {$ref: '#/components/schemas/EmailContent'}}, required: [email], type: object}}}}} description: 'Modify email template' tags: [EmailTemplates] security: [{oauth2: ['emails:write']}] parameters: [{in: path, name: id, required: true, schema: {format: double, type: number}}] requestBody: {required: true, content: {application/json: {schema: {$ref: '#/components/schemas/Partial_IEmailContent_'}}}} delete: operationId: DeleteEmail responses: {'204': {description: Deleted}} description: 'Delete email template' tags: [EmailTemplates] security: [{oauth2: ['emails:write']}] parameters: [{in: path, name: id, required: true, schema: {format: double, type: number}}] /emails: post: operationId: CreateEmail responses: {'200': {description: Ok, content: {application/json: {schema: {properties: {email: {$ref: '#/components/schemas/EmailContent'}}, required: [email], type: object}}}}} description: 'Create email template' tags: [EmailTemplates] security: [{oauth2: ['emails:write']}] parameters: [] requestBody: {required: true, content: {application/json: {schema: {$ref: '#/components/schemas/EmailContentCreate'}}}} '/emails/{id}/versions': get: operationId: GetEmailVersions responses: {'200': {description: Ok, content: {application/json: {schema: {properties: {versions: {items: {$ref: '#/components/schemas/EmailContentVersion'}, type: array}}, required: [versions], type: object}}}}} description: 'Get version history for an email template' tags: [EmailTemplates] security: [{oauth2: ['emails:read']}] parameters: [{in: path, name: id, required: true, schema: {format: double, type: number}}, {in: query, name: limit, required: false, schema: {default: 50, format: double, type: number}}, {in: query, name: offset, required: false, schema: {default: 0, format: double, type: number}}] '/emails/{id}/versions/{version}': get: operationId: GetEmailVersion responses: {'200': {description: Ok, content: {application/json: {schema: {properties: {version: {$ref: '#/components/schemas/EmailContentVersion'}}, required: [version], type: object}}}}} description: 'Get a specific version of an email template' tags: [EmailTemplates] security: [{oauth2: ['emails:read']}] parameters: [{in: path, name: id, required: true, schema: {format: double, type: number}}, {in: path, name: version, required: true, schema: {format: double, type: number}}] '/emails/{id}/versions/selected': get: operationId: GetSelectedEmailVersion responses: {'200': {description: Ok, content: {application/json: {schema: {properties: {version: {$ref: '#/components/schemas/EmailContentVersion'}}, required: [version], type: object}}}}} description: 'Get the currently selected version for an email template' tags: [EmailTemplates] security: [{oauth2: ['emails:read']}] parameters: [{in: path, name: id, required: true, schema: {format: double, type: number}}] '/emails/{id}/versions/latest': patch: operationId: UpdateLatestEmailVersion responses: {'200': {description: Ok, content: {application/json: {schema: {properties: {version: {$ref: '#/components/schemas/EmailContentVersion'}, email: {$ref: '#/components/schemas/EmailContent'}}, required: [version, email], type: object}}}}} description: 'Update the latest version of an email template' tags: [EmailTemplates] security: [{oauth2: ['emails:write']}] parameters: [{in: path, name: id, required: true, schema: {format: double, type: number}}] requestBody: {required: true, content: {application/json: {schema: {$ref: '#/components/schemas/Partial_IEmailContent_'}}}} '/emails/{id}/versions/{version}/restore': post: operationId: RestoreEmailVersion responses: {'200': {description: Ok, content: {application/json: {schema: {properties: {newVersion: {$ref: '#/components/schemas/EmailContentVersion'}, restoredFromVersion: {type: number, format: double}, email: {$ref: '#/components/schemas/EmailContent'}}, required: [newVersion, restoredFromVersion, email], type: object}}}}} description: 'Restore a specific version as the current email content' tags: [EmailTemplates] security: [{oauth2: ['emails:write']}] parameters: [{in: path, name: id, required: true, schema: {format: double, type: number}}, {in: path, name: version, required: true, schema: {format: double, type: number}}] '/event-subscriptions/{id}': delete: operationId: DeleteWebhook responses: {'204': {description: Deleted}} description: 'Delete an existing event subscription.' tags: [Webhooks] security: [{oauth2: ['account:write']}] parameters: [{description: 'Id of the event subscription.', in: path, name: id, required: true, schema: {format: double, type: number}}] /folders: post: operationId: CreateFolder responses: {'200': {description: Ok, content: {application/json: {schema: {$ref: '#/components/schemas/GenericFolderAPI'}}}}} description: 'Create a folder.' tags: [Folders] security: [{oauth2: []}] parameters: [] requestBody: {required: true, content: {application/json: {schema: {$ref: '#/components/schemas/GenericFolderAPI'}}}} '/folders/{id}': patch: operationId: EditFolder responses: {'200': {description: Ok, content: {application/json: {schema: {properties: {folder: {$ref: '#/components/schemas/GenericFolderAPI'}}, required: [folder], type: object}}}}} description: 'Edit a folder.' tags: [Folders] security: [{oauth2: []}] parameters: [{in: path, name: id, required: true, schema: {type: string}}] requestBody: {required: true, content: {application/json: {schema: {anyOf: [{$ref: '#/components/schemas/Partial_GenericFolderAPI_'}, {$ref: '#/components/schemas/GenericFolderAPI'}]}}}} /fields: get: operationId: GetFields responses: {'200': {description: Ok, content: {application/json: {schema: {properties: {items: {items: {$ref: '#/components/schemas/IPersonField'}, type: array}}, required: [items], type: object}}}}} description: 'Get all Person Fields.' tags: [PersonFields] security: [{oauth2: []}] parameters: [] post: operationId: CreateFields responses: {'200': {description: Ok, content: {application/json: {schema: {properties: {items: {items: {$ref: '#/components/schemas/PersonField'}, type: array}}, required: [items], type: object}}}}} description: 'Create Person Fields' tags: [PersonFields] security: [{oauth2: ['personFields:write']}] parameters: [] requestBody: {required: true, content: {application/json: {schema: {items: {$ref: '#/components/schemas/IPersonField'}, type: array}}}} '/fields/{fieldName}': patch: operationId: EditField responses: {'200': {description: Ok, content: {application/json: {schema: {properties: {field: {$ref: '#/components/schemas/PersonField'}}, required: [field], type: object}}}}} description: 'Modify Person Field' tags: [PersonFields] security: [{oauth2: ['personFields:write']}] parameters: [{in: path, name: fieldName, required: true, schema: {type: string}}] requestBody: {required: true, content: {application/json: {schema: {$ref: '#/components/schemas/IPersonField'}}}} delete: operationId: DeleteField responses: {'204': {description: Deleted}} description: 'Delete Person Field' tags: [PersonFields] security: [{oauth2: ['personFields:write']}] parameters: [{in: path, name: fieldName, required: true, schema: {type: string}}] /segments: get: operationId: GetSegments responses: {'200': {description: Ok, content: {application/json: {schema: {properties: {segments: {items: {$ref: '#/components/schemas/Segment'}, type: array}}, required: [segments], type: object}}}}} description: 'Get all dynamic Segments in your account.' tags: [Segments] security: [{oauth2: ['people:read']}] parameters: [] post: operationId: CreateSegment responses: {'200': {description: Ok, content: {application/json: {schema: {properties: {segment: {$ref: '#/components/schemas/Segment'}}, required: [segment], type: object}}}}} description: 'Create a dynamic segment.' tags: [Segments] security: [{oauth2: ['people:write']}] parameters: [] requestBody: {required: true, content: {application/json: {schema: {$ref: '#/components/schemas/SegmentCreatable'}}}} '/segments/{segmentId}/people': get: operationId: GetPeopleInSegment responses: {'200': {description: Ok, content: {application/json: {schema: {properties: {people: {items: {$ref: '#/components/schemas/EndUser'}, type: array}}, required: [people], type: object}}}}} description: 'Get people in Segment.' tags: [Segments] security: [{oauth2: ['people:read']}] parameters: [{description: 'Id of the segment.', in: path, name: segmentId, required: true, schema: {format: double, type: number}}, {description: 'Number of people to retrieve.', in: query, name: limit, required: false, schema: {default: 100, format: double, type: number}}, {description: 'Number of records to skip', in: query, name: offset, required: false, schema: {default: 0, format: double, type: number}}, {description: 'Person Fields to retrieve. See [Person Fields](#tag/PersonFields) for possible field names.', in: query, name: attributes, required: false, schema: {type: array, items: {type: string}}}, {in: query, name: sort, required: false, schema: {type: string}}, {in: query, name: order, required: false, schema: {type: string, enum: [asc, desc]}}, {in: query, name: ignoreAnonymous, required: false, schema: {type: boolean}}] '/segments/{id}': patch: operationId: ModifySegment responses: {'200': {description: Ok, content: {application/json: {schema: {properties: {segment: {$ref: '#/components/schemas/Segment'}}, required: [segment], type: object}}}}} description: 'Modify a dynamic segment.' tags: [Segments] security: [{oauth2: ['people:write']}] parameters: [{in: path, name: id, required: true, schema: {format: double, type: number}}] requestBody: {required: true, content: {application/json: {schema: {$ref: '#/components/schemas/Partial_ISegment_'}}}} /tags: post: operationId: AddTag responses: {'201': {description: Created}} description: 'Add tag(s) to an existing user.' tags: [Tags] security: [{oauth2: ['people:write']}] parameters: [] requestBody: {required: true, content: {application/json: {schema: {allOf: [{properties: {tag: {type: string, description: "Tag(s) to add.\n\nTo add multiple tags, use a comma-separated list - \"tag1,tag2\""}}, required: [tag], type: object}, {$ref: '#/components/schemas/EndUserIdentifiers'}]}}}} delete: operationId: RemoveTag responses: {'204': {description: Deleted}} description: 'Remove tag(s) from existing user.' tags: [Tags] security: [{oauth2: ['people:write']}] parameters: [] requestBody: {required: true, content: {application/json: {schema: {allOf: [{properties: {tag: {type: string, description: "Tag(s) to remove.\n\nTo remove multiple tags, use a comma-separated list - \"tag1,tag2\""}}, required: [tag], type: object}, {$ref: '#/components/schemas/EndUserIdentifiers'}]}}}} /tags-management: get: operationId: GetAccountTags responses: {'200': {description: Ok, content: {application/json: {schema: {properties: {tags: {items: {$ref: '#/components/schemas/Tag'}, type: array}}, required: [tags], type: object}}}}} description: 'Get all tags.' tags: [Tags-Management] security: [{oauth2: []}] parameters: [] post: operationId: CreateAccountTags responses: {'200': {description: Ok, content: {application/json: {schema: {properties: {tags: {items: {$ref: '#/components/schemas/Tag'}, type: array}}, required: [tags], type: object}}}}} description: 'Create new tags.' tags: [Tags-Management] security: [{oauth2: []}] parameters: [] requestBody: {required: true, content: {application/json: {schema: {properties: {tags: {items: {$ref: '#/components/schemas/Tag'}, type: array, description: 'Tag(s) to add.'}}, required: [tags], type: object}}}} /tags-management/counts: get: operationId: GetTagCounts responses: {'200': {description: Ok, content: {application/json: {schema: {properties: {tagCounts: {items: {properties: {count: {type: number, format: double}, tag: {type: string}}, required: [count, tag], type: object}, type: array}}, required: [tagCounts], type: object}}}}} description: 'Get all tags (with count of people tagged).' tags: [Tags-Management] security: [{oauth2: []}] parameters: [] '/tags-management/{tag}': patch: operationId: UpdateAccountTag responses: {'200': {description: Ok, content: {application/json: {schema: {properties: {tag: {$ref: '#/components/schemas/Tag'}}, required: [tag], type: object}}}}} description: 'Update tag. If changing the name of the tag, it will be updated across all flows, segments and people.' tags: [Tags-Management] security: [{oauth2: ['account:write']}] parameters: [{in: path, name: tag, required: true, schema: {type: string}}] requestBody: {description: 'Update existing tag', required: true, content: {application/json: {schema: {$ref: '#/components/schemas/Tag', description: 'Update existing tag'}}}} delete: operationId: DeleteAccountTag responses: {'204': {description: Deleted}} description: 'Delete tag from current account. Deleting a tag removes it from all people in the account.' tags: [Tags-Management] security: [{oauth2: ['account:write']}] parameters: [{in: path, name: tag, required: true, schema: {type: string}}] /people/all: get: operationId: GetAllPeople responses: {'200': {description: Ok, content: {application/json: {schema: {properties: {people: {items: {$ref: '#/components/schemas/EndUser'}, type: array}}, required: [people], type: object}}}}} description: 'Get all people in the account.' tags: [People] security: [{oauth2: ['people:read']}] parameters: [{description: 'Number of people to retrieve.', in: query, name: limit, required: false, schema: {default: 100, format: double, type: number}}, {description: 'Number of records to skip', in: query, name: offset, required: false, schema: {default: 0, format: double, type: number}}, {description: 'Person Fields to retrieve. See [Person Fields](#tag/PersonFields) for possible field names.', in: query, name: attributes, required: false, schema: {type: array, items: {type: string}}}, {in: query, name: sort, required: false, schema: {type: string}}, {in: query, name: order, required: false, schema: {type: string, enum: [asc, desc]}}, {in: query, name: ignoreAnonymous, required: false, schema: {type: boolean}}] /people/unsubscribe: post: operationId: UnsubscribePerson responses: {'204': {description: 'No content'}} description: 'Unsubscribe a person to prevent them from receiving any more email.' summary: 'Unsubscribe a Person' tags: [People] security: [{oauth2: ['people:write']}] parameters: [{description: "Email of the person to unsubscribe.\n\nAt least one of id/userId/email must be specified.", in: query, name: email, required: false, schema: {type: string}}, {description: "userId of the person to unsubscribe.\n\nAt least one of id/userId/email must be specified.", in: query, name: userId, required: false, schema: {type: string}}, {description: "Encharge ID of the person to unsubscribe.\n\nAt least one of id/userId/email must be specified.", in: query, name: id, required: false, schema: {type: string}}] servers: - url: 'https://api.encharge.io/v1'