{ "openapi": "3.0.0", "info": { "title": "Core Resources", "description": "This category describes endpoints related to your Kustomer CRM data. This includes standard objects (like Companies, Customers, Conversations, Message and Custom Objects), custom attributes, tracking events, and more.\n\nFor more information on the object model, see [Data Model Overview](https://support.kustomer.com/data-model-overview-SyIS1S3zM) in the Kustomer Help Center.\n\n#### NOTE\n>If your Kustomer organization is using sensitive attributes, values for sensitive attributes may be masked in API responses for standard objects if the API token making the request does not have Read Sensitive permissions for the sensitive attributes.\nFor more information on sensitive attributes and masking, see [Data Masking](https://help.kustomer.com/en_us/data-masking-admin-overview-S1ezaXhgc) in the Kustomer Help Center.", "contact": { "name": "Kustomer API", "url": "https://developer.kustomer.com/kustomer-api-docs", "email": "support@kustomer.com" }, "version": "1.0" }, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ], "paths": { "/audit-logs": { "get": { "security": [ { "httpBearer": [] } ], "tags": [ "Audit Logs" ], "summary": "Query events associated with your organization", "description": "|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.audit_logs.read|org.permission.audit_logs.read|\n--------", "operationId": "GetAuditLogs", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "eventName": { "type": "string" }, "eventVerb": { "type": "string" }, "org": { "type": "string" }, "userId": { "type": "string" }, "userType": { "type": "string" }, "objectId": { "type": "string" }, "objectType": { "type": "string" }, "client": { "type": "string" }, "ip": { "type": "string" }, "changes": { "type": "object", "properties": { "attributes": { "type": "object" }, "relationships": { "type": "object" } } }, "createdAt": { "type": "string" }, "publishedAt": { "type": "string" }, "expiresAt": { "type": "string" } }, "required": [ "org", "eventName", "eventVerb" ] }, "relationships": { "type": "object", "properties": { "user": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "user" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" }, "first": { "type": "string" }, "previous": { "type": "string" }, "next": { "type": "string" } }, "required": [ "self", "first", "previous", "next" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "meta": { "count": 1, "total": 3000, "cursorCount": 3000 }, "links": { "self": "/v1/audit-logs?count=1", "first": "/v1/audit-logs?count=1", "prev": "/v1/audit-logs?count=1&after=62799c44a96e7f160834199c", "next": "/v1/audit-logs?count=1&before=62799c44a96e7f160834199c" }, "data": [ { "type": "audit_log", "id": "62799c44a96e7f160834199c", "attributes": { "eventName": "kustomer.conversation.update", "eventVerb": "update", "org": "59775dcda751900011ff4687", "userId": null, "userType": "system", "objectId": "5faaf4a6ea0cb48cd0801bbf", "objectType": "conversation", "client": "routing-api", "ip": null, "changes": { "attributes": { "assignedUsers": { "op": "replace", "before": [], "after": [ "5cb5e5a780b7e30014e4b6c3" ] } }, "relationships": { "company": { "op": "replace", "before": "6195640664b2fbb9eddc1e9b", "after": "627aa25d0a0e2a1ff95268b0" } } }, "createdAt": "2016-12-09T22:57:01.074Z", "publishedAt": "2016-12-09T22:57:08.387Z", "expiresAt": "2017-12-07T22:57:10.074Z" }, "relationships": { "customer": { "links": { "self": "/v1/customers/5f8efdd5d3de932f344ca367" }, "data": { "type": "customer", "id": "5f8efdd5d3de932f344ca367" } }, "user": { "links": { "self": "/v1/users/null" }, "data": { "type": "user", "id": null } } } } ] } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] }, "parameters": [ { "name": "count", "required": false, "schema": { "type": "string", "example": 100 }, "in": "query", "description": "Limits the number audit-log documents to be returned. Default 100, maximum 1000." }, { "name": "after", "required": false, "schema": { "type": "string", "example": "12398b37f821774356daa2a5" }, "in": "query", "description": "Paginates by the ID of the audit-log which marks the end of the pagination range. Requires \"before\"." }, { "name": "before", "required": false, "schema": { "type": "string", "example": "45698b37f821774356dcc2g1" }, "in": "query", "description": "Paginates by the ID of the audit-log which marks the beginning of the pagination range. Requires \"after\"." }, { "name": "filter[objectType]", "required": false, "schema": { "type": "string", "enum": [ "bill_subscription", "business_rule", "company", "conversation", "customer", "message", "search", "shortcut", "user", "work_item", "ip_rule", "work_session", "shopify_rest" ] }, "in": "query", "description": "Filters by the type of database object the event relates to." }, { "name": "filter[objectId]", "required": false, "schema": { "type": "string", "example": "45698b37f821774356dcc2g1" }, "in": "query", "description": "Filters by the id of database object the event relates to. Requires `filter[objectType]`." }, { "name": "filter[userId]", "required": false, "schema": { "type": "string", "example": "45698b37f821774356dcc2g1" }, "in": "query", "description": "Filters by the ID of the user the event relates to." }, { "name": "filter[include]", "required": false, "schema": { "type": "string", "example": "user,shortcut,work_item,ip_rule" }, "in": "query", "description": "Adds additional OR query logic to include results for additional objectTypes. For available objectTypes to use in this query param, see the enum in the `filter[objectType]` field." }, { "name": "filter[start]", "required": false, "schema": { "type": "string", "example": "2016-08-06T19:47:49.235Z" }, "in": "query", "description": "Filter by the date range start." }, { "name": "filter[end]", "required": false, "schema": { "type": "string", "example": "2016-09-06T19:47:49.235Z" }, "in": "query", "description": "Filter by the date range end." } ] }, "/attachments": { "post": { "security": [ { "httpBearer": [] } ], "tags": [ "Attachments" ], "summary": "Create attachment", "description": "Creates a new attachment document. Includes a temporary upload policy for uploading the file with a POST request.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.note.write|org.permission.note.create|\n|org.user.message.write|org.permission.message.create|\n\n### Uploading attachments\nYou can upload attachments by sending a multi-part POST request to the URL found in the response object's `meta.upload.url` property.\n\nThe request must be accompanied by the key/value pairs found in `meta.upload.fields` as standard form keys. The file should be included as the last key under the name \"file\".", "operationId": "CreateAttachment", "parameters": [], "requestBody": { "description": "", "content": { "application/json": { "schema": { "type": "object", "title": "Attachment Create", "description": "Schema for attachment creation operations", "additionalProperties": false, "properties": { "name": { "type": "string", "minLength": 1 }, "contentType": { "type": "string", "minLength": 1 }, "contentLength": { "type": "number" }, "": { "type": "string" } }, "required": [ "name", "contentType", "contentLength" ] } } } }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string" }, "attributes": { "type": "object", "properties": { "name": { "type": "string" }, "contentType": { "type": "string" }, "contentLength": { "type": "integer" }, "uploaded": { "type": "boolean" }, "redacted": { "type": "boolean" } }, "required": [ "name", "contentType", "contentLength", "uploaded", "redacted" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string" } }, "required": [ "id", "type" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "data", "links" ] } }, "required": [ "org" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" }, "related": { "type": "string" } }, "required": [ "self", "related" ] } }, "required": [ "id", "type", "attributes", "relationships", "links" ] }, "meta": { "type": "object", "properties": { "upload": { "type": "object", "properties": { "url": { "type": "string" }, "fields": { "type": "object", "properties": { "key": { "type": "string" }, "acl": { "type": "string" }, "Content-Type": { "type": "string" }, "X-Amz-Meta-Attachment-Id": { "type": "string" }, "bucket": { "type": "string" }, "X-Amz-Algorithm": { "type": "string" }, "X-Amz-Credential": { "type": "string" }, "X-Amz-Date": { "type": "string" }, "Policy": { "type": "string" }, "X-Amz-Signature": { "type": "string" } }, "required": [ "key", "acl", "Content-Type", "X-Amz-Meta-Attachment-Id", "bucket", "X-Amz-Algorithm", "X-Amz-Credential", "X-Amz-Date", "Policy", "X-Amz-Signature" ] } }, "required": [ "url", "fields" ] } }, "required": [ "upload" ] } }, "required": [ "data", "meta" ], "title": "" }, "example": { "data": { "id": "5a4d1a8a6d92880012ad2923", "type": "attachment", "attributes": { "name": "myattachment.jpg", "contentType": "image/jpeg", "contentLength": 512, "uploaded": false, "redacted": false }, "relationships": { "org": { "data": { "id": "56b0cd58baccb23e00c847cf", "type": "org" }, "links": { "self": "/v1/orgs/56b0cd58baccb23e00c847cf" } } }, "links": { "self": "/v1/attachments/5a4d1a8a6d92880012ad2923", "related": "http://www.cool.com" } }, "meta": { "upload": { "url": "https://attachment.signedurl.com/", "fields": { "key": "attachments/56b0cd58baccb23e00c847cf/5a4d1a8a6d92880012ad2923-myattachment.jpg", "acl": "private", "Content-Type": "image/jpeg", "X-Amz-Meta-Attachment-Id": "5a4d1a8a6d92880012ad2923", "bucket": "aws-bucket", "X-Amz-Algorithm": "aws-algorithm", "X-Amz-Credential": "aws-temp-key", "X-Amz-Date": "20180103T180146Z", "Policy": "aws-temp-policy-jwt", "X-Amz-Signature": "aws-temp-signature-value" } } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] } }, "/attachments/{id}": { "put": { "security": [ { "httpBearer": [] } ], "tags": [ "Attachments" ], "summary": "Update or upsert attachment", "description": "Updates the requested attachment. Upserts the attachment if an attachment does not exist.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.admin.message.write|org.permission.message.update|", "operationId": "UpsertAttachment", "parameters": [ { "name": "id", "in": "path", "description": "ID of attachment to update.", "required": true, "style": "simple", "schema": { "type": "string", "example": "5a4d1a8a6d92880012ad2923" } } ], "requestBody": { "description": "Updates requested attachment. Upserts if attachment does not exist.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.admin.message.write|org.permission.message.update|", "content": { "application/json": { "schema": { "type": "object", "title": "Attachment Update", "description": "Schema for attachment update operations", "properties": { "name": { "type": "string" }, "redacted": { "type": "boolean" }, "contentType": { "type": "string" }, "contentLength": { "type": "number" } }, "additionalProperties": false } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string" }, "attributes": { "type": "object", "properties": { "name": { "type": "string" }, "contentType": { "type": "string" }, "contentLength": { "type": "integer" }, "uploaded": { "type": "boolean" }, "redacted": { "type": "boolean" } }, "required": [ "name", "contentType", "contentLength", "uploaded", "redacted" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string" } }, "required": [ "id", "type" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "data", "links" ] } }, "required": [ "org" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" }, "related": { "type": "string" } }, "required": [ "self", "related" ] } }, "required": [ "id", "type", "attributes", "relationships", "links" ] }, "meta": { "type": "object", "properties": { "upload": { "type": "object", "properties": { "url": { "type": "string" }, "fields": { "type": "object", "properties": { "key": { "type": "string" }, "acl": { "type": "string" }, "Content-Type": { "type": "string" }, "X-Amz-Meta-Attachment-Id": { "type": "string" }, "bucket": { "type": "string" }, "X-Amz-Algorithm": { "type": "string" }, "X-Amz-Credential": { "type": "string" }, "X-Amz-Date": { "type": "string" }, "Policy": { "type": "string" }, "X-Amz-Signature": { "type": "string" } }, "required": [ "key", "acl", "Content-Type", "X-Amz-Meta-Attachment-Id", "bucket", "X-Amz-Algorithm", "X-Amz-Credential", "X-Amz-Date", "Policy", "X-Amz-Signature" ] } }, "required": [ "url", "fields" ] } }, "required": [ "upload" ] } }, "required": [ "data", "meta" ] }, "example": { "data": { "id": "5a4d1a8a6d92880012ad2923", "type": "attachment", "attributes": { "name": "newname.jpg", "contentType": "image/jpeg", "contentLength": 512, "uploaded": false, "redacted": false }, "relationships": { "org": { "data": { "id": "56b0cd58baccb23e00c847cf", "type": "org" }, "links": { "self": "/v1/orgs/56b0cd58baccb23e00c847cf" } } }, "links": { "self": "/v1/attachments/5a4d1a8a6d92880012ad2923", "related": "http://www.cool.com" } }, "meta": { "upload": { "url": "https://attachment.signedurl.com/", "fields": { "key": "attachments/56b0cd58baccb23e00c847cf/5a4d1a8a6d92880012ad2923-myattachment.jpg", "acl": "private", "Content-Type": "image/jpeg", "X-Amz-Meta-Attachment-Id": "5a4d1a8a6d92880012ad2923", "bucket": "aws-bucket", "X-Amz-Algorithm": "aws-algorithm", "X-Amz-Credential": "aws-temp-key", "X-Amz-Date": "20180103T180146Z", "Policy": "aws-temp-policy-jwt", "X-Amz-Signature": "aws-temp-signature-value" } } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] }, "get": { "security": [ { "httpBearer": [] } ], "tags": [ "Attachments" ], "summary": "Get attachments by ID [Outbound Only]", "description": "Retrieves attachments using the unique ID of the attachment or an array of unique attachment IDs, if given.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.attachment.read|org.permission.attachment.read|", "operationId": "GetAttachmentsById", "parameters": [ { "name": "id", "in": "path", "description": "ID of attachment to retrieve.\n#### NOTE\n>You can provide a comma-delimited list of IDs to receive an array of attchments matching those IDs.", "required": true, "style": "simple", "schema": { "type": "string", "example": "5a4d1a8a6d92880012ad2923" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string" }, "attributes": { "type": "object", "properties": { "name": { "type": "string" }, "contentType": { "type": "string" }, "contentLength": { "type": "integer" }, "uploaded": { "type": "boolean" }, "redacted": { "type": "boolean" } }, "required": [ "name", "contentType", "contentLength", "uploaded", "redacted" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string" } }, "required": [ "id", "type" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "data", "links" ] } }, "required": [ "org" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" }, "related": { "type": "string" } }, "required": [ "self", "related" ] } }, "required": [ "id", "type", "attributes", "relationships", "links" ] }, "meta": { "type": "object", "properties": { "upload": { "type": "object", "properties": { "url": { "type": "string" }, "fields": { "type": "object", "properties": { "key": { "type": "string" }, "acl": { "type": "string" }, "Content-Type": { "type": "string" }, "X-Amz-Meta-Attachment-Id": { "type": "string" }, "bucket": { "type": "string" }, "X-Amz-Algorithm": { "type": "string" }, "X-Amz-Credential": { "type": "string" }, "X-Amz-Date": { "type": "string" }, "Policy": { "type": "string" }, "X-Amz-Signature": { "type": "string" } }, "required": [ "key", "acl", "Content-Type", "X-Amz-Meta-Attachment-Id", "bucket", "X-Amz-Algorithm", "X-Amz-Credential", "X-Amz-Date", "Policy", "X-Amz-Signature" ] } }, "required": [ "url", "fields" ] } }, "required": [ "upload" ] } }, "required": [ "data", "meta" ] }, "example": { "data": { "id": "5a4d1a8a6d92880012ad2923", "type": "attachment", "attributes": { "name": "myattachment.jpg", "contentType": "image/jpeg", "contentLength": 512, "uploaded": false, "redacted": false }, "relationships": { "org": { "data": { "id": "56b0cd58baccb23e00c847cf", "type": "org" }, "links": { "self": "/v1/orgs/56b0cd58baccb23e00c847cf" } } }, "links": { "self": "/v1/attachments/5a4d1a8a6d92880012ad2923", "related": "http://www.cool.com" } }, "meta": { "upload": { "url": "https://attachment.signedurl.com/", "fields": { "key": "attachments/56b0cd58baccb23e00c847cf/5a4d1a8a6d92880012ad2923-myattachment.jpg", "acl": "private", "Content-Type": "image/jpeg", "X-Amz-Meta-Attachment-Id": "5a4d1a8a6d92880012ad2923", "bucket": "aws-bucket", "X-Amz-Algorithm": "aws-algorithm", "X-Amz-Credential": "aws-temp-key", "X-Amz-Date": "20180103T180146Z", "Policy": "aws-temp-policy-jwt", "X-Amz-Signature": "aws-temp-signature-value" } } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] }, "parameters": [ { "schema": { "type": "string", "example": "5a4d1a8a6d92880012ad2923" }, "name": "id", "in": "path", "description": "ID of attachment to retrieve.", "required": true } ] }, "/messages/{message_id}/attachments/{id}": { "get": { "security": [ { "httpBearer": [] } ], "tags": [ "Attachments", "Messages" ], "summary": "Get attachment by message ID and attachment ID (inbound or outbound)", "description": "Retrieves attachments based on the unique ID of the attachment for a specific message ID.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.attachment.read|org.permission.attachment.read|", "operationId": "GetAttachmentByMessageAndAttachmentId", "parameters": [ { "name": "message_id", "in": "path", "description": "ID of message with attachment", "required": true, "style": "simple", "schema": { "type": "string", "example": "5e0e14a7af4e8c001a084dba" } }, { "name": "id", "in": "path", "description": "ID of attachment to retrieve", "required": true, "style": "simple", "schema": { "type": "string", "example": "5e0e14c103a4e80018b374aa" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string" }, "attributes": { "type": "object", "properties": { "name": { "type": "string" }, "contentType": { "type": "string" }, "contentLength": { "type": "integer" }, "redacted": { "type": "boolean" } }, "required": [ "name", "contentType", "contentLength", "redacted" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "message": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "message" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" }, "related": { "type": "string" } }, "required": [ "self", "related" ] } }, "required": [ "id", "type", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "id": "5e0e14c103a4e80018b374aa", "type": "attachment", "attributes": { "name": "example.jpg", "contentType": "image/jpeg", "contentLength": 98153, "redacted": false }, "relationships": { "org": { "links": { "self": "/v1/orgs/5d5dae1ccd1e87001a6a7ea4" }, "data": { "type": "org", "id": "5d5dae1ccd1e87001a6a7ea4" } }, "message": { "links": { "self": "/v1/messages/5e0e14a7af4e8c001a084dba" }, "data": { "type": "message", "id": "5e0e14a7af4e8c001a084dba" } } }, "links": { "self": "/v1/messages/5e0e14a7af4e8c001a084dba/attachments/5e0e14c103a4e80018b374aa", "related": "https://kustomer-prod1-attachments.s3.amazonaws.com/attachments/5d5dae1ccd1e87001a6a7ea4/5e0e14c103a4e80018b374aa-nasdaq.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=credential-example%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20200102T161544Z&X-Amz-Expires=600&X-Amz-Security-Token=securitytoken=attachment" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] } }, "/brands": { "get": { "security": [ { "httpBearer": [] } ], "tags": [ "Brands" ], "summary": "Get brands", "description": "Retrieves a paginated list of all brands belonging to your organization.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.admin.brand.read|org.permission.brand.read|\n|org.user.brand.read|", "operationId": "GetBrands", "parameters": [ { "name": "page", "in": "query", "schema": { "type": "number", "default": 1, "example": 1 }, "description": "Number of pages to return for results. Default value: 1." }, { "name": "pageSize", "in": "query", "required": false, "schema": { "type": "number", "default": 100, "example": 100 }, "description": "Number of results to return per page. Default value: 100." } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "meta": { "type": "object", "properties": { "pageSize": { "type": "integer" }, "page": { "type": "integer" } }, "required": [ "pageSize", "page" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" }, "first": { "type": "string" }, "prev": { "type": "string", "nullable": true }, "next": { "type": "string", "nullable": true } }, "required": [ "self", "first", "prev", "next" ] }, "data": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "name": { "type": "string" }, "default": { "type": "boolean" }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "modifiedAt": { "type": "string" } }, "required": [ "name", "default", "createdAt", "updatedAt" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "createdBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "modifiedBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } } }, "required": [ "meta", "links", "data" ] }, "example": { "meta": { "pageSize": 100, "page": 1 }, "links": { "self": "/v1/brands?page=1&pageSize=100", "first": "/v1/brands?page=1&pageSize=100", "prev": null, "next": null }, "data": [ { "type": "brand", "id": "5daf7921124be4f2960cb196", "attributes": { "name": "default", "default": true, "createdAt": "2019-10-22T21:48:17.993Z", "updatedAt": "2019-10-22T21:48:17.993Z" }, "relationships": { "org": { "links": { "self": "/v1/orgs/5d5dae1ccd1e87001a6a7ea4" }, "data": { "type": "org", "id": "5d5dae1ccd1e87001a6a7ea4" } } }, "links": { "self": "/v1/brands/5daf7921124be4f2960cb196" } }, { "type": "brand", "id": "5dce2a9500520400149dc607", "attributes": { "name": "Sub brand", "default": false, "createdAt": "2019-11-15T04:33:25.167Z", "updatedAt": "2019-11-15T04:33:25.167Z", "modifiedAt": "2019-11-15T04:33:25.167Z" }, "relationships": { "org": { "links": { "self": "/v1/orgs/5d5dae1ccd1e87001a6a7ea4" }, "data": { "type": "org", "id": "5d5dae1ccd1e87001a6a7ea4" } }, "createdBy": { "links": { "self": "/v1/users/5d5dae1d731d4e001ad55054" }, "data": { "type": "user", "id": "5d5dae1d731d4e001ad55054" } }, "modifiedBy": { "links": { "self": "/v1/users/5d5dae1d731d4e001ad55054" }, "data": { "type": "user", "id": "5d5dae1d731d4e001ad55054" } } }, "links": { "self": "/v1/brands/5dce2a9500520400149dc607" } } ] } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] }, "post": { "security": [ { "httpBearer": [] } ], "tags": [ "Brands" ], "summary": "Create brand", "description": "Creates a brand resource.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.admin.brand.write|org.permission.brand.create|", "operationId": "CreateBrand", "parameters": [], "requestBody": { "description": "", "content": { "application/json": { "schema": { "description": "", "type": "object", "x-examples": { "example-1": { "name": "Kustom Socks", "iconUrl": "https://s29093.pcdn.co/wp-content/uploads/2019/12/Kustomer_Logo-2.svg" } }, "properties": { "name": { "type": "string", "minLength": 1, "example": "Kustom Socks", "description": "Brand name" }, "iconUrl": { "type": "string", "minLength": 1, "example": "https://s29093.pcdn.co/wp-content/uploads/2019/12/Kustomer_Logo-2.svg", "description": "Brand icon URL" } }, "required": [ "name", "iconUrl" ] } } } }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "name": { "type": "string" }, "iconUrl": { "type": "string" }, "default": { "type": "boolean" }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "modifiedAt": { "type": "string" } }, "required": [ "name", "iconUrl", "default", "createdAt", "updatedAt", "modifiedAt" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "createdBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "modifiedBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "createdBy", "modifiedBy" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "brand", "id": "5e0f779ed95b430019b57715", "attributes": { "name": "Kustom Socks", "iconUrl": "https://s29093.pcdn.co/wp-content/uploads/2019/12/Kustomer_Logo-2.svg", "default": false, "createdAt": "2020-01-03T17:19:26.498Z", "updatedAt": "2020-01-03T17:19:26.498Z", "modifiedAt": "2020-01-03T17:19:26.498Z" }, "relationships": { "org": { "links": { "self": "/v1/orgs/5d5dae1ccd1e87001a6a7ea4" }, "data": { "type": "org", "id": "5d5dae1ccd1e87001a6a7ea4" } }, "createdBy": { "links": { "self": "/v1/users/5e0e15a9b2d734001913256c" }, "data": { "type": "user", "id": "5e0e15a9b2d734001913256c" } }, "modifiedBy": { "links": { "self": "/v1/users/5e0e15a9b2d734001913256c" }, "data": { "type": "user", "id": "5e0e15a9b2d734001913256c" } } }, "links": { "self": "/v1/brands/5e0f779ed95b430019b57715" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] } }, "/brands/default": { "get": { "security": [ { "httpBearer": [] } ], "tags": [ "Brands" ], "summary": "Get default brand", "description": "Retrieves the default brand that was created for your Kustomer organization during registration.\n\nLearn more about the default brand in the [Kustomer Help Center](https://help.kustomer.com/create-and-manage-multiple-brands-ryc8HBZnD#customize).\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.admin.brand.read|org.permission.brand.read|\n|org.user.brand.read|", "operationId": "GetDefaultBrand", "parameters": [], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "name": { "type": "string" }, "default": { "type": "boolean" }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" } }, "required": [ "name", "default", "createdAt", "updatedAt" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "brand", "id": "5daf7921124be4f2960cb196", "attributes": { "name": "default", "default": true, "createdAt": "2019-10-22T21:48:17.993Z", "updatedAt": "2019-10-22T21:48:17.993Z" }, "relationships": { "org": { "links": { "self": "/v1/orgs/5d5dae1ccd1e87001a6a7ea4" }, "data": { "type": "org", "id": "5d5dae1ccd1e87001a6a7ea4" } } }, "links": { "self": "/v1/brands/5daf7921124be4f2960cb196" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] } }, "/brands/{id}": { "get": { "security": [ { "httpBearer": [] } ], "tags": [ "Brands" ], "summary": "Get brand by ID", "description": "Retrieves a brand by its unique ID.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.admin.brand.read|org.permission.brand.read|\n|org.user.brand.read|", "operationId": "GetBrandById", "parameters": [ { "name": "id", "in": "path", "description": "Brand ID", "required": true, "style": "simple", "schema": { "type": "string", "example": "5dce2a9500520400149dc607" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "name": { "type": "string" }, "default": { "type": "boolean" }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "modifiedAt": { "type": "string" } }, "required": [ "name", "default", "createdAt", "updatedAt", "modifiedAt" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "createdBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "modifiedBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "createdBy", "modifiedBy" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "brand", "id": "5dce2a9500520400149dc607", "attributes": { "name": "My sub brand", "default": false, "createdAt": "2019-11-15T04:33:25.167Z", "updatedAt": "2019-11-15T04:33:25.167Z", "modifiedAt": "2019-11-15T04:33:25.167Z" }, "relationships": { "org": { "links": { "self": "/v1/orgs/5d5dae1ccd1e87001a6a7ea4" }, "data": { "type": "org", "id": "5d5dae1ccd1e87001a6a7ea4" } }, "createdBy": { "links": { "self": "/v1/users/5d5dae1d731d4e001ad55054" }, "data": { "type": "user", "id": "5d5dae1d731d4e001ad55054" } }, "modifiedBy": { "links": { "self": "/v1/users/5d5dae1d731d4e001ad55054" }, "data": { "type": "user", "id": "5d5dae1d731d4e001ad55054" } } }, "links": { "self": "/v1/brands/5dce2a9500520400149dc607" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] }, "patch": { "security": [ { "httpBearer": [] } ], "tags": [ "Brands" ], "summary": "Update brand", "description": "Updates a brand resource.\n\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.admin.brand.write|org.permission.brand.update|", "operationId": "PatchBrand", "parameters": [ { "name": "id", "in": "path", "description": "Brand ID", "required": true, "style": "simple", "schema": { "type": "string", "example": "5e0f779ed95b430019b57715" } } ], "requestBody": { "description": "", "content": { "application/json": { "schema": { "description": "", "type": "object", "x-examples": { "example-1": { "name": "Kustom Socks, VIP", "iconUrl": "https://s29093.pcdn.co/wp-content/uploads/2019/12/Kustomer_Logo-3.svg" } }, "properties": { "name": { "type": "string", "minLength": 1, "description": "Brand name", "example": "Kustom Socks, VIP" }, "iconUrl": { "type": "string", "minLength": 1, "description": "Brand icon URL", "example": "https://s29093.pcdn.co/wp-content/uploads/2019/12/Kustomer_Logo-3.svg" } }, "required": [ "name", "iconUrl" ] } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "name": { "type": "string" }, "iconUrl": { "type": "string" }, "default": { "type": "boolean" }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "modifiedAt": { "type": "string" } }, "required": [ "name", "iconUrl", "default", "createdAt", "updatedAt", "modifiedAt" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "createdBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "modifiedBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "createdBy", "modifiedBy" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "brand", "id": "5e0f779ed95b430019b57715", "attributes": { "name": "Kustom Socks, VIP", "iconUrl": "https://s29093.pcdn.co/wp-content/uploads/2019/12/Kustomer_Logo-3.svg", "default": false, "createdAt": "2020-01-03T17:19:26.498Z", "updatedAt": "2020-01-03T17:19:26.498Z", "modifiedAt": "2020-01-03T17:19:26.498Z" }, "relationships": { "org": { "links": { "self": "/v1/orgs/5d5dae1ccd1e87001a6a7ea4" }, "data": { "type": "org", "id": "5d5dae1ccd1e87001a6a7ea4" } }, "createdBy": { "links": { "self": "/v1/users/5e0e15a9b2d734001913256c" }, "data": { "type": "user", "id": "5e0e15a9b2d734001913256c" } }, "modifiedBy": { "links": { "self": "/v1/users/5e0e15a9b2d734001913256c" }, "data": { "type": "user", "id": "5e0e15a9b2d734001913256c" } } }, "links": { "self": "/v1/brands/5e0f779ed95b430019b57715" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] } }, "/schedules": { "get": { "security": [ { "httpBearer": [] } ], "tags": [ "Business Schedules" ], "summary": "Get all business schedules", "description": "Retrieves business schedules for a Kustomer organization.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.schedule.read|org.permission.schedule.read|\n|org.admin.schedule.read|\n\nTo learn more, see [Business Schedules](https://help.kustomer.com/business-schedules-SJj3ZxD1E) in the Kustomer Help Center.", "operationId": "GetAllSchedules", "parameters": [ { "name": "page", "in": "query", "schema": { "type": "number", "default": 1, "example": 1 }, "description": "Number of pages to return for results. Default value: 1." }, { "name": "pageSize", "in": "query", "required": false, "schema": { "type": "number", "default": 100, "example": 100 }, "description": "Number of results to return per page. Default value: 100." } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "meta": { "type": "object", "properties": { "pageSize": { "type": "integer" }, "page": { "type": "integer" } }, "required": [ "pageSize", "page" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" }, "first": { "type": "string" }, "prev": { "type": "string", "nullable": true }, "next": { "type": "string", "nullable": true } }, "required": [ "self", "first", "prev", "next" ] }, "data": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "name": { "type": "string" }, "hours": { "type": "object", "properties": { "0": { "type": "string", "nullable": true }, "1": { "type": "array", "items": { "type": "array", "items": { "type": "integer" } } }, "2": { "type": "array", "items": { "type": "array", "items": { "type": "integer" } } }, "3": { "type": "array", "items": { "type": "array", "items": { "type": "integer" } } }, "4": { "type": "array", "items": { "type": "array", "items": { "type": "integer" } } }, "5": { "type": "array", "items": { "type": "array", "items": { "type": "integer" } } }, "6": { "type": "string", "nullable": true } }, "required": [ "0", "1", "2", "3", "4", "5", "6" ] }, "timezone": { "type": "string" }, "default": { "type": "boolean" }, "createdAt": { "type": "string" }, "modifiedAt": { "type": "string" }, "updatedAt": { "type": "string" } }, "required": [ "name", "hours", "timezone", "default", "createdAt", "modifiedAt", "updatedAt" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "createdBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "modifiedBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "createdBy", "modifiedBy" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } } }, "required": [ "meta", "links", "data" ] }, "example": { "meta": { "pageSize": 100, "page": 1 }, "links": { "self": "/v1/schedules?page=1&pageSize=100", "first": "/v1/schedules?page=1&pageSize=100", "prev": null, "next": null }, "data": [ { "type": "schedule", "id": "5e21e0f9520ec30019df3dcf", "attributes": { "name": "Biz Hours", "hours": { "0": null, "1": [ [ 480, 1020 ] ], "2": [ [ 480, 1020 ] ], "3": [ [ 480, 1020 ] ], "4": [ [ 480, 1020 ] ], "5": [ [ 480, 1020 ] ], "6": null }, "timezone": "America/New_York", "default": false, "createdAt": "2020-01-17T16:29:45.369Z", "modifiedAt": "2020-01-17T16:30:06.141Z", "updatedAt": "2020-01-17T16:30:06.141Z" }, "relationships": { "org": { "links": { "self": "/v1/orgs/5e15fa33623f88001a8e0bb5" }, "data": { "type": "org", "id": "5e15fa33623f88001a8e0bb5" } }, "createdBy": { "links": { "self": "/v1/users/5e15fa45623f88001a8e0bbb" }, "data": { "type": "user", "id": "5e15fa45623f88001a8e0bbb" } }, "modifiedBy": { "links": { "self": "/v1/users/5e15fa45623f88001a8e0bbb" }, "data": { "type": "user", "id": "5e15fa45623f88001a8e0bbb" } } }, "links": { "self": "/v1/schedules/5e21e0f9520ec30019df3dcf" } } ] } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] }, "post": { "security": [ { "httpBearer": [] } ], "tags": [ "Business Schedules" ], "summary": "Create a business schedule", "description": "Creates a new business schedule.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.admin.schedule.write|org.permission.schedule.create|", "operationId": "CreateSchedule", "parameters": [], "requestBody": { "description": "### Hours\n\n`hours` is an object where the key is the day index and the value is an hour tuple.\n\n#### Day index\n\n* `0` is Sunday\n* `1` is Monday\n* `2` is Tuesday\n* `3` is Wednesday\n* `4` is Thursday\n* `5` is Friday\n* `6` is Saturday\n\n#### Hour tuple\n\nEach hour tuple is an array with 2 values that represent the time of day in minutes:\n\n* The first value is the start time (for example, `480` for 8:00 AM)\n* The second value is the end time (for example, `1020` for 5:00 PM)\n\nFor example, the hour tuple `[480, 1020]` represents 8:00 AM - 5:00 PM.", "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string", "maxLength": 256 }, "hours": { "type": "object", "properties": { "0": { "anyOf": [ { "type": "array", "items": { "type": "array", "items": { "type": "integer", "minimum": 0, "maximum": 1440 }, "minItems": 2, "maxItems": 2 }, "minItems": 1 } ], "nullable": true }, "1": { "anyOf": [ { "type": "array", "items": { "type": "array", "items": { "type": "integer", "minimum": 0, "maximum": 1440 }, "minItems": 2, "maxItems": 2 }, "minItems": 1 } ], "nullable": true }, "2": { "anyOf": [ { "type": "array", "items": { "type": "array", "items": { "type": "integer", "minimum": 0, "maximum": 1440 }, "minItems": 2, "maxItems": 2 }, "minItems": 1 } ], "nullable": true }, "3": { "anyOf": [ { "type": "array", "items": { "type": "array", "items": { "type": "integer", "minimum": 0, "maximum": 1440 }, "minItems": 2, "maxItems": 2 }, "minItems": 1 } ], "nullable": true }, "4": { "anyOf": [ { "type": "array", "items": { "type": "array", "items": { "type": "integer", "minimum": 0, "maximum": 1440 }, "minItems": 2, "maxItems": 2 }, "minItems": 1 } ], "nullable": true }, "5": { "anyOf": [ { "type": "array", "items": { "type": "array", "items": { "type": "integer", "minimum": 0, "maximum": 1440 }, "minItems": 2, "maxItems": 2 }, "minItems": 1 } ], "nullable": true }, "6": { "anyOf": [ { "type": "array", "items": { "type": "array", "items": { "type": "integer", "minimum": 0, "maximum": 1440 }, "minItems": 2, "maxItems": 2 }, "minItems": 1 } ], "nullable": true } }, "required": [ "0", "1", "2", "3", "4", "5", "6" ], "additionalProperties": false }, "timezone": { "type": "string" }, "default": { "type": "boolean" } }, "required": [ "name", "hours", "default", "timezone" ], "additionalProperties": false } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "name": { "type": "string" }, "hours": { "type": "object", "properties": { "0": { "type": "string", "nullable": true }, "1": { "type": "array", "items": { "type": "array", "items": { "type": "integer" } } }, "2": { "type": "array", "items": { "type": "array", "items": { "type": "integer" } } }, "3": { "type": "array", "items": { "type": "array", "items": { "type": "integer" } } }, "4": { "type": "array", "items": { "type": "array", "items": { "type": "integer" } } }, "5": { "type": "array", "items": { "type": "array", "items": { "type": "integer" } } }, "6": { "type": "string", "nullable": true } }, "required": [ "0", "1", "2", "3", "4", "5", "6" ] }, "timezone": { "type": "string" }, "default": { "type": "boolean" }, "createdAt": { "type": "string" }, "modifiedAt": { "type": "string" }, "updatedAt": { "type": "string" } }, "required": [ "name", "hours", "timezone", "default", "createdAt", "modifiedAt", "updatedAt" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "createdBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "modifiedBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "createdBy", "modifiedBy" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "schedule", "id": "5e2210548d9b6e0087fa67f1", "attributes": { "name": "Holiday Hours", "hours": { "0": null, "1": [ [ 480, 1020 ] ], "2": [ [ 480, 1020 ] ], "3": [ [ 480, 1020 ] ], "4": [ [ 480, 1020 ] ], "5": [ [ 480, 1020 ] ], "6": null }, "timezone": "America/New_York", "default": false, "createdAt": "2020-01-17T19:51:48.085Z", "modifiedAt": "2020-01-17T19:51:48.085Z", "updatedAt": "2020-01-17T19:51:48.085Z" }, "relationships": { "org": { "links": { "self": "/v1/orgs/5e15fa33623f88001a8e0bb5" }, "data": { "type": "org", "id": "5e15fa33623f88001a8e0bb5" } }, "createdBy": { "links": { "self": "/v1/users/5e15fa45623f88001a8e0bbb" }, "data": { "type": "user", "id": "5e15fa45623f88001a8e0bbb" } }, "modifiedBy": { "links": { "self": "/v1/users/5e15fa45623f88001a8e0bbb" }, "data": { "type": "user", "id": "5e15fa45623f88001a8e0bbb" } } }, "links": { "self": "/v1/schedules/5e2210548d9b6e0087fa67f1" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] } }, "/schedules/default": { "get": { "security": [ { "httpBearer": [] } ], "tags": [ "Business Schedules" ], "summary": "Get default business schedule", "description": "Retrieves default business schedules for a Kustomer organization.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.schedule.read|org.permission.schedule.read|\n|org.admin.schedule.read||", "operationId": "GetDefaultSchedule", "parameters": [ { "schema": { "type": "string", "example": "holidays" }, "in": "query", "name": "include", "description": "Option to include holidays. Accepted values: `holidays`." } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "name": { "type": "string" }, "hours": { "type": "object", "properties": { "0": { "type": "string", "nullable": true }, "1": { "type": "array", "items": { "type": "array", "items": { "type": "integer" } } }, "2": { "type": "array", "items": { "type": "array", "items": { "type": "integer" } } }, "3": { "type": "array", "items": { "type": "array", "items": { "type": "integer" } } }, "4": { "type": "array", "items": { "type": "array", "items": { "type": "integer" } } }, "5": { "type": "array", "items": { "type": "array", "items": { "type": "integer" } } }, "6": { "type": "string", "nullable": true } }, "required": [ "0", "1", "2", "3", "4", "5", "6" ] }, "timezone": { "type": "string" }, "default": { "type": "boolean" }, "createdAt": { "type": "string" }, "modifiedAt": { "type": "string" }, "updatedAt": { "type": "string" } }, "required": [ "name", "hours", "timezone", "default", "createdAt", "modifiedAt", "updatedAt" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "createdBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "modifiedBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "createdBy", "modifiedBy" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] }, "included": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "name": { "type": "string" }, "startDate": { "type": "string" }, "endDate": { "type": "string" }, "description": { "type": "string" }, "enabled": { "type": "boolean" }, "createdAt": { "type": "string" }, "modifiedAt": { "type": "string" }, "updatedAt": { "type": "string" } }, "required": [ "name", "startDate", "endDate", "description", "enabled", "createdAt", "modifiedAt", "updatedAt" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "createdBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "modifiedBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "schedule": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "data", "links" ] } }, "required": [ "org", "createdBy", "modifiedBy", "schedule" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } } }, "required": [ "data", "included" ] }, "example": { "data": { "type": "schedule", "id": "5e21e0f9520ec30019df3dcf", "attributes": { "name": "Biz Hours", "hours": { "0": null, "1": [ [ 480, 1020 ] ], "2": [ [ 480, 1020 ] ], "3": [ [ 480, 1020 ] ], "4": [ [ 480, 1020 ] ], "5": [ [ 480, 1020 ] ], "6": null }, "timezone": "America/New_York", "default": true, "createdAt": "2020-01-17T16:29:45.369Z", "modifiedAt": "2020-01-17T17:58:27.569Z", "updatedAt": "2020-01-17T17:58:27.569Z" }, "relationships": { "org": { "links": { "self": "/v1/orgs/5e15fa33623f88001a8e0bb5" }, "data": { "type": "org", "id": "5e15fa33623f88001a8e0bb5" } }, "createdBy": { "links": { "self": "/v1/users/5e15fa45623f88001a8e0bbb" }, "data": { "type": "user", "id": "5e15fa45623f88001a8e0bbb" } }, "modifiedBy": { "links": { "self": "/v1/users/5e15fa45623f88001a8e0bbb" }, "data": { "type": "user", "id": "5e15fa45623f88001a8e0bbb" } } }, "links": { "self": "/v1/schedules/5e21e0f9520ec30019df3dcf" } }, "included": [ { "type": "holiday", "id": "5e21f60193bd0a005118426f", "attributes": { "name": "Test", "startDate": "2020-03-12T04:00:00.000Z", "endDate": "2020-03-14T03:59:59.000Z", "description": "test holiday", "enabled": true, "createdAt": "2020-01-17T17:59:29.366Z", "modifiedAt": "2020-01-17T17:59:29.366Z", "updatedAt": "2020-01-17T17:59:29.366Z" }, "relationships": { "org": { "links": { "self": "/v1/orgs/5e15fa33623f88001a8e0bb5" }, "data": { "type": "org", "id": "5e15fa33623f88001a8e0bb5" } }, "createdBy": { "links": { "self": "/v1/users/5e15fa45623f88001a8e0bbb" }, "data": { "type": "user", "id": "5e15fa45623f88001a8e0bbb" } }, "modifiedBy": { "links": { "self": "/v1/users/5e15fa45623f88001a8e0bbb" }, "data": { "type": "user", "id": "5e15fa45623f88001a8e0bbb" } }, "schedule": { "data": { "type": "schedule", "id": "5e21e0f9520ec30019df3dcf" }, "links": { "self": "/v1/schedules/5e21e0f9520ec30019df3dcf" } } }, "links": { "self": "/v1/holidays/5e21f60193bd0a005118426f" } } ] } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] } }, "/schedules/{id}": { "get": { "security": [ { "httpBearer": [] } ], "tags": [ "Business Schedules" ], "summary": "Get business schedule by ID", "description": "Retrieves a business schedule by the schedule ID.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.schedule.read|org.permission.schedule.read|\n|org.admin.schedule.read||", "operationId": "GetScheduleById", "parameters": [ { "name": "id", "in": "path", "description": "Business Schedule ID", "required": true, "style": "simple", "schema": { "type": "string", "example": "5e21e0f9520ec30019df3dcf" } }, { "schema": { "type": "string", "example": "holidays" }, "in": "query", "name": "include", "description": "Option to include holidays. Accepted values: `holidays`." } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "name": { "type": "string" }, "hours": { "type": "object", "properties": { "0": { "type": "string", "nullable": true }, "1": { "type": "array", "items": { "type": "array", "items": { "type": "integer" } } }, "2": { "type": "array", "items": { "type": "array", "items": { "type": "integer" } } }, "3": { "type": "array", "items": { "type": "array", "items": { "type": "integer" } } }, "4": { "type": "array", "items": { "type": "array", "items": { "type": "integer" } } }, "5": { "type": "array", "items": { "type": "array", "items": { "type": "integer" } } }, "6": { "type": "string", "nullable": true } }, "required": [ "0", "1", "2", "3", "4", "5", "6" ] }, "timezone": { "type": "string" }, "default": { "type": "boolean" }, "createdAt": { "type": "string" }, "modifiedAt": { "type": "string" }, "updatedAt": { "type": "string" } }, "required": [ "name", "hours", "timezone", "default", "createdAt", "modifiedAt", "updatedAt" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "createdBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "modifiedBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "createdBy", "modifiedBy" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] }, "included": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "name": { "type": "string" }, "startDate": { "type": "string" }, "endDate": { "type": "string" }, "description": { "type": "string" }, "enabled": { "type": "boolean" }, "createdAt": { "type": "string" }, "modifiedAt": { "type": "string" }, "updatedAt": { "type": "string" } }, "required": [ "name", "startDate", "endDate", "description", "enabled", "createdAt", "modifiedAt", "updatedAt" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "createdBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "modifiedBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "schedule": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "data", "links" ] } }, "required": [ "org", "createdBy", "modifiedBy", "schedule" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } } }, "required": [ "data", "included" ] }, "example": { "data": { "type": "schedule", "id": "5e21e0f9520ec30019df3dcf", "attributes": { "name": "Biz Hours", "hours": { "0": null, "1": [ [ 480, 1020 ] ], "2": [ [ 480, 1020 ] ], "3": [ [ 480, 1020 ] ], "4": [ [ 480, 1020 ] ], "5": [ [ 480, 1020 ] ], "6": null }, "timezone": "America/New_York", "default": true, "createdAt": "2020-01-17T16:29:45.369Z", "modifiedAt": "2020-01-17T17:58:27.569Z", "updatedAt": "2020-01-17T17:58:27.569Z" }, "relationships": { "org": { "links": { "self": "/v1/orgs/5e15fa33623f88001a8e0bb5" }, "data": { "type": "org", "id": "5e15fa33623f88001a8e0bb5" } }, "createdBy": { "links": { "self": "/v1/users/5e15fa45623f88001a8e0bbb" }, "data": { "type": "user", "id": "5e15fa45623f88001a8e0bbb" } }, "modifiedBy": { "links": { "self": "/v1/users/5e15fa45623f88001a8e0bbb" }, "data": { "type": "user", "id": "5e15fa45623f88001a8e0bbb" } } }, "links": { "self": "/v1/schedules/5e21e0f9520ec30019df3dcf" } }, "included": [ { "type": "holiday", "id": "5e21f60193bd0a005118426f", "attributes": { "name": "Test", "startDate": "2020-03-12T04:00:00.000Z", "endDate": "2020-03-14T03:59:59.000Z", "description": "test holiday", "enabled": true, "createdAt": "2020-01-17T17:59:29.366Z", "modifiedAt": "2020-01-17T17:59:29.366Z", "updatedAt": "2020-01-17T17:59:29.366Z" }, "relationships": { "org": { "links": { "self": "/v1/orgs/5e15fa33623f88001a8e0bb5" }, "data": { "type": "org", "id": "5e15fa33623f88001a8e0bb5" } }, "createdBy": { "links": { "self": "/v1/users/5e15fa45623f88001a8e0bbb" }, "data": { "type": "user", "id": "5e15fa45623f88001a8e0bbb" } }, "modifiedBy": { "links": { "self": "/v1/users/5e15fa45623f88001a8e0bbb" }, "data": { "type": "user", "id": "5e15fa45623f88001a8e0bbb" } }, "schedule": { "data": { "type": "schedule", "id": "5e21e0f9520ec30019df3dcf" }, "links": { "self": "/v1/schedules/5e21e0f9520ec30019df3dcf" } } }, "links": { "self": "/v1/holidays/5e21f60193bd0a005118426f" } } ] } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] }, "put": { "security": [ { "httpBearer": [] } ], "tags": [ "Business Schedules" ], "summary": "Update business schedule by ID", "description": "Modifies a business schedule based on the schedule ID.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.admin.schedule.write|org.permission.schedule.update|", "operationId": "UpdateScheduleById", "parameters": [ { "name": "id", "in": "path", "description": "Business Schedule ID", "required": true, "style": "simple", "schema": { "type": "string", "example": "5e21e0f9520ec30019df3dcf" } } ], "requestBody": { "description": "### Hours\n\n`hours` is an object where the key is the day index and the value is an hour tuple.\n\n#### Day index\n\n* `0` is Sunday\n* `1` is Monday\n* `2` is Tuesday\n* `3` is Wednesday\n* `4` is Thursday\n* `5` is Friday\n* `6` is Saturday\n\n#### Hour tuple\n\nEach hour tuple is an array with 2 values that represent the time of day in minutes:\n\n* The first value is the start time (for example, `480` for 8:00 AM)\n* The second value is the end time (for example, `1020` for 5:00 PM)\n\nFor example, the hour tuple `[480, 1020]` represents 8:00 AM - 5:00 PM.", "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string", "maxLength": 256 }, "hours": { "type": "object", "properties": { "0": { "anyOf": [ { "type": "array", "items": { "type": "array", "items": { "type": "integer", "minimum": 0, "maximum": 1440 }, "minItems": 2, "maxItems": 2 }, "minItems": 1 } ], "nullable": true }, "1": { "anyOf": [ { "type": "array", "items": { "type": "array", "items": { "type": "integer", "minimum": 0, "maximum": 1440 }, "minItems": 2, "maxItems": 2 }, "minItems": 1 } ], "nullable": true }, "2": { "anyOf": [ { "type": "array", "items": { "type": "array", "items": { "type": "integer", "minimum": 0, "maximum": 1440 }, "minItems": 2, "maxItems": 2 }, "minItems": 1 } ], "nullable": true }, "3": { "anyOf": [ { "type": "array", "items": { "type": "array", "items": { "type": "integer", "minimum": 0, "maximum": 1440 }, "minItems": 2, "maxItems": 2 }, "minItems": 1 } ], "nullable": true }, "4": { "anyOf": [ { "type": "array", "items": { "type": "array", "items": { "type": "integer", "minimum": 0, "maximum": 1440 }, "minItems": 2, "maxItems": 2 }, "minItems": 1 } ], "nullable": true }, "5": { "anyOf": [ { "type": "array", "items": { "type": "array", "items": { "type": "integer", "minimum": 0, "maximum": 1440 }, "minItems": 2, "maxItems": 2 }, "minItems": 1 } ], "nullable": true }, "6": { "anyOf": [ { "type": "array", "items": { "type": "array", "items": { "type": "integer", "minimum": 0, "maximum": 1440 }, "minItems": 2, "maxItems": 2 }, "minItems": 1 } ], "nullable": true } }, "required": [ "0", "1", "2", "3", "4", "5", "6" ], "additionalProperties": false }, "timezone": { "type": "string" }, "default": { "type": "boolean" } }, "required": [ "name", "hours", "default", "timezone" ], "additionalProperties": false } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "name": { "type": "string" }, "hours": { "type": "object", "properties": { "0": { "type": "string", "nullable": true }, "1": { "type": "array", "items": { "type": "array", "items": { "type": "integer" } } }, "2": { "type": "array", "items": { "type": "array", "items": { "type": "integer" } } }, "3": { "type": "array", "items": { "type": "array", "items": { "type": "integer" } } }, "4": { "type": "array", "items": { "type": "array", "items": { "type": "integer" } } }, "5": { "type": "array", "items": { "type": "array", "items": { "type": "integer" } } }, "6": { "type": "string", "nullable": true } }, "required": [ "0", "1", "2", "3", "4", "5", "6" ] }, "timezone": { "type": "string" }, "default": { "type": "boolean" }, "createdAt": { "type": "string" }, "modifiedAt": { "type": "string" }, "updatedAt": { "type": "string" } }, "required": [ "name", "hours", "timezone", "default", "createdAt", "modifiedAt", "updatedAt" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "createdBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "modifiedBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "createdBy", "modifiedBy" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "schedule", "id": "5e21e0f9520ec30019df3dcf", "attributes": { "name": "Biz Hours", "hours": { "0": null, "1": [ [ 480, 965 ] ], "2": [ [ 480, 1020 ] ], "3": [ [ 480, 1020 ] ], "4": [ [ 480, 1020 ] ], "5": [ [ 480, 1020 ] ], "6": null }, "timezone": "America/New_York", "default": true, "createdAt": "2020-01-17T16:29:45.369Z", "modifiedAt": "2020-01-17T19:43:03.657Z", "updatedAt": "2020-01-17T19:43:03.657Z" }, "relationships": { "org": { "links": { "self": "/v1/orgs/5e15fa33623f88001a8e0bb5" }, "data": { "type": "org", "id": "5e15fa33623f88001a8e0bb5" } }, "createdBy": { "links": { "self": "/v1/users/5e15fa45623f88001a8e0bbb" }, "data": { "type": "user", "id": "5e15fa45623f88001a8e0bbb" } }, "modifiedBy": { "links": { "self": "/v1/users/5e15fa45623f88001a8e0bbb" }, "data": { "type": "user", "id": "5e15fa45623f88001a8e0bbb" } } }, "links": { "self": "/v1/schedules/5e21e0f9520ec30019df3dcf" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] }, "delete": { "security": [ { "httpBearer": [] } ], "tags": [ "Business Schedules" ], "summary": "Delete a business schedule by ID", "description": "Deletes a business schedule based on the schedule ID.\n\nAny one of the following roles is required for this endpoint:\n\nLegacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.admin.schedule.write|org.permission.schedule.delete|", "operationId": "DeleteScheduleById", "parameters": [ { "name": "id", "in": "path", "description": "Business Schedule ID", "required": true, "style": "simple", "schema": { "type": "string", "example": "5e2210548d9b6e0087fa67f1" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "name": { "type": "string" }, "hours": { "type": "object", "properties": { "0": { "type": "string", "nullable": true }, "1": { "type": "array", "items": { "type": "array", "items": { "type": "integer" } } }, "2": { "type": "array", "items": { "type": "array", "items": { "type": "integer" } } }, "3": { "type": "array", "items": { "type": "array", "items": { "type": "integer" } } }, "4": { "type": "array", "items": { "type": "array", "items": { "type": "integer" } } }, "5": { "type": "array", "items": { "type": "array", "items": { "type": "integer" } } }, "6": { "type": "string", "nullable": true } }, "required": [ "0", "1", "2", "3", "4", "5", "6" ] }, "timezone": { "type": "string" }, "default": { "type": "boolean" }, "deleted": { "type": "boolean" }, "deletedAt": { "type": "string" }, "createdAt": { "type": "string" }, "modifiedAt": { "type": "string" }, "updatedAt": { "type": "string" } }, "required": [ "name", "hours", "timezone", "default", "deleted", "deletedAt", "createdAt", "modifiedAt", "updatedAt" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "createdBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "modifiedBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "deletedBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "createdBy", "modifiedBy", "deletedBy" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "schedule", "id": "5e2210548d9b6e0087fa67f1", "attributes": { "name": "Holiday Hours", "hours": { "0": null, "1": [ [ 280, 450 ], [ 480, 1020 ] ], "2": [ [ 480, 1020 ] ], "3": [ [ 480, 1020 ] ], "4": [ [ 480, 1020 ] ], "5": [ [ 480, 1020 ] ], "6": null }, "timezone": "America/New_York", "default": false, "deleted": true, "deletedAt": "2020-01-17T20:20:02.323Z", "createdAt": "2020-01-17T19:51:48.085Z", "modifiedAt": "2020-01-17T20:20:02.323Z", "updatedAt": "2020-01-17T20:20:02.323Z" }, "relationships": { "org": { "links": { "self": "/v1/orgs/5e15fa33623f88001a8e0bb5" }, "data": { "type": "org", "id": "5e15fa33623f88001a8e0bb5" } }, "createdBy": { "links": { "self": "/v1/users/5e15fa45623f88001a8e0bbb" }, "data": { "type": "user", "id": "5e15fa45623f88001a8e0bbb" } }, "modifiedBy": { "links": { "self": "/v1/users/5e15fa45623f88001a8e0bbb" }, "data": { "type": "user", "id": "5e15fa45623f88001a8e0bbb" } }, "deletedBy": { "links": { "self": "/v1/users/5e15fa45623f88001a8e0bbb" }, "data": { "type": "user", "id": "5e15fa45623f88001a8e0bbb" } } }, "links": { "self": "/v1/schedules/5e2210548d9b6e0087fa67f1" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] } }, "/companies": { "post": { "security": [ { "httpBearer": [] } ], "tags": [ "Companies" ], "summary": "Create company", "description": "Creates a new company.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.company.write|org.permission.company.create|\n\n### Custom Attributes\n[Custom attributes](https://help.kustomer.com/define-attributes-Skr924HI) are optional and allow you to specify\ncustom key-value pairs.\n\nKustomer uses a naming convention for custom attributes to specify the field data type with a name suffix:\n\n#### Naming Suffix\n\n* `Num` *number* or *null*\n* `At` *date-time* or *null*\n* `Str` *string* or *null*, length: [ 0 .. 1024 ] characters\n* `Txt` *string* or *null*, length: [ 0 .. 1024 ] characters\n* `Bool` *boolean* or *null*\n* `Url` *string* or *null*, format: *uri*", "operationId": "CreateCompany", "parameters": [], "requestBody": { "description": "", "content": { "application/json": { "schema": { "type": "object", "additionalProperties": false, "properties": { "name": { "type": "string", "minLength": 3, "maxLength": 256, "description": "The name of the company. The minimum length is 3 and the maximum is 255." }, "externalId": { "type": "string", "maxLength": 256, "description": "The third party application ID for this company, if applicable. The maximum length is 256." }, "avatarUrl": { "type": "string", "format": "uri", "description": "The URL for the avatar image of this company.", "nullable": true }, "emails": { "type": "array", "maxItems": 10, "uniqueItems": true, "description": "The email addresses associated with this company. The maximum amount is 10.", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "home", "work", "other" ] }, "email": { "type": "string", "format": "email-relaxed" }, "verified": { "type": "boolean" } }, "required": [ "email" ], "additionalProperties": false } }, "phones": { "type": "array", "maxItems": 10, "uniqueItems": true, "description": "The phone numbers associated with this company. The maximum amount is 10.", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "mobile", "home", "work", "fax", "other" ] }, "phone": { "type": "string", "format": "phone-number" }, "verified": { "type": "boolean" } }, "required": [ "phone" ], "additionalProperties": false } }, "whatsapps": { "type": "array", "maxItems": 10, "uniqueItems": true, "description": "The WhatsApp phone numbers associated with this company. The maximum amount is 10.", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "mobile" ] }, "phone": { "type": "string", "format": "whatsapp-number" }, "verified": { "type": "boolean" } }, "required": [ "phone" ], "additionalProperties": false } }, "socials": { "type": "array", "maxItems": 10, "uniqueItems": true, "description": "The social media handles associated with this company. The maximum amount of items is 10.", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "twitter", "facebook", "instagram", "linkedin", "pinterest" ] }, "userid": { "type": "string", "maxLength": 256 }, "username": { "type": "string", "minLength": 1, "maxLength": 256 }, "url": { "type": "string", "format": "uri" }, "verified": { "type": "boolean" } }, "required": [ "type", "username" ], "additionalProperties": false } }, "urls": { "type": "array", "maxItems": 10, "uniqueItems": true, "description": "The websites associated with this company. The maximum amount is 10.", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "website", "blog", "other" ] }, "url": { "type": "string", "format": "url" } }, "required": [ "url" ], "additionalProperties": false } }, "domains": { "type": "array", "maxItems": 10, "uniqueItems": true, "items": { "type": "object", "properties": { "domain": { "type": "string", "format": "domain-name" } }, "required": [ "domain" ], "additionalProperties": false } }, "locations": { "type": "array", "maxItems": 10, "uniqueItems": true, "description": "The primary address associated with this company.\nThe maximum amount is 10.", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "home", "work", "other" ], "nullable": true }, "name": { "type": "string", "nullable": true }, "address": { "type": "string", "maxLength": 256, "nullable": true }, "address2": { "type": "string", "maxLength": 256, "nullable": true }, "address3": { "type": "string", "maxLength": 256, "nullable": true }, "latitude": { "type": "number", "nullable": true }, "longitude": { "type": "number", "nullable": true }, "countryCode": { "type": "string", "minLength": 2, "maxLength": 2, "nullable": true }, "countryName": { "type": "string", "maxLength": 64, "nullable": true }, "regionCode": { "type": "string", "maxLength": 2, "nullable": true }, "regionName": { "type": "string", "maxLength": 128, "nullable": true }, "cityName": { "type": "string", "maxLength": 128, "nullable": true }, "zipCode": { "type": "string", "maxLength": 30, "nullable": true }, "areaCode": { "type": "string", "maxLength": 30, "nullable": true } }, "additionalProperties": false } }, "employeeCount": { "type": "number", "description": "The number of customers associated with this company." }, "tags": { "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 64, "pattern": "^[0-9a-zA-ZÀ-ÿ_/<>\\-.]{1}[0-9a-zA-ZÀ-ÿ _/<>\\-.]{0,63}$" }, "maxItems": 20, "uniqueItems": true }, "createdAt": { "type": "string", "format": "date-time", "description": "The date and time the company object was created in Kustomer." }, "importedAt": { "type": "string", "format": "date-time", "description": "The date and time the company was imported from an external system." }, "rev": { "type": "number" }, "custom": { "type": "object", "maxProperties": 100, "additionalProperties": false }, "defaultLang": { "type": "string", "maxLength": 100, "nullable": true } }, "required": [ "name" ] } } } }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "name": { "type": "string" }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "modifiedAt": { "type": "string" }, "tags": { "type": "array" } }, "required": [ "name", "createdAt", "updatedAt", "modifiedAt", "tags" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "createdBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "modifiedBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "createdBy", "modifiedBy" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "company", "id": "58224b3eaa5f92110005d61e", "attributes": { "name": "New Company Name", "createdAt": "2016-11-08T22:01:34.620Z", "updatedAt": "2016-11-08T22:01:34.620Z", "modifiedAt": "2016-11-08T22:01:34.620Z", "tags": [] }, "relationships": { "org": { "links": { "self": "/v1/orgs/57f29863a1dbf61100e6aa92" }, "data": { "type": "org", "id": "57f29863a1dbf61100e6aa92" } }, "createdBy": { "links": { "self": "/v1/users/58190b991f2932100010d683" }, "data": { "type": "user", "id": "58190b991f2932100010d683" } }, "modifiedBy": { "links": { "self": "/v1/users/58190b991f2932100010d683" }, "data": { "type": "user", "id": "58190b991f2932100010d683" } } }, "links": { "self": "/v1/companies/58224b3eaa5f92110005d61e" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] }, "get": { "security": [ { "httpBearer": [] } ], "tags": [ "Companies" ], "summary": "Get companies", "description": "Retrieves all companies. You can optionally filter this list by the company name or the unique external company ID.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.company.read|org.permission.company.read|\n\n### Note\n> If you use both the `externalId` and `filter` query params, the request ignores both query params.", "operationId": "GetCompanies", "parameters": [ { "schema": { "type": "string", "example": "foobar" }, "in": "query", "name": "externalId", "description": "Unique external ID of the company" }, { "schema": { "type": "string", "example": "foucault" }, "in": "query", "name": "filter", "description": "Company name to use as a filter" } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "meta": { "type": "object", "properties": { "pageSize": { "type": "integer" }, "page": { "type": "integer" } }, "required": [ "pageSize", "page" ] }, "data": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "name": { "type": "string" }, "extenalId": { "type": "string" }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "modifiedAt": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } } }, "required": [ "name", "extenalId", "createdAt", "updatedAt", "modifiedAt", "tags" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "createdBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "modifiedBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "createdBy", "modifiedBy" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "links": { "type": "object", "properties": { "self": { "type": "string" }, "first": { "type": "string" }, "prev": { "type": "string", "nullable": true }, "next": { "type": "string", "nullable": true } }, "required": [ "self", "first", "prev", "next" ] } }, "required": [ "meta", "data", "links" ] }, "example": { "meta": { "pageSize": 100, "page": 1 }, "data": [ { "type": "company", "id": "58224b3eaa5f92110005d61e", "attributes": { "name": "foobar Company Name", "extenalId": "foobar", "createdAt": "2016-11-08T22:01:34.620Z", "updatedAt": "2016-11-08T22:11:35.776Z", "modifiedAt": "2016-11-08T22:11:35.776Z", "tags": [ "58224d97d4e96711004ecc56" ] }, "relationships": { "org": { "links": { "self": "/v1/orgs/57f29863a1dbf61100e6aa92" }, "data": { "type": "org", "id": "57f29863a1dbf61100e6aa92" } }, "createdBy": { "links": { "self": "/v1/users/58190b991f2932100010d683" }, "data": { "type": "user", "id": "58190b991f2932100010d683" } }, "modifiedBy": { "links": { "self": "/v1/users/58190b991f2932100010d683" }, "data": { "type": "user", "id": "58190b991f2932100010d683" } } }, "links": { "self": "/v1/companies/58224b3eaa5f92110005d61e" } }, { "type": "company", "id": "58224b3eaa5f92110005d61d", "attributes": { "name": "foobar2 Company Name", "extenalId": "foobar2", "createdAt": "2016-11-08T22:01:34.620Z", "updatedAt": "2016-11-08T22:11:35.776Z", "modifiedAt": "2016-11-08T22:11:35.776Z", "tags": [ "58224d97d4e96711004ecc56" ] }, "relationships": { "org": { "links": { "self": "/v1/orgs/57f29863a1dbf61100e6aa92" }, "data": { "type": "org", "id": "57f29863a1dbf61100e6aa92" } }, "createdBy": { "links": { "self": "/v1/users/58190b991f2932100010d683" }, "data": { "type": "user", "id": "58190b991f2932100010d683" } }, "modifiedBy": { "links": { "self": "/v1/users/58190b991f2932100010d683" }, "data": { "type": "user", "id": "58190b991f2932100010d683" } } }, "links": { "self": "/v1/companies/58224b3eaa5f92110005d61d" } } ], "links": { "self": "/v1/companies?filter=foobar&page=1&pageSize=100", "first": "/v1/companies?filter=foobar&page=1&pageSize=100", "prev": null, "next": null } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] } }, "/companies/{id}": { "get": { "security": [ { "httpBearer": [] } ], "tags": [ "Companies" ], "summary": "Get company by ID", "description": "Retrieves a company by their unique company ID.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.company.read|org.permission.company.read|", "operationId": "GetCompanyById", "parameters": [ { "name": "id", "in": "path", "description": "Unique ID of the company.", "required": true, "style": "simple", "schema": { "type": "string", "example": "58224b3eaa5f92110005d61e" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "name": { "type": "string" }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "modifiedAt": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } } }, "required": [ "name", "createdAt", "updatedAt", "modifiedAt", "tags" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "createdBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "modifiedBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "createdBy", "modifiedBy" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "company", "id": "58224b3eaa5f92110005d61e", "attributes": { "name": "Updated Company Name", "createdAt": "2016-11-08T22:01:34.620Z", "updatedAt": "2016-11-08T22:11:35.776Z", "modifiedAt": "2016-11-08T22:11:35.776Z", "tags": [ "58224d97d4e96711004ecc56" ] }, "relationships": { "org": { "links": { "self": "/v1/orgs/57f29863a1dbf61100e6aa92" }, "data": { "type": "org", "id": "57f29863a1dbf61100e6aa92" } }, "createdBy": { "links": { "self": "/v1/users/58190b991f2932100010d683" }, "data": { "type": "user", "id": "58190b991f2932100010d683" } }, "modifiedBy": { "links": { "self": "/v1/users/58190b991f2932100010d683" }, "data": { "type": "user", "id": "58190b991f2932100010d683" } } }, "links": { "self": "/v1/companies/58224b3eaa5f92110005d61e" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] }, "put": { "security": [ { "httpBearer": [] } ], "tags": [ "Companies" ], "summary": "Update company attributes", "description": "Updates the attributes of a company based on the company ID.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.company.write|org.permission.company.update|\n\n### Note\n>This endpoint is subject to Object Rate Limiting, which limits how many updates a single user can make to a single company attribute. To learn more, see [Rate limiting](https://developer.kustomer.com/kustomer-api-docs/reference/rate-limiting).\n\n### Custom Attributes\n[Custom attributes](https://help.kustomer.com/define-attributes-Skr924HI) are optional and allow you to specify\ncustom key-value pairs.\n\nKustomer uses a naming convention for custom attributes to specify the field data type with a name suffix:\n\n#### Naming Suffix\n\n* `Num` *number* or *null*\n* `At` *date-time* or *null*\n* `Str` *string* or *null*, length: [ 0 .. 1024 ] characters\n* `Txt` *string* or *null*, length: [ 0 .. 1024 ] characters\n* `Bool` *boolean* or *null*\n* `Url` *string* or *null*, format: *uri*", "operationId": "UpdateCompanyAttributes", "parameters": [ { "name": "id", "in": "path", "description": "Unique ID of the company.", "required": true, "style": "simple", "schema": { "type": "string", "example": "58224b3eaa5f92110005d61e" } } ], "requestBody": { "description": "", "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string", "minLength": 3, "maxLength": 256 }, "externalId": { "type": "string", "maxLength": 256, "nullable": true }, "avatarUrl": { "type": "string", "format": "uri", "nullable": true }, "emails": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "home", "work", "other" ] }, "email": { "type": "string", "format": "email-relaxed" }, "verified": { "type": "boolean" } }, "required": [ "email" ], "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "phones": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "mobile", "home", "work", "fax", "other" ] }, "phone": { "type": "string", "format": "phone-number" }, "verified": { "type": "boolean" } }, "required": [ "phone" ], "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "whatsapps": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "mobile" ] }, "phone": { "type": "string", "format": "whatsapp-number" }, "verified": { "type": "boolean" } }, "required": [ "phone" ], "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "socials": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "twitter", "facebook", "instagram", "linkedin", "pinterest" ] }, "userid": { "type": "string", "maxLength": 256 }, "username": { "type": "string", "minLength": 1, "maxLength": 256 }, "url": { "type": "string", "format": "uri" }, "verified": { "type": "boolean" } }, "required": [ "type", "username" ], "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "urls": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "website", "blog", "other" ] }, "url": { "type": "string", "format": "url" } }, "required": [ "url" ], "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "domains": { "type": "array", "items": { "type": "object", "properties": { "domain": { "type": "string", "format": "domain-name" } }, "required": [ "domain" ], "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "locations": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "home", "work", "other" ], "nullable": true }, "name": { "type": "string", "nullable": true }, "address": { "type": "string", "maxLength": 256, "nullable": true }, "address2": { "type": "string", "maxLength": 256, "nullable": true }, "address3": { "type": "string", "maxLength": 256, "nullable": true }, "latitude": { "type": "number", "nullable": true }, "longitude": { "type": "number", "nullable": true }, "countryCode": { "type": "string", "minLength": 2, "maxLength": 2, "nullable": true }, "countryName": { "type": "string", "maxLength": 64, "nullable": true }, "regionCode": { "type": "string", "maxLength": 2, "nullable": true }, "regionName": { "type": "string", "maxLength": 128, "nullable": true }, "cityName": { "type": "string", "maxLength": 128, "nullable": true }, "zipCode": { "type": "string", "maxLength": 30, "nullable": true }, "areaCode": { "type": "string", "maxLength": 30, "nullable": true } }, "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "employeeCount": { "type": "number" }, "tags": { "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 64, "pattern": "^[0-9a-zA-ZÀ-ÿ_/<>\\-.]{1}[0-9a-zA-ZÀ-ÿ _/<>\\-.]{0,63}$" }, "maxItems": 20, "uniqueItems": true }, "custom": { "type": "object", "maxProperties": 100, "additionalProperties": false }, "defaultLang": { "type": "string", "maxLength": 100, "nullable": true }, "rev": { "type": "number" }, "deleted": { "type": "boolean", "nullable": true } }, "additionalProperties": false } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "name": { "type": "string" }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "modifiedAt": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } } }, "required": [ "name", "createdAt", "updatedAt", "modifiedAt", "tags" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "createdBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "modifiedBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "createdBy", "modifiedBy" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "company", "id": "58224b3eaa5f92110005d61e", "attributes": { "name": "Updated Company Name", "createdAt": "2016-11-08T22:01:34.620Z", "updatedAt": "2016-11-08T22:11:35.776Z", "modifiedAt": "2016-11-08T22:11:35.776Z", "tags": [ "58224d97d4e96711004ecc56" ] }, "relationships": { "org": { "links": { "self": "/v1/orgs/57f29863a1dbf61100e6aa92" }, "data": { "type": "org", "id": "57f29863a1dbf61100e6aa92" } }, "createdBy": { "links": { "self": "/v1/users/58190b991f2932100010d683" }, "data": { "type": "user", "id": "58190b991f2932100010d683" } }, "modifiedBy": { "links": { "self": "/v1/users/58190b991f2932100010d683" }, "data": { "type": "user", "id": "58190b991f2932100010d683" } } }, "links": { "self": "/v1/companies/58224b3eaa5f92110005d61e" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] } }, "/companies/{id}/klasses/{name}": { "get": { "security": [ { "httpBearer": [] } ], "tags": [ "Companies", "Klasses" ], "summary": "Find company KObjects (custom Objects)", "description": "Retrieves all [KObjects (custom Objects)](https://help.kustomer.com/en_us/define-attributes-Skr924HI) that are linked to a company based on the unique company ID and unique Klass name.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.company.read|org.permission.company.read|", "operationId": "FindCompanyKObjects", "parameters": [ { "name": "id", "in": "path", "description": "Unique ID of the company.", "required": true, "style": "simple", "schema": { "type": "string", "example": "57c08ccde595371400462df3" } }, { "name": "name", "in": "path", "description": "Unique Klass name.", "required": true, "style": "simple", "schema": { "type": "string", "example": "order" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "title": "", "properties": { "meta": { "type": "object", "required": [ "pageSize", "page" ], "properties": { "pageSize": { "type": "integer" }, "page": { "type": "integer" } } }, "data": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "required": [ "title", "icon", "images", "custom", "tags", "updatedAt", "createdAt", "rev" ], "properties": { "title": { "type": "string" }, "icon": { "type": "string" }, "images": { "type": "array", "items": { "type": "string" } }, "s3DataUrl": { "type": "string" }, "custom": { "type": "object" }, "tags": { "type": "array", "items": {} }, "updatedAt": { "type": "string" }, "createdAt": { "type": "string" }, "rev": { "type": "integer" } } }, "relationships": { "type": "object", "required": [ "org", "klass", "company" ], "properties": { "org": { "type": "object", "required": [ "links", "data" ], "properties": { "links": { "type": "object", "required": [ "self" ], "properties": { "self": { "type": "string" } } }, "data": { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "type": "string" }, "id": { "type": "string" } } } } }, "klass": { "type": "object", "required": [ "link", "data" ], "properties": { "link": { "type": "object", "required": [ "self" ], "properties": { "self": { "type": "string" } } }, "data": { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "type": "string" }, "id": { "type": "string" } } } } }, "company": { "type": "object", "required": [ "links", "data" ], "properties": { "links": { "type": "object", "required": [ "self" ], "properties": { "self": { "type": "string" } } }, "data": { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "type": "string" }, "id": { "type": "string" } } } } } } }, "links": { "type": "object", "required": [ "self" ], "properties": { "self": { "type": "string" } } } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "links": { "type": "object", "required": [ "self", "first", "prev", "next" ], "properties": { "self": { "type": "string" }, "first": { "type": "string" }, "prev": { "type": "string", "nullable": true }, "next": { "type": "string", "nullable": true } } } }, "required": [ "meta", "data", "links" ] } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] } }, "/companies/bulk": { "post": { "security": [ { "httpBearer": [] } ], "tags": [ "Companies (Bulk)" ], "summary": "Bulk create companies", "description": "Creates companies in bulk.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.company.write|org.permission.company.create|\n\n### Custom Attributes\n[Custom attributes](https://help.kustomer.com/define-attributes-Skr924HI) are optional and allow you to specify\ncustom key-value pairs.\n\nKustomer uses a naming convention for custom attributes to specify the field data type with a name suffix:\n\n#### Naming Suffix\n\n* `Num` *number* or *null*\n* `At` *date-time* or *null*\n* `Str` *string* or *null*, length: [ 0 .. 1024 ] characters\n* `Txt` *string* or *null*, length: [ 0 .. 1024 ] characters\n* `Bool` *boolean* or *null*\n* `Url` *string* or *null*, format: *uri*", "operationId": "BulkCreateCompanies", "parameters": [], "requestBody": { "description": "", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "minLength": 3, "maxLength": 256 }, "externalId": { "type": "string", "maxLength": 256 }, "avatarUrl": { "type": "string", "format": "uri", "nullable": true }, "emails": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "home", "work", "other" ] }, "email": { "type": "string", "format": "email-relaxed" }, "verified": { "type": "boolean" } }, "required": [ "email" ], "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "phones": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "mobile", "home", "work", "fax", "other" ] }, "phone": { "type": "string", "format": "phone-number" }, "verified": { "type": "boolean" } }, "required": [ "phone" ], "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "whatsapps": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "mobile" ] }, "phone": { "type": "string", "format": "whatsapp-number" }, "verified": { "type": "boolean" } }, "required": [ "phone" ], "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "socials": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "twitter", "facebook", "instagram", "linkedin", "pinterest" ] }, "userid": { "type": "string", "maxLength": 256 }, "username": { "type": "string", "minLength": 1, "maxLength": 256 }, "url": { "type": "string", "format": "uri" }, "verified": { "type": "boolean" } }, "required": [ "type", "username" ], "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "urls": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "website", "blog", "other" ] }, "url": { "type": "string", "format": "url" } }, "required": [ "url" ], "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "domains": { "type": "array", "items": { "type": "object", "properties": { "domain": { "type": "string", "format": "domain-name" } }, "required": [ "domain" ], "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "locations": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "home", "work", "other" ], "nullable": true }, "name": { "type": "string", "nullable": true }, "address": { "type": "string", "maxLength": 256, "nullable": true }, "address2": { "type": "string", "maxLength": 256, "nullable": true }, "address3": { "type": "string", "maxLength": 256, "nullable": true }, "latitude": { "type": "number", "nullable": true }, "longitude": { "type": "number", "nullable": true }, "countryCode": { "type": "string", "minLength": 2, "maxLength": 2, "nullable": true }, "countryName": { "type": "string", "maxLength": 64, "nullable": true }, "regionCode": { "type": "string", "maxLength": 2, "nullable": true }, "regionName": { "type": "string", "maxLength": 128, "nullable": true }, "cityName": { "type": "string", "maxLength": 128, "nullable": true }, "zipCode": { "type": "string", "maxLength": 30, "nullable": true }, "areaCode": { "type": "string", "maxLength": 30, "nullable": true } }, "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "employeeCount": { "type": "number" }, "tags": { "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 64, "pattern": "^[0-9a-zA-ZÀ-ÿ_/<>\\-.]{1}[0-9a-zA-ZÀ-ÿ _/<>\\-.]{0,63}$" }, "maxItems": 20, "uniqueItems": true }, "createdAt": { "type": "string", "format": "date-time" }, "importedAt": { "type": "string", "format": "date-time" }, "rev": { "type": "number" }, "custom": { "type": "object", "maxProperties": 100, "additionalProperties": false }, "defaultLang": { "type": "string", "maxLength": 100, "nullable": true } }, "required": [ "name" ], "additionalProperties": false }, "maxItems": 100 } } } }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "ids": { "type": "array" }, "context": { "type": "string" }, "status": { "type": "string" }, "v2": { "type": "boolean" }, "payload": { "type": "object", "properties": { "api": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" } }, "required": [ "name" ] } }, "path": { "type": "string" }, "user": { "type": "object", "properties": { "id": { "type": "string" }, "userType": { "type": "string" }, "roles": { "type": "array", "items": { "type": "string" } }, "orgName": { "type": "string" }, "subject": { "type": "string" }, "org": { "type": "string" } }, "required": [ "id", "userType", "roles", "orgName", "subject", "org" ] }, "requestId": { "type": "string" }, "service": { "type": "string" }, "method": { "type": "string" } }, "required": [ "data", "path", "user", "requestId", "service", "method" ] } }, "required": [ "api" ] }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "completed": { "type": "boolean" } }, "required": [ "ids", "context", "status", "v2", "payload", "createdAt", "updatedAt", "completed" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "createdBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "createdBy" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "bulk", "id": "5b3bddb67f8469003df370a4", "attributes": { "ids": [], "context": "api.sobjects.companies.bulk-create", "status": "complete", "v2": true, "payload": { "api": { "data": [ { "name": "Company1" }, { "name": "Company2" } ], "path": "/v1/companies", "user": { "id": "5a96dac46dd73800112fab30", "userType": "user", "roles": [ "org" ], "orgName": "mycompany", "subject": "5a96dac46dd73800112fab30", "org": "5a96dac36dd73800112fab2e" }, "requestId": "5b3bddb6b6e494001779fa38", "service": "sobjects", "method": "POST" } }, "createdAt": "2018-07-03T20:33:58.486Z", "updatedAt": "2018-07-03T20:34:03.873Z", "completed": true }, "relationships": { "org": { "links": { "self": "/v1/orgs/5a96dac36dd73800112fab2e" }, "data": { "type": "org", "id": "5a96dac36dd73800112fab2e" } }, "createdBy": { "links": { "self": "/v1/users/5a96dac46dd73800112fab30" }, "data": { "type": "user", "id": "5a96dac46dd73800112fab30" } } }, "links": { "self": "/v1/bulk/5b3bddb67f8469003df370a4" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] }, "put": { "security": [ { "httpBearer": [] } ], "tags": [ "Companies (Bulk)" ], "summary": "Bulk batch update companies", "description": "Batch updates multiple companies.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.company.write|org.permission.company.update|\n\n### Custom Attributes\n[Custom attributes](https://help.kustomer.com/define-attributes-Skr924HI) are optional and allow you to specify\ncustom key-value pairs.\n\nKustomer uses a naming convention for custom attributes to specify the field data type with a name suffix:\n\n#### Naming Suffix\n\n* `Num` *number* or *null*\n* `At` *date-time* or *null*\n* `Str` *string* or *null*, length: [ 0 .. 1024 ] characters\n* `Txt` *string* or *null*, length: [ 0 .. 1024 ] characters\n* `Bool` *boolean* or *null*\n* `Url` *string* or *null*, format: *uri*", "operationId": "BulkBatchUpdateCompanies", "parameters": [], "requestBody": { "description": "", "content": { "application/json": { "schema": { "type": "array", "items": { "properties": { "id": { "type": "string" }, "name": { "type": "string", "minLength": 3, "maxLength": 256 }, "externalId": { "type": "string", "maxLength": 256, "nullable": true }, "avatarUrl": { "type": "string", "format": "uri", "nullable": true }, "emails": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "home", "work", "other" ] }, "email": { "type": "string", "format": "email-relaxed" }, "verified": { "type": "boolean" } }, "required": [ "email" ], "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "phones": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "mobile", "home", "work", "fax", "other" ] }, "phone": { "type": "string", "format": "phone-number" }, "verified": { "type": "boolean" } }, "required": [ "phone" ], "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "socials": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "twitter", "facebook", "instagram", "linkedin", "pinterest" ] }, "userid": { "type": "string", "maxLength": 256 }, "username": { "type": "string", "minLength": 1, "maxLength": 256 }, "url": { "type": "string", "format": "uri" }, "verified": { "type": "boolean" } }, "required": [ "type", "username" ], "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "urls": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "website", "blog", "other" ] }, "url": { "type": "string", "format": "url" } }, "required": [ "url" ], "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "domains": { "type": "array", "items": { "type": "object", "properties": { "domain": { "type": "string", "format": "domain-name" } }, "required": [ "domain" ], "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "locations": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "home", "work", "other" ], "nullable": true }, "name": { "type": "string", "nullable": true }, "address": { "type": "string", "maxLength": 256, "nullable": true }, "address2": { "type": "string", "maxLength": 256, "nullable": true }, "address3": { "type": "string", "maxLength": 256, "nullable": true }, "latitude": { "type": "number", "nullable": true }, "longitude": { "type": "number", "nullable": true }, "countryCode": { "type": "string", "minLength": 2, "maxLength": 2, "nullable": true }, "countryName": { "type": "string", "maxLength": 64, "nullable": true }, "regionCode": { "type": "string", "maxLength": 2, "nullable": true }, "regionName": { "type": "string", "maxLength": 128, "nullable": true }, "cityName": { "type": "string", "maxLength": 128, "nullable": true }, "zipCode": { "type": "string", "maxLength": 30, "nullable": true }, "areaCode": { "type": "string", "maxLength": 30, "nullable": true } }, "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "employeeCount": { "type": "number" }, "tags": { "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 64, "pattern": "^[0-9a-zA-ZÀ-ÿ_/<>\\-.]{1}[0-9a-zA-ZÀ-ÿ _/<>\\-.]{0,63}$" }, "maxItems": 20, "uniqueItems": true }, "custom": { "type": "object", "maxProperties": 100, "additionalProperties": false }, "defaultLang": { "type": "string", "maxLength": 100, "nullable": true }, "deleted": { "type": "boolean", "nullable": true } }, "required": [ "id" ], "additionalProperties": false, "type": "object" }, "maxItems": 100 } } } }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "ids": { "type": "array" }, "context": { "type": "string" }, "status": { "type": "string" }, "v2": { "type": "boolean" }, "payload": { "type": "object", "properties": { "api": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" } }, "required": [ "id", "name" ] } }, "path": { "type": "string" }, "user": { "type": "object", "properties": { "id": { "type": "string" }, "userType": { "type": "string" }, "roles": { "type": "array", "items": { "type": "string" } }, "orgName": { "type": "string" }, "subject": { "type": "string" }, "org": { "type": "string" } }, "required": [ "id", "userType", "roles", "orgName", "subject", "org" ] }, "requestId": { "type": "string" }, "service": { "type": "string" }, "method": { "type": "string" } }, "required": [ "data", "path", "user", "requestId", "service", "method" ] } }, "required": [ "api" ] }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "completed": { "type": "boolean" } }, "required": [ "ids", "context", "status", "v2", "payload", "createdAt", "updatedAt", "completed" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "createdBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "createdBy" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "bulk", "id": "5b3bddb67f8469003df370a4", "attributes": { "ids": [], "context": "api.sobjects.companies.bulk-create", "status": "complete", "v2": true, "payload": { "api": { "data": [ { "id": "58224b3eaa5f92110005d61e", "name": "Company1" }, { "id": "58224b3eaa5f92110005d61d", "name": "Company2" } ], "path": "/v1/companies", "user": { "id": "5a96dac46dd73800112fab30", "userType": "user", "roles": [ "org" ], "orgName": "mycompany", "subject": "5a96dac46dd73800112fab30", "org": "5a96dac36dd73800112fab2e" }, "requestId": "5b3bddb6b6e494001779fa38", "service": "sobjects", "method": "POST" } }, "createdAt": "2018-07-03T20:33:58.486Z", "updatedAt": "2018-07-03T20:34:03.873Z", "completed": true }, "relationships": { "org": { "links": { "self": "/v1/orgs/5a96dac36dd73800112fab2e" }, "data": { "type": "org", "id": "5a96dac36dd73800112fab2e" } }, "createdBy": { "links": { "self": "/v1/users/5a96dac46dd73800112fab30" }, "data": { "type": "user", "id": "5a96dac46dd73800112fab30" } } }, "links": { "self": "/v1/bulk/5b3bddb67f8469003df370a4" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] } }, "/conversations": { "post": { "security": [ { "httpBearer": [] } ], "tags": [ "Conversations" ], "summary": "Create conversation", "description": "Creates a new conversation.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.conversation.write|org.permission.conversation.create|\n\n### Custom Attributes\n[Custom attributes](https://help.kustomer.com/define-attributes-Skr924HI) are optional and allow you to specify custom key-value pairs.\n\nKustomer uses a naming convention for custom attributes to specify the field data type with a name suffix:\n\n#### Naming Suffix\n\n* `Num` *number* or *null*\n* `At` *date-time* or *null*\n* `Str` *string* or *null*, length: [ 0 .. 1024 ] characters\n* `Txt` *string* or *null*, length: [ 0 .. 1024 ] characters\n* `Bool` *boolean* or *null*\n* `Url` *string* or *null*, format: *uri*\n\n### Rate Limit\nConversations are subject to a rate limit. A single client can create up to 120 conversations per minute per customer.\n\nConversations with `importedAt` in their body will not be subject to the rate limit.\n\nA `429 Too Many Requests` response will be returned if the rate limit has been reached for a customer.", "operationId": "CreateConversation", "parameters": [], "requestBody": { "description": "", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string", "format": "object-id" }, "customer": { "type": "string", "format": "object-id" }, "externalId": { "type": "string", "maxLength": 256 }, "name": { "type": "string", "maxLength": 256 }, "status": { "type": "string", "enum": [ "open", "done" ] }, "priority": { "type": "integer", "minimum": 1, "maximum": 5 }, "createdAt": { "type": "string", "format": "date-time" }, "importedAt": { "type": "string", "format": "date-time" }, "direction": { "type": "string", "enum": [ "in", "out" ] }, "replyChannel": { "type": "string", "maxLength": 256, "nullable": true }, "tags": { "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 64, "pattern": "^[0-9a-zA-ZÀ-ÿ_/<>\\-.]{1}[0-9a-zA-ZÀ-ÿ _/<>\\-.]{0,63}$" }, "maxItems": 20, "uniqueItems": true }, "assignedUsers": { "type": "array", "items": { "type": "string", "format": "object-id" }, "maxItems": 10, "uniqueItems": true }, "assignedTeams": { "type": "array", "items": { "type": "string", "format": "object-id" }, "maxItems": 10, "uniqueItems": true }, "custom": { "type": "object", "maxProperties": 100, "additionalProperties": false }, "defaultLang": { "type": "string", "maxLength": 100, "nullable": true }, "queue": { "type": "object", "properties": { "id": { "type": "string", "nullable": true }, "external": { "type": "string", "enum": [ "amazon-connect" ], "nullable": true } }, "anyOf": [ { "required": [ "id" ] }, { "required": [ "external" ] } ], "additionalProperties": false } }, "required": [ "customer" ], "additionalProperties": false } } } }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "name": { "type": "string" }, "channels": { "type": "array" }, "status": { "type": "string" }, "messageCount": { "type": "integer" }, "noteCount": { "type": "integer" }, "satisfaction": { "type": "integer" }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "modifiedAt": { "type": "string" }, "tags": { "type": "array" }, "suggestedTags": { "type": "array" }, "sentiment": { "type": "object" }, "lastMessageIn": { "type": "object" }, "assignedUsers": { "type": "array" }, "assignedTeams": { "type": "array" }, "firstResponse": { "type": "object" }, "direction": { "type": "string" }, "outboundMessageCount": { "type": "integer" }, "rev": { "type": "integer" } }, "required": [ "name", "channels", "status", "messageCount", "noteCount", "satisfaction", "createdAt", "updatedAt", "modifiedAt", "tags", "suggestedTags", "sentiment", "lastMessageIn", "assignedUsers", "assignedTeams", "firstResponse", "direction", "outboundMessageCount", "rev" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "customer": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "messages": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "links" ] }, "createdBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "modifiedBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "customer", "messages", "createdBy", "modifiedBy" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "conversation", "id": "58228e05d4e96711004eccb7", "attributes": { "name": "Foobar", "channels": [], "status": "open", "messageCount": 0, "noteCount": 0, "satisfaction": 0, "createdAt": "2016-11-09T02:46:29.789Z", "updatedAt": "2016-11-09T02:46:29.789Z", "modifiedAt": "2016-11-09T02:46:29.789Z", "tags": [], "suggestedTags": [], "sentiment": {}, "lastMessageIn": {}, "assignedUsers": [], "assignedTeams": [], "firstResponse": {}, "direction": "in", "outboundMessageCount": 0, "rev": 1 }, "relationships": { "org": { "links": { "self": "/v1/orgs/57f29863a1dbf61100e6aa92" }, "data": { "type": "org", "id": "57f29863a1dbf61100e6aa92" } }, "customer": { "links": { "self": "/v1/customers/58210c3db0f09110006b7953" }, "data": { "type": "customer", "id": "58210c3db0f09110006b7953" } }, "messages": { "links": { "self": "/v1/conversations/58228e05d4e96711004eccb7/messages" } }, "createdBy": { "links": { "self": "/v1/users/58190b991f2932100010d683" }, "data": { "type": "user", "id": "58190b991f2932100010d683" } }, "modifiedBy": { "links": { "self": "/v1/users/58190b991f2932100010d683" }, "data": { "type": "user", "id": "58190b991f2932100010d683" } } }, "links": { "self": "/v1/conversations/58228e05d4e96711004eccb7" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] }, "get": { "security": [ { "httpBearer": [] } ], "tags": [ "Conversations" ], "summary": "Get conversations", "description": "Retrieves a paginated list of conversations for the organization.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.conversation.read|org.permission.conversation.read|", "operationId": "GetConversations", "parameters": [ { "name": "page", "in": "query", "schema": { "type": "number", "default": 1, "example": 1 }, "description": "Number of pages to return for results. Default value: 1." }, { "name": "pageSize", "in": "query", "required": false, "schema": { "type": "number", "default": 100, "example": 100 }, "description": "Number of results to return per page. Default value: 100." }, { "schema": { "type": "string", "example": "desc", "enum": [ "desc" ] }, "in": "query", "name": "sort", "description": "Option to sort the results in descending order." } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "meta": { "type": "object", "properties": { "pageSize": { "type": "integer" }, "page": { "type": "integer" } }, "required": [ "pageSize", "page" ] }, "data": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "name": { "type": "string" }, "channels": { "type": "array", "items": { "type": "string" } }, "status": { "type": "string" }, "messageCount": { "type": "integer" }, "noteCount": { "type": "integer" }, "satisfaction": { "type": "integer" }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "modifiedAt": { "type": "string" }, "tags": { "type": "array" }, "suggestedTags": { "type": "array" }, "sentiment": { "type": "object" }, "lastMessageIn": { "type": "object" }, "assignedUsers": { "type": "array" }, "assignedTeams": { "type": "array" }, "firstResponse": { "type": "object" }, "direction": { "type": "string" }, "outboundMessageCount": { "type": "integer" }, "rev": { "type": "integer" } }, "required": [ "name", "channels", "status", "messageCount", "noteCount", "satisfaction", "createdAt", "updatedAt", "modifiedAt", "tags", "suggestedTags", "sentiment", "lastMessageIn", "assignedUsers", "assignedTeams", "firstResponse", "direction", "outboundMessageCount", "rev" ], "additionalProperties": true }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "customer": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "messages": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "links" ] }, "createdBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "modifiedBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "customer", "messages", "createdBy", "modifiedBy" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "links": { "type": "object", "properties": { "self": { "type": "string" }, "first": { "type": "string" }, "prev": { "type": "string", "nullable": true }, "next": { "type": "string", "nullable": true } }, "required": [ "self", "first", "prev", "next" ] } }, "required": [ "meta", "data", "links" ] }, "example": { "meta": { "pageSize": 100, "page": 1 }, "data": [ { "type": "conversation", "id": "58228e05d4e96711004eccb7", "attributes": { "name": "", "channels": [ "email" ], "status": "done", "messageCount": 0, "noteCount": 0, "satisfaction": 0, "createdAt": "2016-11-09T02:46:29.789Z", "updatedAt": "2016-11-09T03:23:34.064Z", "modifiedAt": "2016-11-09T03:23:34.064Z", "tags": [], "suggestedTags": [], "sentiment": {}, "lastMessageIn": {}, "assignedUsers": [], "assignedTeams": [], "firstResponse": {}, "direction": "in", "outboundMessageCount": 0, "rev": 1 }, "relationships": { "org": { "links": { "self": "/v1/orgs/57f29863a1dbf61100e6aa92" }, "data": { "type": "org", "id": "57f29863a1dbf61100e6aa92" } }, "customer": { "links": { "self": "/v1/customers/58210c3db0f09110006b7953" }, "data": { "type": "customer", "id": "58210c3db0f09110006b7953" } }, "messages": { "links": { "self": "/v1/conversations/58228e05d4e96711004eccb7/messages" } }, "createdBy": { "links": { "self": "/v1/users/58190b991f2932100010d683" }, "data": { "type": "user", "id": "58190b991f2932100010d683" } }, "modifiedBy": { "links": { "self": "/v1/users/58190b991f2932100010d683" }, "data": { "type": "user", "id": "58190b991f2932100010d683" } } }, "links": { "self": "/v1/conversations/58228e05d4e96711004eccb7" } } ], "links": { "self": "/v1/conversations?page=1&pageSize=100", "first": "/v1/conversations?page=1&pageSize=100", "prev": null, "next": null } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] } }, "/conversations/{id}": { "get": { "security": [ { "httpBearer": [] } ], "tags": [ "Conversations" ], "summary": "Get conversation by ID", "description": "Retrieves a single conversation based on the unique conversation ID.\n\nYou can also retrieve multiple conversations with a comma-separated list of IDs.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.conversation.read|org.permission.conversation.read|", "operationId": "GetConversation", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "name": { "type": "string" }, "channels": { "type": "array" }, "status": { "type": "string" }, "messageCount": { "type": "integer" }, "noteCount": { "type": "integer" }, "satisfaction": { "type": "integer" }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "modifiedAt": { "type": "string" }, "tags": { "type": "array" }, "suggestedTags": { "type": "array" }, "sentiment": { "type": "object" }, "lastMessageIn": { "type": "object" }, "assignedUsers": { "type": "array" }, "assignedTeams": { "type": "array" }, "firstResponse": { "type": "object" }, "direction": { "type": "string" }, "outboundMessageCount": { "type": "integer" }, "rev": { "type": "integer" } }, "required": [ "name", "channels", "status", "messageCount", "noteCount", "satisfaction", "createdAt", "updatedAt", "modifiedAt", "tags", "suggestedTags", "sentiment", "lastMessageIn", "assignedUsers", "assignedTeams", "firstResponse", "direction", "outboundMessageCount", "rev" ], "additionalProperties": true }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "customer": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "messages": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "links" ] }, "createdBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "modifiedBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "customer", "messages", "createdBy", "modifiedBy" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "conversation", "id": "58228e05d4e96711004eccb7", "attributes": { "name": "", "channels": [], "status": "done", "messageCount": 0, "noteCount": 0, "satisfaction": 0, "createdAt": "2016-11-09T02:46:29.789Z", "updatedAt": "2016-11-09T03:23:34.064Z", "modifiedAt": "2016-11-09T03:23:34.064Z", "tags": [], "suggestedTags": [], "sentiment": {}, "lastMessageIn": {}, "assignedUsers": [], "assignedTeams": [], "firstResponse": {}, "direction": "in", "outboundMessageCount": 0, "rev": 1 }, "relationships": { "org": { "links": { "self": "/v1/orgs/57f29863a1dbf61100e6aa92" }, "data": { "type": "org", "id": "57f29863a1dbf61100e6aa92" } }, "customer": { "links": { "self": "/v1/customers/58210c3db0f09110006b7953" }, "data": { "type": "customer", "id": "58210c3db0f09110006b7953" } }, "messages": { "links": { "self": "/v1/conversations/58228e05d4e96711004eccb7/messages" } }, "createdBy": { "links": { "self": "/v1/users/58190b991f2932100010d683" }, "data": { "type": "user", "id": "58190b991f2932100010d683" } }, "modifiedBy": { "links": { "self": "/v1/users/58190b991f2932100010d683" }, "data": { "type": "user", "id": "58190b991f2932100010d683" } } }, "links": { "self": "/v1/conversations/58228e05d4e96711004eccb7" } } } } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "properties": { "status": { "type": "string" }, "code": { "type": "string" }, "title": { "type": "string" }, "source": { "type": "object", "properties": { "parameters": { "type": "string" } }, "required": [ "parameters" ] } }, "required": [ "status", "code", "title", "source" ] } } }, "required": [ "errors" ] }, "example": { "errors": [ { "status": "", "code": "", "title": "", "source": { "parameters": "" } }, { "status": "", "code": "", "title": "", "source": { "parameters": "" } } ] } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "properties": { "status": { "type": "string" }, "code": { "type": "string" }, "title": { "type": "string" }, "source": { "type": "object", "properties": { "parameters": { "type": "string" } }, "required": [ "parameters" ] } }, "required": [ "status", "code", "title", "source" ] } } }, "required": [ "errors" ] }, "example": { "errors": [ { "status": "", "code": "", "title": "", "source": { "parameters": "" } }, { "status": "", "code": "", "title": "", "source": { "parameters": "" } } ] } } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "properties": { "status": { "type": "string" }, "code": { "type": "string" }, "title": { "type": "string" }, "source": { "type": "object", "properties": { "parameters": { "type": "string" } }, "required": [ "parameters" ] } }, "required": [ "status", "code", "title", "source" ] } } }, "required": [ "errors" ] }, "example": { "errors": [ { "status": "", "code": "", "title": "", "source": { "parameters": "" } }, { "status": "", "code": "", "title": "", "source": { "parameters": "" } } ] } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] }, "put": { "security": [ { "httpBearer": [] } ], "tags": [ "Conversations" ], "summary": "Update conversation", "description": "Updates a conversation based on the unique conversation ID.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.conversation.write|org.permission.conversation.update|\n\n### Note\n>This endpoint is subject to Object Rate Limiting, which limits how many updates a single user can make to a single conversation. To learn more, see [Rate limiting](https://developer.kustomer.com/kustomer-api-docs/reference/rate-limiting).\n\n### Custom Attributes\n[Custom attributes](https://help.kustomer.com/define-attributes-Skr924HI) are optional and allow you to specify\ncustom key-value pairs.\n\nKustomer uses a naming convention for custom attributes to specify the field data type with a name suffix:\n\n#### Naming Suffix\n\n* `Num` *number* or *null*\n* `At` *date-time* or *null*\n* `Str` *string* or *null*, length: [ 0 .. 1024 ] characters\n* `Txt` *string* or *null*, length: [ 0 .. 1024 ] characters\n* `Bool` *boolean* or *null*\n* `Url` *string* or *null*, format: *uri*", "operationId": "UpdateConversation", "parameters": [ { "name": "id", "in": "path", "description": "Unique ID of the conversation.", "required": true, "style": "simple", "schema": { "type": "string", "example": "58228e05d4e96711004eccb7" } }, { "name": "replace", "in": "query", "required": false, "schema": { "type": "boolean", "example": true, "default": false }, "description": "Set to `true` to update the document. Otherwise, performs the same update as a PATCH request. Default value: `false`." } ], "requestBody": { "description": "", "content": { "application/json": { "schema": { "oneOf": [ { "type": "object", "properties": { "externalId": { "type": "string", "maxLength": 256, "nullable": true }, "name": { "type": "string", "maxLength": 256, "nullable": true }, "direction": { "type": "string", "enum": [ "in", "out" ] }, "priority": { "type": "integer", "minimum": 1, "maximum": 5 }, "satisfaction": { "type": "number", "minimum": -1, "maximum": 1, "nullable": true }, "satisfactionLevel": { "type": "object", "properties": { "form": { "type": "string", "format": "object-id" }, "formResponse": { "type": "string", "format": "object-id" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "status": { "type": "string", "enum": [ "scheduled", "offered", "rated", "commented", "canceled", "unresponded" ] }, "scheduledFor": { "type": "string", "format": "date-time" }, "firstAnswer": { "type": "string", "maxLength": 1024 }, "sentAt": { "type": "string", "format": "date-time" }, "score": { "type": "number", "enum": [ 0, 1 ] }, "rating": { "type": "integer", "minimum": 0, "maximum": 10 }, "channel": { "type": "string", "enum": [ "email", "sms", "chat", "facebook", "twitter-dm", "twitter-tweet", "voice", "instagram", "instagram-comment", "whatsapp", "form" ] }, "sentBy": { "type": "string", "format": "object-id" }, "sentByTeams": { "type": "array", "items": { "type": "string", "format": "object-id" } } }, "required": [ "createdAt", "status" ], "additionalProperties": false }, "suggestedShortcuts": { "type": "array", "items": { "type": "object", "properties": { "shortcutId": { "type": "string" }, "confidence": { "type": "number", "minimum": -1, "maximum": 1 } }, "required": [ "shortcutId", "confidence" ] } }, "status": { "type": "string", "enum": [ "open", "snoozed", "done" ] }, "replyChannel": { "type": "string", "maxLength": 256, "nullable": true }, "subStatus": { "type": "string", "format": "object-id" }, "snooze": { "type": "object", "properties": { "time": { "type": "string", "format": "date-time" }, "status": { "type": "string", "enum": [ "scheduled", "canceled", "elapsed" ] } }, "required": [ "status" ], "additionalProperties": false }, "tags": { "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 64, "pattern": "^[0-9a-zA-ZÀ-ÿ_/<>\\-.]{1}[0-9a-zA-ZÀ-ÿ _/<>\\-.]{0,63}$" }, "maxItems": 20, "uniqueItems": true }, "suggestedTags": { "type": "array", "items": { "type": "object", "properties": { "tag": { "type": "string", "minLength": 1, "maxLength": 64, "pattern": "^[0-9a-zA-ZÀ-ÿ_/<>\\-.]{1}[0-9a-zA-ZÀ-ÿ _/<>\\-.]{0,63}$" }, "confidence": { "type": "number" } }, "required": [ "tag", "confidence" ] }, "maxItems": 20, "uniqueItems": true }, "sentiment": { "type": "object", "properties": { "polarity": { "type": "number", "enum": [ -1, 0, 1 ] }, "confidence": { "type": "number", "minimum": -1, "maximum": 1 } }, "required": [ "polarity", "confidence" ], "additionalProperties": false }, "assignedUsers": { "type": "array", "items": { "type": "string", "format": "object-id" }, "maxItems": 10, "uniqueItems": true }, "assignedTeams": { "type": "array", "items": { "type": "string", "format": "object-id" }, "maxItems": 10, "uniqueItems": true }, "custom": { "type": "object", "maxProperties": 100, "additionalProperties": false }, "deleted": { "type": "boolean", "nullable": true }, "ended": { "type": "boolean" }, "endedAt": { "type": "string", "format": "date-time" }, "endedReason": { "type": "string", "maxLength": 128 }, "endedBy": { "type": "string", "format": "object-id" }, "endedByType": { "type": "string", "enum": [ "user", "customer" ] }, "locked": { "type": "boolean" }, "rev": { "type": "number" }, "defaultLang": { "type": "string", "maxLength": 100, "nullable": true }, "queue": { "oneOf": [ { "type": "object", "properties": { "id": { "type": "string", "format": "object-id" }, "external": { "type": "string", "enum": [ "amazon-connect" ], "nullable": true } }, "anyOf": [ { "required": [ "id" ] }, { "required": [ "external" ] } ], "additionalProperties": false }, { "type": "object", "properties": { "id": { "type": "string", "nullable": true }, "external": { "type": "string", "enum": [ "amazon-connect" ], "nullable": true } }, "anyOf": [ { "required": [ "id" ] }, { "required": [ "external" ] } ], "additionalProperties": false } ] } }, "additionalProperties": false }, { "type": "object", "properties": { "customer": { "type": "string", "format": "object-id" } }, "additionalProperties": false } ] } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "name": { "type": "string" }, "channels": { "type": "array" }, "status": { "type": "string" }, "messageCount": { "type": "integer" }, "noteCount": { "type": "integer" }, "satisfaction": { "type": "integer" }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "modifiedAt": { "type": "string" }, "tags": { "type": "array" }, "suggestedTags": { "type": "array" }, "sentiment": { "type": "object" }, "lastMessageIn": { "type": "object" }, "assignedUsers": { "type": "array" }, "assignedTeams": { "type": "array" }, "firstResponse": { "type": "object" }, "direction": { "type": "string" }, "outboundMessageCount": { "type": "integer" }, "rev": { "type": "integer" } }, "required": [ "name", "channels", "status", "messageCount", "noteCount", "satisfaction", "createdAt", "updatedAt", "modifiedAt", "tags", "suggestedTags", "sentiment", "lastMessageIn", "assignedUsers", "assignedTeams", "firstResponse", "direction", "outboundMessageCount", "rev" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "customer": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "messages": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "links" ] }, "createdBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "modifiedBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "customer", "messages", "createdBy", "modifiedBy" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "conversation", "id": "58228e05d4e96711004eccb7", "attributes": { "name": "", "channels": [], "status": "done", "messageCount": 0, "noteCount": 0, "satisfaction": 0, "createdAt": "2016-11-09T02:46:29.789Z", "updatedAt": "2016-11-09T03:23:34.064Z", "modifiedAt": "2016-11-09T03:23:34.064Z", "tags": [], "suggestedTags": [], "sentiment": {}, "lastMessageIn": {}, "assignedUsers": [], "assignedTeams": [], "firstResponse": {}, "direction": "in", "outboundMessageCount": 0, "rev": 1 }, "relationships": { "org": { "links": { "self": "/v1/orgs/57f29863a1dbf61100e6aa92" }, "data": { "type": "org", "id": "57f29863a1dbf61100e6aa92" } }, "customer": { "links": { "self": "/v1/customers/58210c3db0f09110006b7953" }, "data": { "type": "customer", "id": "58210c3db0f09110006b7953" } }, "messages": { "links": { "self": "/v1/conversations/58228e05d4e96711004eccb7/messages" } }, "createdBy": { "links": { "self": "/v1/users/58190b991f2932100010d683" }, "data": { "type": "user", "id": "58190b991f2932100010d683" } }, "modifiedBy": { "links": { "self": "/v1/users/58190b991f2932100010d683" }, "data": { "type": "user", "id": "58190b991f2932100010d683" } } }, "links": { "self": "/v1/conversations/58228e05d4e96711004eccb7" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] }, "patch": { "security": [ { "httpBearer": [] } ], "tags": [ "Conversations" ], "summary": "Update conversation attributes", "description": "Updates the data attributes of a conversation based the unique conversation ID.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.conversation.write|org.permission.conversation.update|\n\n### Note\n>This endpoint is subject to Object Rate Limiting, which limits how many updates a single user can make to a single company attribute. To learn more, see [Rate limiting](https://developer.kustomer.com/kustomer-api-docs/reference/rate-limiting).\n\n### Custom Attributes\n[Custom attributes](https://help.kustomer.com/define-attributes-Skr924HI) are optional and allow you to specify\ncustom key-value pairs.\n\nKustomer uses a naming convention for custom attributes to specify the field data type with a name suffix:\n\n#### Naming Suffix\n\n* `Num` *number* or *null*\n* `At` *date-time* or *null*\n* `Str` *string* or *null*, length: [ 0 .. 1024 ] characters\n* `Txt` *string* or *null*, length: [ 0 .. 1024 ] characters\n* `Bool` *boolean* or *null*\n* `Url` *string* or *null*, format: *uri*", "operationId": "UpdateConversationAttributes", "parameters": [ { "name": "id", "in": "path", "description": "Unique ID of the conversation.", "required": true, "style": "simple", "schema": { "type": "string", "example": "58228e05d4e96711004eccb7" } } ], "requestBody": { "description": "", "content": { "application/json-patch+json": { "schema": { "oneOf": [ { "type": "object", "properties": { "externalId": { "type": "string", "maxLength": 256, "nullable": true }, "name": { "type": "string", "maxLength": 256, "nullable": true }, "direction": { "type": "string", "enum": [ "in", "out" ] }, "priority": { "type": "integer", "minimum": 1, "maximum": 5 }, "satisfaction": { "type": "number", "minimum": -1, "maximum": 1, "nullable": true }, "satisfactionLevel": { "type": "object", "properties": { "form": { "type": "string", "format": "object-id" }, "formResponse": { "type": "string", "format": "object-id" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "status": { "type": "string", "enum": [ "scheduled", "offered", "rated", "commented", "canceled", "unresponded" ] }, "scheduledFor": { "type": "string", "format": "date-time" }, "firstAnswer": { "type": "string", "maxLength": 1024 }, "sentAt": { "type": "string", "format": "date-time" }, "score": { "type": "number", "enum": [ 0, 1 ] }, "rating": { "type": "integer", "minimum": 0, "maximum": 10 }, "channel": { "type": "string", "enum": [ "email", "sms", "chat", "facebook", "twitter-dm", "twitter-tweet", "voice", "instagram", "instagram-comment", "whatsapp", "form" ] }, "sentBy": { "type": "string", "format": "object-id" }, "sentByTeams": { "type": "array", "items": { "type": "string", "format": "object-id" } } }, "required": [ "createdAt", "status" ], "additionalProperties": false }, "suggestedShortcuts": { "type": "array", "items": { "type": "object", "properties": { "shortcutId": { "type": "string" }, "confidence": { "type": "number", "minimum": -1, "maximum": 1 } }, "required": [ "shortcutId", "confidence" ] } }, "status": { "type": "string", "enum": [ "open", "snoozed", "done" ] }, "replyChannel": { "type": "string", "maxLength": 256, "nullable": true }, "subStatus": { "type": "string", "format": "object-id" }, "snooze": { "type": "object", "properties": { "time": { "type": "string", "format": "date-time" }, "status": { "type": "string", "enum": [ "scheduled", "canceled", "elapsed" ] } }, "required": [ "status" ], "additionalProperties": false }, "tags": { "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 64, "pattern": "^[0-9a-zA-ZÀ-ÿ_/<>\\-.]{1}[0-9a-zA-ZÀ-ÿ _/<>\\-.]{0,63}$" }, "maxItems": 20, "uniqueItems": true }, "suggestedTags": { "type": "array", "items": { "type": "object", "properties": { "tag": { "type": "string", "minLength": 1, "maxLength": 64, "pattern": "^[0-9a-zA-ZÀ-ÿ_/<>\\-.]{1}[0-9a-zA-ZÀ-ÿ _/<>\\-.]{0,63}$" }, "confidence": { "type": "number" } }, "required": [ "tag", "confidence" ] }, "maxItems": 20, "uniqueItems": true }, "sentiment": { "type": "object", "properties": { "polarity": { "type": "number", "enum": [ -1, 0, 1 ] }, "confidence": { "type": "number", "minimum": -1, "maximum": 1 } }, "required": [ "polarity", "confidence" ], "additionalProperties": false }, "assignedUsers": { "type": "array", "items": { "type": "string", "format": "object-id" }, "maxItems": 10, "uniqueItems": true }, "assignedTeams": { "type": "array", "items": { "type": "string", "format": "object-id" }, "maxItems": 10, "uniqueItems": true }, "custom": { "type": "object", "maxProperties": 100, "additionalProperties": false }, "deleted": { "type": "boolean", "nullable": true }, "ended": { "type": "boolean" }, "endedAt": { "type": "string", "format": "date-time" }, "endedReason": { "type": "string", "maxLength": 128 }, "endedBy": { "type": "string", "format": "object-id" }, "endedByType": { "type": "string", "enum": [ "user", "customer" ] }, "locked": { "type": "boolean" }, "rev": { "type": "number" }, "defaultLang": { "type": "string", "maxLength": 100, "nullable": true }, "queue": { "oneOf": [ { "type": "object", "properties": { "id": { "type": "string", "format": "object-id" }, "external": { "type": "string", "enum": [ "amazon-connect" ], "nullable": true } }, "anyOf": [ { "required": [ "id" ] }, { "required": [ "external" ] } ], "additionalProperties": false }, { "type": "object", "properties": { "id": { "type": "string", "nullable": true }, "external": { "type": "string", "enum": [ "amazon-connect" ], "nullable": true } }, "anyOf": [ { "required": [ "id" ] }, { "required": [ "external" ] } ], "additionalProperties": false } ] } }, "additionalProperties": false }, { "type": "object", "properties": { "customer": { "type": "string", "format": "object-id" } }, "additionalProperties": false } ] } } } }, "responses": { "200": { "description": "Success", "content": { "application/json-patch+json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "name": { "type": "string" }, "channels": { "type": "array" }, "status": { "type": "string" }, "messageCount": { "type": "integer" }, "noteCount": { "type": "integer" }, "satisfaction": { "type": "integer" }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "modifiedAt": { "type": "string" }, "tags": { "type": "array" }, "suggestedTags": { "type": "array" }, "sentiment": { "type": "object" }, "lastMessageIn": { "type": "object" }, "assignedUsers": { "type": "array" }, "assignedTeams": { "type": "array" }, "firstResponse": { "type": "object" }, "direction": { "type": "string" }, "outboundMessageCount": { "type": "integer" }, "externalQueue": { "type": "string" }, "rev": { "type": "integer" } }, "required": [ "name", "channels", "status", "messageCount", "noteCount", "satisfaction", "createdAt", "updatedAt", "modifiedAt", "tags", "suggestedTags", "sentiment", "lastMessageIn", "assignedUsers", "assignedTeams", "firstResponse", "direction", "outboundMessageCount", "externalQueue", "rev" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "customer": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "messages": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "links" ] }, "createdBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "modifiedBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "customer", "messages", "createdBy", "modifiedBy" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "conversation", "id": "58228e05d4e96711004eccb7", "attributes": { "name": "Foobar", "channels": [], "status": "done", "messageCount": 0, "noteCount": 0, "satisfaction": 0, "createdAt": "2016-11-09T02:46:29.789Z", "updatedAt": "2016-11-09T03:23:34.064Z", "modifiedAt": "2016-11-09T03:23:34.064Z", "tags": [], "suggestedTags": [], "sentiment": {}, "lastMessageIn": {}, "assignedUsers": [], "assignedTeams": [], "firstResponse": {}, "direction": "in", "outboundMessageCount": 0, "externalQueue": "amazon-connect", "rev": 1 }, "relationships": { "org": { "links": { "self": "/v1/orgs/57f29863a1dbf61100e6aa92" }, "data": { "type": "org", "id": "57f29863a1dbf61100e6aa92" } }, "customer": { "links": { "self": "/v1/customers/58210c3db0f09110006b7953" }, "data": { "type": "customer", "id": "58210c3db0f09110006b7953" } }, "messages": { "links": { "self": "/v1/conversations/58228e05d4e96711004eccb7/messages" } }, "createdBy": { "links": { "self": "/v1/users/58190b991f2932100010d683" }, "data": { "type": "user", "id": "58190b991f2932100010d683" } }, "modifiedBy": { "links": { "self": "/v1/users/58190b991f2932100010d683" }, "data": { "type": "user", "id": "58190b991f2932100010d683" } } }, "links": { "self": "/v1/conversations/58228e05d4e96711004eccb7" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] }, "delete": { "security": [ { "httpBearer": [] } ], "tags": [ "Conversations" ], "summary": "Delete conversation", "description": "Delete a conversation based on the unique conversation ID.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.conversation.delete|org.permission.conversation.delete|", "operationId": "DeleteConversation", "parameters": [ { "name": "id", "in": "path", "description": "Unique ID of the conversation.", "required": true, "style": "simple", "schema": { "type": "string", "example": "58228e05d4e96711004eccb7" } } ], "responses": { "204": { "description": "No Content", "content": { "text/plain": { "example": "" } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] }, "parameters": [ { "schema": { "type": "string", "example": "58228e05d4e96711004eccb7" }, "name": "id", "in": "path", "description": "Unique ID of the conversation.", "required": true } ] }, "/conversations/externalId={externalId}": { "get": { "security": [ { "httpBearer": [] } ], "tags": [ "Conversations" ], "summary": "Get conversation by external ID", "description": "Retrieves a single conversation based on a unique external ID.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.conversation.read|org.permission.conversation.read|", "operationId": "GetConversationByExternalId", "parameters": [ { "name": "externalId", "in": "path", "description": "Unique external ID of the conversation", "required": true, "style": "simple", "schema": { "type": "string", "example": "foobar" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "externalId": { "type": "string" }, "name": { "type": "string" }, "channels": { "type": "array" }, "status": { "type": "string" }, "messageCount": { "type": "integer" }, "noteCount": { "type": "integer" }, "satisfaction": { "type": "integer" }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "modifiedAt": { "type": "string" }, "tags": { "type": "array" }, "suggestedTags": { "type": "array" }, "sentiment": { "type": "object" }, "lastMessageIn": { "type": "object" }, "assignedUsers": { "type": "array" }, "assignedTeams": { "type": "array" }, "firstResponse": { "type": "object" }, "direction": { "type": "string" }, "outboundMessageCount": { "type": "integer" }, "rev": { "type": "integer" } }, "required": [ "externalId", "name", "channels", "status", "messageCount", "noteCount", "satisfaction", "createdAt", "updatedAt", "modifiedAt", "tags", "suggestedTags", "sentiment", "lastMessageIn", "assignedUsers", "assignedTeams", "firstResponse", "direction", "outboundMessageCount", "rev" ], "additionalProperties": true }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "customer": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "messages": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "links" ] }, "createdBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "modifiedBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "customer", "messages", "createdBy", "modifiedBy" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "conversation", "id": "58228e05d4e96711004eccb7", "attributes": { "externalId": "foobar", "name": "", "channels": [], "status": "done", "messageCount": 0, "noteCount": 0, "satisfaction": 0, "createdAt": "2016-11-09T02:46:29.789Z", "updatedAt": "2016-11-09T03:23:34.064Z", "modifiedAt": "2016-11-09T03:23:34.064Z", "tags": [], "suggestedTags": [], "sentiment": {}, "lastMessageIn": {}, "assignedUsers": [], "assignedTeams": [], "firstResponse": {}, "direction": "in", "outboundMessageCount": 0, "rev": 1 }, "relationships": { "org": { "links": { "self": "/v1/orgs/57f29863a1dbf61100e6aa92" }, "data": { "type": "org", "id": "57f29863a1dbf61100e6aa92" } }, "customer": { "links": { "self": "/v1/customers/58210c3db0f09110006b7953" }, "data": { "type": "customer", "id": "58210c3db0f09110006b7953" } }, "messages": { "links": { "self": "/v1/conversations/58228e05d4e96711004eccb7/messages" } }, "createdBy": { "links": { "self": "/v1/users/58190b991f2932100010d683" }, "data": { "type": "user", "id": "58190b991f2932100010d683" } }, "modifiedBy": { "links": { "self": "/v1/users/58190b991f2932100010d683" }, "data": { "type": "user", "id": "58190b991f2932100010d683" } } }, "links": { "self": "/v1/conversations/58228e05d4e96711004eccb7" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] }, "parameters": [ { "schema": { "type": "string", "example": "foobar" }, "name": "externalId", "in": "path", "required": true, "description": "Unique external ID of the conversation" } ] }, "/conversations/{id}/attachments": { "get": { "security": [ { "httpBearer": [] } ], "tags": [ "Conversations", "Attachments" ], "summary": "Get conversation attachments", "description": "Retrieves a paginated list of conversation attachments.\n\nAny attachment shared in a conversation via inbound and outbound messages.\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.attachment.read|org.permission.attachment.read|", "operationId": "GetConversationAttachments", "parameters": [ { "name": "id", "in": "path", "description": "Unique ID of the conversation.", "required": true, "style": "simple", "schema": { "type": "string", "example": "58228e05d4e96711004eccb7" } }, { "name": "page", "in": "query", "schema": { "type": "number", "default": 1, "example": 1 }, "description": "Number of pages to return for results. Default value: 1." }, { "name": "pageSize", "in": "query", "required": false, "schema": { "type": "number", "default": 100, "example": 100 }, "description": "Number of results to return per page. Default value: 100." } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string" }, "attributes": { "type": "object", "properties": { "name": { "type": "string" }, "contentType": { "type": "string" }, "contentLength": { "type": "integer" }, "redacted": { "type": "boolean" } }, "required": [ "name", "contentType", "contentLength", "redacted" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "message": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "message" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" }, "related": { "type": "string" } }, "required": [ "self", "related" ] } } }, "required": [ "id", "type", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "meta": {}, "data": [ { "type": "attachment", "attributes": { "name": "example.jpg", "contentType": "image/jpeg", "contentLength": 98153, "redacted": false }, "relationships": { "org": { "links": { "self": "/v1/orgs/5d5dae1ccd1e87001a6a7ea4" }, "data": { "type": "org", "id": "5d5dae1ccd1e87001a6a7ea4" } }, "message": { "links": { "self": "/v1/messages/5e0e14a7af4e8c001a084dba" }, "data": { "type": "message", "id": "5e0e14a7af4e8c001a084dba" } } }, "links": { "self": "/v1/messages/5e0e14a7af4e8c001a084dba/attachments/5e0e14c103a4e80018b374aa", "related": "https://kustomer-prod1-attachments.s3.amazonaws.com/attachments/5d5dae1ccd1e87001a6a7ea4/5e0e14c103a4e80018b374aa-example.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=credential-example%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20200102T161544Z&X-Amz-Expires=600&X-Amz-Security-Token=securitytoken=attachment" } }, { "type": "attachment", "attributes": { "name": "example2.jpg", "contentType": "image/jpeg", "contentLength": 98153, "redacted": false }, "relationships": { "org": { "links": { "self": "/v1/orgs/5d5dae1ccd1e87001a6a7ea4" }, "data": { "type": "org", "id": "5d5dae1ccd1e87001a6a7ea4" } }, "message": { "links": { "self": "/v1/messages/5e0e14a7af4e8c001a084dbb" }, "data": { "type": "message", "id": "5e0e14a7af4e8c001a084dbb" } } }, "links": { "self": "/v1/messages/5e0e14a7af4e8c001a084dbb/attachments/5e0e14c103a4e80018b374ab", "related": "https://kustomer-prod1-attachments.s3.amazonaws.com/attachments/5d5dae1ccd1e87001a6a7ea4/5e0e14c103a4e80018b374ab-example2.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=credential-example%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20200102T161544Z&X-Amz-Expires=600&X-Amz-Security-Token=securitytoken=attachment" } } ], "links": { "self": "/v1/conversations/58228e05d4e96711004eccb7/attachments?page=1&pageSize=100", "first": "/v1/conversations/58228e05d4e96711004eccb7/attachments?page=1&pageSize=100", "prev": null, "next": null } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] } }, "/conversations/{id}/events": { "get": { "security": [ { "httpBearer": [] } ], "tags": [ "Conversations" ], "summary": "Get conversation events", "description": "Retrieves a paginated list of conversation events based on the unique ID of the conversation.\n\nYou can use the `name` and/or `changed` query parameters to filter the results.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.event.read|org.permission.event.read|", "operationId": "GetConversationEvents", "parameters": [ { "name": "id", "in": "path", "description": "Unique ID of the conversation.", "required": true, "style": "simple", "schema": { "type": "string", "example": "58228e05d4e96711004eccb7" } }, { "name": "page", "in": "query", "schema": { "type": "number", "default": 1, "example": 1 }, "description": "Number of pages to return for results. Default value: 1." }, { "name": "pageSize", "in": "query", "required": false, "schema": { "type": "number", "default": 100, "example": 100 }, "description": "Number of results to return per page. Default value: 100." }, { "schema": { "type": "string", "example": "eventName" }, "in": "query", "name": "sort", "description": "Option to sort results in ascending or descending order." } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "meta": { "type": "object" }, "data": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "name": { "type": "string" }, "type": { "type": "string" }, "publishedAt": { "type": "string" }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "modifiedAt": { "type": "string" }, "changes": { "type": "object", "properties": { "attributes": { "type": "object", "properties": { "updatedAt": { "type": "object", "properties": { "op": { "type": "string" }, "before": { "type": "string" }, "after": { "type": "string" } }, "required": [ "op", "before", "after" ] }, "modifiedAt": { "type": "object", "properties": { "op": { "type": "string" }, "before": { "type": "string" }, "after": { "type": "string" } }, "required": [ "op", "before", "after" ] } } }, "relationships": { "type": "object", "properties": { "customer": { "type": "object", "properties": { "op": { "type": "string" }, "before": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "after": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "op", "before", "after" ] } } } }, "required": [ "attributes", "relationships" ] }, "location": { "type": "string", "nullable": true }, "meta": { "type": "string", "nullable": true } }, "required": [ "name", "type", "publishedAt", "createdAt", "updatedAt", "modifiedAt", "location", "meta" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "createdBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "modifiedBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "customer": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "conversation": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "createdBy", "modifiedBy", "customer", "conversation" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "links": { "type": "object", "properties": { "self": { "type": "string" }, "first": { "type": "string" }, "prev": { "type": "string", "nullable": true }, "next": { "type": "string", "nullable": true } }, "required": [ "self", "first", "prev", "next" ] } }, "required": [ "meta", "data", "links" ] }, "example": { "meta": {}, "data": [ { "type": "customer_event", "id": "5822bab3aa5f92110005d6b5", "attributes": { "name": "kustomer.conversation.update", "type": "conversation", "publishedAt": "2016-11-09T05:57:07.066Z", "createdAt": "2016-11-09T02:46:29.789Z", "updatedAt": "2016-11-09T03:23:34.064Z", "modifiedAt": "2016-11-09T03:23:34.064Z", "changes": { "attributes": {}, "relationships": { "customer": { "op": "replace", "before": { "links": { "self": "/v1/customers/5822ba88d4e96711004eccd5" }, "data": { "type": "customer", "id": "5822ba88d4e96711004eccd5" } }, "after": { "links": { "self": "/v1/customers/58210c3db0f09110006b7953" }, "data": { "type": "customer", "id": "58210c3db0f09110006b7953" } } } } }, "location": null, "meta": null }, "relationships": { "org": { "links": { "self": "/v1/orgs/57f29863a1dbf61100e6aa92" }, "data": { "type": "org", "id": "57f29863a1dbf61100e6aa92" } }, "createdBy": { "links": { "self": "/v1/users/58190b991f2932100010d683" }, "data": { "type": "user", "id": "58190b991f2932100010d683" } }, "modifiedBy": { "links": { "self": "/v1/users/58190b991f2932100010d683" }, "data": { "type": "user", "id": "58190b991f2932100010d683" } }, "customer": { "links": { "self": "/v1/customers/58210c3db0f09110006b7953" }, "data": { "type": "customer", "id": "58210c3db0f09110006b7953" } }, "conversation": { "links": { "self": "/v1/conversations/58228e05d4e96711004eccb7" }, "data": { "type": "conversation", "id": "58228e05d4e96711004eccb7" } } }, "links": { "self": "/v1/customers/58210c3db0f09110006b7953/events/5822bab3aa5f92110005d6b5" } }, { "type": "customer_event", "id": "582296b6aa5f92110005d68d", "attributes": { "name": "kustomer.conversation.update", "type": "conversation", "publishedAt": "2016-11-09T03:23:34.083Z", "createdAt": "2016-11-09T02:46:29.789Z", "updatedAt": "2016-11-09T03:23:34.064Z", "modifiedAt": "2016-11-09T03:23:34.064Z", "changes": { "attributes": { "updatedAt": { "op": "replace", "before": "2016-11-09T02:46:29.789Z", "after": "2016-11-09T03:23:34.064Z" }, "modifiedAt": { "op": "replace", "before": "2016-11-09T02:46:29.789Z", "after": "2016-11-09T03:23:34.064Z" } }, "relationships": {} }, "location": null, "meta": null }, "relationships": { "org": { "links": { "self": "/v1/orgs/57f29863a1dbf61100e6aa92" }, "data": { "type": "org", "id": "57f29863a1dbf61100e6aa92" } }, "createdBy": { "links": { "self": "/v1/users/58190b991f2932100010d683" }, "data": { "type": "user", "id": "58190b991f2932100010d683" } }, "modifiedBy": { "links": { "self": "/v1/users/58190b991f2932100010d683" }, "data": { "type": "user", "id": "58190b991f2932100010d683" } }, "customer": { "links": { "self": "/v1/customers/58210c3db0f09110006b7953" }, "data": { "type": "customer", "id": "58210c3db0f09110006b7953" } }, "conversation": { "links": { "self": "/v1/conversations/58228e05d4e96711004eccb7" }, "data": { "type": "conversation", "id": "58228e05d4e96711004eccb7" } } }, "links": { "self": "/v1/customers/58210c3db0f09110006b7953/events/582296b6aa5f92110005d68d" } }, { "type": "customer_event", "id": "58228e05d4e96711004eccb8", "attributes": { "name": "kustomer.conversation.create", "type": "conversation", "publishedAt": "2016-11-09T02:46:29.839Z", "createdAt": "2016-11-09T02:46:29.789Z", "updatedAt": "2016-11-09T02:46:29.789Z", "modifiedAt": "2016-11-09T02:46:29.789Z", "location": null, "meta": null }, "relationships": { "org": { "links": { "self": "/v1/orgs/57f29863a1dbf61100e6aa92" }, "data": { "type": "org", "id": "57f29863a1dbf61100e6aa92" } }, "createdBy": { "links": { "self": "/v1/users/58190b991f2932100010d683" }, "data": { "type": "user", "id": "58190b991f2932100010d683" } }, "modifiedBy": { "links": { "self": "/v1/users/58190b991f2932100010d683" }, "data": { "type": "user", "id": "58190b991f2932100010d683" } }, "customer": { "links": { "self": "/v1/customers/58210c3db0f09110006b7953" }, "data": { "type": "customer", "id": "58210c3db0f09110006b7953" } }, "conversation": { "links": { "self": "/v1/conversations/58228e05d4e96711004eccb7" }, "data": { "type": "conversation", "id": "58228e05d4e96711004eccb7" } } }, "links": { "self": "/v1/customers/58210c3db0f09110006b7953/events/58228e05d4e96711004eccb8" } } ], "links": { "self": "/v1/conversations/58228e05d4e96711004eccb7/events?page=1&pageSize=100", "first": "/v1/conversations/58228e05d4e96711004eccb7/events?page=1&pageSize=100", "prev": null, "next": null } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] } }, "/conversations/bulk": { "post": { "security": [ { "httpBearer": [] } ], "tags": [ "Conversations (Bulk)" ], "summary": "Bulk create conversations", "description": "Create conversations in bulk.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.conversation.write|org.permission.conversation.create|", "operationId": "BulkCreateConversations", "parameters": [], "requestBody": { "description": "", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "format": "object-id" }, "customer": { "type": "string", "format": "object-id" }, "externalId": { "type": "string", "maxLength": 256 }, "name": { "type": "string", "maxLength": 256 }, "status": { "type": "string", "enum": [ "open", "done" ] }, "priority": { "type": "integer", "minimum": 1, "maximum": 5 }, "createdAt": { "type": "string", "format": "date-time" }, "importedAt": { "type": "string", "format": "date-time" }, "direction": { "type": "string", "enum": [ "in", "out" ] }, "replyChannel": { "type": "string", "maxLength": 256, "nullable": true }, "tags": { "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 64, "pattern": "^[0-9a-zA-ZÀ-ÿ_/<>\\-.]{1}[0-9a-zA-ZÀ-ÿ _/<>\\-.]{0,63}$" }, "maxItems": 20, "uniqueItems": true }, "assignedUsers": { "type": "array", "items": { "type": "string", "format": "object-id" }, "maxItems": 10, "uniqueItems": true }, "assignedTeams": { "type": "array", "items": { "type": "string", "format": "object-id" }, "maxItems": 10, "uniqueItems": true }, "custom": { "type": "object", "maxProperties": 100, "additionalProperties": false }, "defaultLang": { "type": "string", "maxLength": 100, "nullable": true }, "queue": { "type": "object", "properties": { "id": { "type": "string", "nullable": true }, "external": { "type": "string", "enum": [ "amazon-connect" ], "nullable": true } }, "anyOf": [ { "required": [ "id" ] }, { "required": [ "external" ] } ], "additionalProperties": false } }, "required": [ "customer" ], "additionalProperties": false }, "maxItems": 100 } } } }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "ids": { "type": "array" }, "context": { "type": "string" }, "status": { "type": "string" }, "v2": { "type": "boolean" }, "payload": { "type": "object", "properties": { "api": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "externalId": { "type": "string" }, "name": { "type": "string" } }, "required": [ "externalId", "name" ] } }, "path": { "type": "string" }, "user": { "type": "object", "properties": { "id": { "type": "string" }, "userType": { "type": "string" }, "roles": { "type": "array", "items": { "type": "string" } }, "orgName": { "type": "string" }, "subject": { "type": "string" }, "org": { "type": "string" } }, "required": [ "id", "userType", "roles", "orgName", "subject", "org" ] }, "requestId": { "type": "string" }, "service": { "type": "string" }, "method": { "type": "string" } }, "required": [ "data", "path", "user", "requestId", "service", "method" ] } }, "required": [ "api" ] }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "completed": { "type": "boolean" } }, "required": [ "ids", "context", "status", "v2", "payload", "createdAt", "updatedAt", "completed" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "createdBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "createdBy" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "bulk", "id": "5b3bddb67f8469003df370a4", "attributes": { "ids": [], "context": "api.sobjects.conversations.bulk-create", "status": "complete", "v2": true, "payload": { "api": { "data": [ { "externalId": "convo1", "name": "Convo1" }, { "externalId": "convo2", "name": "Convo2" } ], "path": "/v1/conversations", "user": { "id": "5a96dac46dd73800112fab30", "userType": "user", "roles": [ "org" ], "orgName": "mycompany", "subject": "5a96dac46dd73800112fab30", "org": "5a96dac36dd73800112fab2e" }, "requestId": "5b3bddb6b6e494001779fa38", "service": "sobjects", "method": "POST" } }, "createdAt": "2018-07-03T20:33:58.486Z", "updatedAt": "2018-07-03T20:34:03.873Z", "completed": true }, "relationships": { "org": { "links": { "self": "/v1/orgs/5a96dac36dd73800112fab2e" }, "data": { "type": "org", "id": "5a96dac36dd73800112fab2e" } }, "createdBy": { "links": { "self": "/v1/users/5a96dac46dd73800112fab30" }, "data": { "type": "user", "id": "5a96dac46dd73800112fab30" } } }, "links": { "self": "/v1/bulk/5b3bddb67f8469003df370a4" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] }, "put": { "security": [ { "httpBearer": [] } ], "tags": [ "Conversations (Bulk)" ], "summary": "Bulk batch update conversations", "description": "Updates a bulk batch of conversations.\n\nUse the `ids` query param to update multiple conversations in bulk with the same data.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.conversation.write|org.permission.conversation.update|", "operationId": "BulkBatchUpdateConversations", "parameters": [ { "schema": { "type": "string", "example": "id1,id2" }, "in": "query", "name": "ids", "description": "Comma-separated list of unique conversation IDs." } ], "requestBody": { "description": "", "content": { "application/json": { "schema": { "type": "array", "items": { "oneOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "externalId": { "type": "string", "maxLength": 256, "nullable": true }, "name": { "type": "string", "maxLength": 256, "nullable": true }, "direction": { "type": "string", "enum": [ "in", "out" ] }, "priority": { "type": "integer", "minimum": 1, "maximum": 5 }, "satisfaction": { "type": "number", "minimum": -1, "maximum": 1, "nullable": true }, "status": { "type": "string", "enum": [ "open", "snoozed", "done" ] }, "replyChannel": { "type": "string", "maxLength": 256, "nullable": true }, "subStatus": { "type": "string", "format": "object-id" }, "snooze": { "type": "object", "properties": { "time": { "type": "string", "format": "date-time" }, "status": { "type": "string", "enum": [ "scheduled", "canceled", "elapsed" ] } }, "required": [ "status" ], "additionalProperties": false }, "tags": { "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 64, "pattern": "^[0-9a-zA-ZÀ-ÿ_/<>\\-.]{1}[0-9a-zA-ZÀ-ÿ _/<>\\-.]{0,63}$" }, "maxItems": 20, "uniqueItems": true }, "suggestedTags": { "type": "array", "items": { "type": "object", "properties": { "tag": { "type": "string", "minLength": 1, "maxLength": 64, "pattern": "^[0-9a-zA-ZÀ-ÿ_/<>\\-.]{1}[0-9a-zA-ZÀ-ÿ _/<>\\-.]{0,63}$" }, "confidence": { "type": "number" } }, "required": [ "tag", "confidence" ] }, "maxItems": 20, "uniqueItems": true }, "sentiment": { "type": "object", "properties": { "polarity": { "type": "number", "enum": [ -1, 0, 1 ] }, "confidence": { "type": "number", "minimum": -1, "maximum": 1 } }, "required": [ "polarity", "confidence" ], "additionalProperties": false }, "assignedUsers": { "type": "array", "items": { "type": "string", "format": "object-id" }, "maxItems": 10, "uniqueItems": true }, "assignedTeams": { "type": "array", "items": { "type": "string", "format": "object-id" }, "maxItems": 10, "uniqueItems": true }, "custom": { "type": "object", "maxProperties": 100, "additionalProperties": false }, "deleted": { "type": "boolean", "nullable": true }, "ended": { "type": "boolean" }, "endedAt": { "type": "string", "format": "date-time" }, "endedReason": { "type": "string", "maxLength": 128 }, "endedBy": { "type": "string", "format": "object-id" }, "endedByType": { "type": "string", "enum": [ "user", "customer" ] }, "locked": { "type": "boolean" }, "rev": { "type": "number" }, "defaultLang": { "type": "string", "maxLength": 100, "nullable": true }, "queue": { "type": "object", "properties": { "id": { "type": "string", "nullable": true }, "external": { "type": "string", "enum": [ "amazon-connect" ], "nullable": true } }, "anyOf": [ { "required": [ "id" ] }, { "required": [ "external" ] } ], "additionalProperties": false } }, "required": [ "id" ], "additionalProperties": false }, { "type": "object", "properties": { "id": { "type": "string" }, "customer": { "type": "string", "format": "object-id" } }, "required": [ "id" ], "additionalProperties": false } ] }, "maxItems": 100 }, "examples": {} } } }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "ids": { "type": "array" }, "context": { "type": "string" }, "status": { "type": "string" }, "v2": { "type": "boolean" }, "payload": { "type": "object", "properties": { "api": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "status": { "type": "string" }, "name": { "type": "string" } }, "required": [ "id" ] } }, "path": { "type": "string" }, "user": { "type": "object", "properties": { "id": { "type": "string" }, "userType": { "type": "string" }, "roles": { "type": "array", "items": { "type": "string" } }, "orgName": { "type": "string" }, "subject": { "type": "string" }, "org": { "type": "string" } }, "required": [ "id", "userType", "roles", "orgName", "subject", "org" ] }, "requestId": { "type": "string" }, "service": { "type": "string" }, "method": { "type": "string" } }, "required": [ "data", "path", "user", "requestId", "service", "method" ] } }, "required": [ "api" ] }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "completed": { "type": "boolean" } }, "required": [ "ids", "context", "status", "v2", "payload", "createdAt", "updatedAt", "completed" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "createdBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "createdBy" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "bulk", "id": "5b3bddb67f8469003df370a4", "attributes": { "ids": [], "context": "api.sobjects.conversations.bulk-create", "status": "complete", "v2": true, "payload": { "api": { "data": [ { "id": "5a96dac46dd73800112fab28", "status": "done" }, { "id": "5a96dac46dd73800112fab29", "name": "Foobar" } ], "path": "/v1/conversations", "user": { "id": "5a96dac46dd73800112fab30", "userType": "user", "roles": [ "org" ], "orgName": "mycompany", "subject": "5a96dac46dd73800112fab30", "org": "5a96dac36dd73800112fab2e" }, "requestId": "5b3bddb6b6e494001779fa38", "service": "sobjects", "method": "POST" } }, "createdAt": "2018-07-03T20:33:58.486Z", "updatedAt": "2018-07-03T20:34:03.873Z", "completed": true }, "relationships": { "org": { "links": { "self": "/v1/orgs/5a96dac36dd73800112fab2e" }, "data": { "type": "org", "id": "5a96dac36dd73800112fab2e" } }, "createdBy": { "links": { "self": "/v1/users/5a96dac46dd73800112fab30" }, "data": { "type": "user", "id": "5a96dac46dd73800112fab30" } } }, "links": { "self": "/v1/bulk/5b3bddb67f8469003df370a4" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] } }, "/conversations/{id}/messages": { "post": { "security": [ { "httpBearer": [] } ], "tags": [ "Conversations (Messages)", "Messages" ], "summary": "Create message from conversation", "description": "Creates a new message from a conversation.\n\n### NOTE\n> The new message created by the endpoint will be associated with the same customer as the conversation.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.message.write|org.permission.message.create|\n\n### Authorization\n`org.admin` role is required for setting `createdAt`, `createdBy`, `modifiedAt`, and `modifiedBy`. Otherwise, the token automatically sets these attributes.\n\n### Rate Limit\nMessages are subject to a rate limit. A single client can create up to 120 messages per minute per customer.\nMessages with `importedAt` in their body will not be subject to the rate limit.\n\nA `429 Too Many Requests` response will be returned if the rate limit has been reached for a customer.", "operationId": "CreateMessageFromConversation", "parameters": [ { "name": "id", "in": "path", "description": "Unique ID of the conversation.", "required": true, "style": "simple", "schema": { "type": "string", "example": "58288a637c7f551a00b5b716" } } ], "requestBody": { "description": "", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string", "format": "object-id" }, "externalId": { "type": "string", "maxLength": 256 }, "customer": { "type": "string", "format": "object-id" }, "conversation": { "type": "string", "format": "object-id" }, "reference": { "type": "object", "properties": { "message": { "type": "string", "format": "object-id" }, "type": { "type": "string", "enum": [ "reply", "replyAll", "forward" ] } }, "required": [ "message", "type" ], "additionalProperties": false }, "channel": { "type": "string", "enum": [ "email", "sms", "chat", "facebook", "twitter-dm", "twitter-tweet", "voice", "instagram", "whatsapp" ] }, "preview": { "type": "string", "maxLength": 10240 }, "subject": { "type": "string", "maxLength": 256 }, "direction": { "type": "string", "enum": [ "in", "out" ] }, "app": { "type": "string" }, "size": { "type": "number" }, "related": { "type": "string" }, "status": { "type": "string", "enum": [ "sent", "received", "error" ] }, "error": { "type": "object", "properties": { "status": { "type": "number" }, "code": { "type": "string" }, "title": { "type": "string" }, "detail": { "type": "string" }, "source": { "type": "object" }, "meta": { "type": "object" }, "links": { "type": "object" } }, "additionalProperties": false }, "errorAt": { "type": "string", "format": "date-time" }, "auto": { "type": "boolean" }, "sentAt": { "type": "string", "format": "date-time" }, "source": { "type": "string", "enum": [ "bulk", "satisfaction" ] }, "shortcuts": { "type": "array", "items": { "type": "string", "format": "object-id" } }, "kbArticles": { "type": "array", "items": { "type": "string", "format": "object-id" } }, "attachments": { "anyOf": [ { "type": "array", "items": { "type": "object", "properties": { "_id": { "type": "string", "format": "object-id" }, "name": { "type": "string" }, "contentType": { "type": "string" }, "contentLength": { "type": "number" }, "sourceId": { "type": "string", "format": "object-id" } }, "required": [ "_id", "name", "contentType", "contentLength" ], "additionalProperties": false }, "uniqueItems": true }, { "type": "array", "items": { "type": "string", "format": "object-id" }, "uniqueItems": true } ] }, "location": { "type": "object", "properties": { "name": { "type": "string" }, "address": { "type": "string", "maxLength": 256 }, "address2": { "type": "string", "maxLength": 256 }, "address3": { "type": "string", "maxLength": 256 }, "latitude": { "type": "number" }, "longitude": { "type": "number" }, "countryCode": { "type": "string", "minLength": 2, "maxLength": 2 }, "countryName": { "type": "string", "maxLength": 64 }, "regionCode": { "type": "string", "maxLength": 2 }, "regionName": { "type": "string", "maxLength": 128 }, "cityName": { "type": "string", "maxLength": 128 }, "zipCode": { "type": "string", "maxLength": 30 }, "areaCode": { "type": "string", "maxLength": 30 } } }, "meta": { "type": "object", "maxProperties": 100 }, "custom": { "type": "object", "maxProperties": 100, "additionalProperties": false }, "sentiment": { "type": "object", "properties": { "polarity": { "type": "number", "enum": [ -1, 0, 1 ] }, "confidence": { "type": "number", "minimum": -1, "maximum": 1 } }, "required": [ "polarity", "confidence" ], "additionalProperties": false }, "createdAt": { "type": "string", "format": "date-time" }, "modifiedAt": { "type": "string", "format": "date-time" }, "createdBy": { "type": "string", "format": "object-id" }, "modifiedBy": { "type": "string", "format": "object-id" }, "importedAt": { "type": "string", "format": "date-time" }, "lang": { "type": "string", "maxLength": 100, "nullable": true }, "queue": { "type": "object", "properties": { "id": { "type": "string", "format": "object-id" }, "external": { "type": "string", "enum": [ "amazon-connect" ] } }, "anyOf": [ { "required": [ "id" ] }, { "required": [ "external" ] } ], "additionalProperties": false } }, "required": [ "channel", "app" ], "additionalProperties": false } } } }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "channel": { "type": "string" }, "app": { "type": "string" }, "size": { "type": "integer" }, "direction": { "type": "string" }, "meta": { "type": "object" }, "status": { "type": "string" }, "sentAt": { "type": "string" }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "modifiedAt": { "type": "string" } }, "required": [ "channel", "app", "size", "direction", "meta", "status", "sentAt", "createdAt", "updatedAt", "modifiedAt" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "createdBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "modifiedBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "customer": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "conversation": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "createdBy", "modifiedBy", "customer", "conversation" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "message", "id": "57a6082ae92c9510005e35ea", "attributes": { "channel": "email", "app": "postmark", "size": 1, "direction": "in", "meta": {}, "status": "received", "sentAt": "2016-11-13T15:44:35.625Z", "createdAt": "2016-05-22T22:42:44.723Z", "updatedAt": "2016-11-13T15:44:35.625Z", "modifiedAt": "2016-11-13T15:44:35.625Z" }, "relationships": { "org": { "links": { "self": "/v1/orgs/57bb5d2e32e83a130052e94e" }, "data": { "type": "org", "id": "57bb5d2e32e83a130052e94e" } }, "createdBy": { "links": { "self": "/v1/users/57bb5d2e32e83a130052e94f" }, "data": { "type": "user", "id": "57bb5d2e32e83a130052e94f" } }, "modifiedBy": { "links": { "self": "/v1/users/57bb5d2e32e83a130052e94f" }, "data": { "type": "user", "id": "57bb5d2e32e83a130052e94f" } }, "customer": { "links": { "self": "/v1/customers/57c08ccde595371400462df2" }, "data": { "type": "customers", "id": "57c08ccde595371400462df2" } }, "conversation": { "links": { "self": "/v1/conversations/58288a637c7f551a00b5b716" }, "data": { "type": "conversation", "id": "58288a637c7f551a00b5b716" } } }, "links": { "self": "/v1/messages/57a6082ae92c9510005e35ea" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] }, "get": { "security": [ { "httpBearer": [] } ], "tags": [ "Conversations (Messages)", "Messages" ], "summary": "Get messages by conversation", "description": "Retrieves messages for a conversation.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.message.read|org.permission.message.read|", "operationId": "GetMessagesByConversation", "parameters": [ { "name": "id", "in": "path", "description": "Unique ID of the conversation.", "required": true, "style": "simple", "schema": { "type": "string", "example": "57c8d2b01a57ed1400392073" } }, { "name": "page", "in": "query", "schema": { "type": "number", "default": 1, "example": 1 }, "description": "Number of pages to return for results. Default value: 1." }, { "name": "pageSize", "in": "query", "required": false, "schema": { "type": "number", "default": 100, "example": 100 }, "description": "Number of results to return per page. Default value: 100." }, { "name": "include", "in": "query", "required": false, "schema": { "type": "string", "enum": [ "attachments" ], "example": "attachments" }, "description": "List of resources to include in this response. Use a comma to separate resources. Supports the `attachments` resource. " } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "meta": { "type": "object", "properties": { "pageSize": { "type": "integer" }, "page": { "type": "integer" } }, "required": [ "pageSize", "page" ] }, "data": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "externalId": { "type": "string" }, "channel": { "type": "string" }, "app": { "type": "string" }, "size": { "type": "integer" }, "direction": { "type": "string" }, "preview": { "type": "string" }, "sentiment": { "type": "object" }, "meta": { "type": "object", "properties": { "inReplyTo": { "type": "string" }, "recipient": { "type": "object", "properties": { "mailboxHash": { "type": "string" }, "email": { "type": "string" } }, "required": [ "mailboxHash", "email" ] }, "cc": { "type": "array" }, "to": { "type": "array", "items": { "type": "object", "properties": { "email": { "type": "string" } }, "required": [ "email" ] } }, "from": { "type": "string" }, "subject": { "type": "string" } }, "required": [ "inReplyTo", "recipient", "cc", "to", "from", "subject" ] }, "status": { "type": "string" }, "sentAt": { "type": "string" }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" } }, "required": [ "externalId", "channel", "app", "size", "direction", "preview", "sentiment", "meta", "status", "sentAt", "createdAt", "updatedAt" ], "additionalProperties": true }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "customer": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "conversation": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "attachments": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } } }, "required": [ "links", "data" ] } }, "required": [ "org", "customer", "conversation" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" }, "related": { "type": "string" } }, "required": [ "self", "related" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "links": { "type": "object", "properties": { "self": { "type": "string" }, "first": { "type": "string" }, "prev": { "type": "string", "nullable": true }, "next": { "type": "string", "nullable": true } }, "required": [ "self", "first", "prev", "next" ] }, "included": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "attachment" ] }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "name": { "type": "string" }, "contentType": { "type": "string" }, "contentLength": { "type": "number" }, "redacted": { "type": "boolean" } }, "required": [ "name", "contentType", "contentLength", "redacted" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "message": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "message" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } } }, "required": [ "meta", "data", "links" ] }, "example": { "meta": { "pageSize": 100, "page": 1 }, "data": [ { "type": "message", "id": "57c8d2b01a57ed1400392073", "attributes": { "externalId": "", "channel": "email", "app": "postmark", "size": 0, "direction": "in", "preview": "Can you please help me?", "sentiment": {}, "meta": { "inReplyTo": "", "recipient": { "mailboxHash": "", "email": "support@kustomer.com" }, "cc": [], "to": [ { "email": "support@kustomer.com" } ], "from": "jeremy@kustomer.com", "subject": "Re: hey" }, "status": "received", "sentAt": "2016-09-02T01:15:14.000Z", "createdAt": "2016-09-02T01:15:31.140Z", "updatedAt": "2016-09-02T01:15:31.140Z" }, "relationships": { "org": { "links": { "self": "/v1/orgs/57bb5d2e32e83a130052e94e" }, "data": { "type": "org", "id": "57bb5d2e32e83a130052e94e" } }, "customer": { "links": { "self": "/v1/customers/57c08ccde595371400462df2" }, "data": { "type": "customers", "id": "57c08ccde595371400462df2" } }, "conversation": { "links": { "self": "/v1/conversations/57c8d2b365f7cc14004e674f" }, "data": { "type": "conversation", "id": "57c8d2b365f7cc14004e674f" } } }, "links": { "self": "/v1/messages/57c8d2b01a57ed1400392073", "related": "/v1/postmark/messages/57c8d2b01a57ed1400392073" } } ], "links": { "self": "/v1/conversations/57c8d2b365f7cc14004e674f/messages?page=1&pageSize=100", "first": "/v1/conversations/57c8d2b365f7cc14004e674f/messages?page=1&pageSize=100", "prev": null, "next": null } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] } }, "/conversations/{id}/tags": { "post": { "security": [ { "httpBearer": [] } ], "tags": [ "Conversations (Tags)" ], "summary": "Append tags to conversation", "description": "Adds tags to a conversation by the tag name and/or the unique ID of the conversation. Creates a new tag if a tag does not exist yet in your Kustomer organization.\n\nTo learn more, see [Conversation tags](https://help.kustomer.com/conversations-tags-H1c4iVrIb) in the Kustomer Help Center.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.conversation.write|org.permission.conversation.update|\n\n### Note\n> This endpoint is subject to Object Rate Limiting, which limits how many updates a single User can make to a single Conversation. See [Rate limiting](https://developer.kustomer.com/kustomer-api-docs/reference/rate-limiting) for more information.", "operationId": "AppendTagsToConversation", "parameters": [ { "name": "id", "in": "path", "description": "Unique ID of the conversation.", "required": true, "style": "simple", "schema": { "type": "string", "example": "5837af59baf9ae1900e82ca7" } } ], "requestBody": { "description": "", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 64, "pattern": "^[0-9a-zA-ZÀ-ÿ_/<>\\-.]{1}[0-9a-zA-ZÀ-ÿ _/<>\\-.]{0,63}$" }, "maxItems": 20, "uniqueItems": true } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "name": { "type": "string" }, "channels": { "type": "array" }, "status": { "type": "string" }, "messageCount": { "type": "integer" }, "noteCount": { "type": "integer" }, "satisfaction": { "type": "integer" }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "modifiedAt": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } }, "suggestedTags": { "type": "array" }, "sentiment": { "type": "object" }, "lastMessageIn": { "type": "object" }, "assignedUsers": { "type": "array" }, "assignedTeams": { "type": "array" }, "firstResponse": { "type": "object" }, "direction": { "type": "string" }, "outboundMessageCount": { "type": "integer" }, "rev": { "type": "integer" } }, "required": [ "name", "channels", "status", "messageCount", "noteCount", "satisfaction", "createdAt", "updatedAt", "modifiedAt", "tags", "suggestedTags", "sentiment", "lastMessageIn", "assignedUsers", "assignedTeams", "firstResponse", "direction", "outboundMessageCount", "rev" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "customer": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "messages": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "links" ] }, "createdBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "modifiedBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "customer", "messages", "createdBy", "modifiedBy" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "conversation", "id": "5837af59baf9ae1900e82ca7", "attributes": { "name": "", "channels": [], "status": "done", "messageCount": 0, "noteCount": 0, "satisfaction": 0, "createdAt": "2016-11-25T03:26:17.918Z", "updatedAt": "2016-12-08T15:13:21.696Z", "modifiedAt": "2016-11-25T03:33:30.072Z", "tags": [ "5849765dc41e372700cc84a3", "5849765dc41e372700cc84a4" ], "suggestedTags": [], "sentiment": {}, "lastMessageIn": {}, "assignedUsers": [], "assignedTeams": [], "firstResponse": {}, "direction": "in", "outboundMessageCount": 0, "rev": 9 }, "relationships": { "org": { "links": { "self": "/v1/orgs/5835002161599d1400acdaf9" }, "data": { "type": "org", "id": "5835002161599d1400acdaf9" } }, "customer": { "links": { "self": "/v1/customers/5837af10baf9ae1900e82ca5" }, "data": { "type": "customer", "id": "5837af10baf9ae1900e82ca5" } }, "messages": { "links": { "self": "/v1/conversations/5837af59baf9ae1900e82ca7/messages" } }, "createdBy": { "links": { "self": "/v1/users/5835002261599d1400acdafa" }, "data": { "type": "user", "id": "5835002261599d1400acdafa" } }, "modifiedBy": { "links": { "self": "/v1/users/5835002261599d1400acdafa" }, "data": { "type": "user", "id": "5835002261599d1400acdafa" } } }, "links": { "self": "/v1/conversations/5837af59baf9ae1900e82ca7" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] }, "delete": { "security": [ { "httpBearer": [] } ], "tags": [ "Conversations (Tags)" ], "summary": "Remove tags from conversation", "description": "Removes tags from a conversation by tag name and/or the unique ID of the conversation.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.conversation.write|org.permission.conversation.delete|\n\n### Note\n> This endpoint is subject to Object Rate Limiting, which limits how many updates a single User can make to a single Conversation. See [Rate limiting](https://developer.kustomer.com/kustomer-api-docs/reference/rate-limiting) for more information.", "operationId": "RemoveTagsFromConversation", "parameters": [ { "name": "id", "in": "path", "description": "Unique ID of the conversation.", "required": true, "style": "simple", "schema": { "type": "string", "example": "5837af59baf9ae1900e82ca7" } } ], "requestBody": { "description": "", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 64, "pattern": "^[0-9a-zA-ZÀ-ÿ_/<>\\-.]{1}[0-9a-zA-ZÀ-ÿ _/<>\\-.]{0,63}$" }, "maxItems": 20, "uniqueItems": true } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "name": { "type": "string" }, "channels": { "type": "array" }, "status": { "type": "string" }, "messageCount": { "type": "integer" }, "noteCount": { "type": "integer" }, "satisfaction": { "type": "integer" }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "modifiedAt": { "type": "string" }, "tags": { "type": "array" }, "suggestedTags": { "type": "array" }, "sentiment": { "type": "object" }, "lastMessageIn": { "type": "object" }, "assignedUsers": { "type": "array" }, "assignedTeams": { "type": "array" }, "firstResponse": { "type": "object" }, "direction": { "type": "string" }, "outboundMessageCount": { "type": "integer" }, "rev": { "type": "integer" } }, "required": [ "name", "channels", "status", "messageCount", "noteCount", "satisfaction", "createdAt", "updatedAt", "modifiedAt", "tags", "suggestedTags", "sentiment", "lastMessageIn", "assignedUsers", "assignedTeams", "firstResponse", "direction", "outboundMessageCount", "rev" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "customer": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "messages": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "links" ] }, "createdBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "modifiedBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "customer", "messages", "createdBy", "modifiedBy" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "conversation", "id": "5837af59baf9ae1900e82ca7", "attributes": { "name": "", "channels": [], "status": "done", "messageCount": 0, "noteCount": 0, "satisfaction": 0, "createdAt": "2016-11-25T03:26:17.918Z", "updatedAt": "2016-12-08T15:13:21.696Z", "modifiedAt": "2016-11-25T03:33:30.072Z", "tags": [], "suggestedTags": [], "sentiment": {}, "lastMessageIn": {}, "assignedUsers": [], "assignedTeams": [], "firstResponse": {}, "direction": "in", "outboundMessageCount": 0, "rev": 9 }, "relationships": { "org": { "links": { "self": "/v1/orgs/5835002161599d1400acdaf9" }, "data": { "type": "org", "id": "5835002161599d1400acdaf9" } }, "customer": { "links": { "self": "/v1/customers/5837af10baf9ae1900e82ca5" }, "data": { "type": "customer", "id": "5837af10baf9ae1900e82ca5" } }, "messages": { "links": { "self": "/v1/conversations/5837af59baf9ae1900e82ca7/messages" } }, "createdBy": { "links": { "self": "/v1/users/5835002261599d1400acdafa" }, "data": { "type": "user", "id": "5835002261599d1400acdafa" } }, "modifiedBy": { "links": { "self": "/v1/users/5835002261599d1400acdafa" }, "data": { "type": "user", "id": "5835002261599d1400acdafa" } } }, "links": { "self": "/v1/conversations/5837af59baf9ae1900e82ca7" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] } }, "/conversations/{id}/forwards": { "post": { "security": [ { "httpBearer": [] } ], "tags": [ "Conversations (Forwards)" ], "summary": "Create forward by conversation", "description": "Creates a forward to send through email. Forwards will send all messages in a conversation.\n\n### NOTE\n> To schedule the forward for delivery, create a forward with a `sendAt` property.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.conversation_forward.write|org.permission.conversation_forward.create|\n", "operationId": "CreateForwardByConversation", "parameters": [ { "name": "id", "in": "path", "description": "Unique ID of the conversation.", "required": true, "style": "simple", "schema": { "type": "string", "example": "58210c3db0f09110006b7954" } } ], "requestBody": { "description": "", "content": { "application/json": { "schema": { "type": "object", "properties": { "channel": { "type": "string", "enum": [ "email" ] }, "app": { "type": "string", "enum": [ "gmail", "postmark" ] }, "customer": { "type": "string", "format": "object-id" }, "status": { "type": "string", "enum": [ "draft", "sent", "failed" ] }, "sendAt": { "type": "string", "format": "date-time-math" }, "to": { "type": "array", "items": { "type": "object", "properties": { "email": { "type": "string", "format": "email-relaxed", "minLength": 3, "maxLength": 256 }, "name": { "type": "string", "minLength": 1 } }, "required": [ "email" ], "additionalProperties": false }, "maxItems": 100 }, "from": { "type": "object", "properties": { "email": { "type": "string", "format": "email-relaxed", "minLength": 3, "maxLength": 256 }, "name": { "type": "string", "minLength": 1 } }, "required": [ "email" ], "additionalProperties": false }, "body": { "type": "string", "maxLength": 10240 }, "subject": { "type": "string", "minLength": 1 }, "replyTo": { "type": "string", "format": "email-relaxed", "minLength": 3, "maxLength": 256 }, "template": { "type": "string", "format": "object-id", "nullable": true }, "payload": { "type": "object" }, "attachments": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "format": "object-id" }, "name": { "type": "string" }, "contentType": { "type": "string" }, "contentLength": { "type": "number" } }, "required": [ "id", "name", "contentType", "contentLength" ] } } }, "required": [ "channel" ], "additionalProperties": false } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string" }, "attributes": { "type": "object", "properties": { "app": { "type": "string" }, "channel": { "type": "string" }, "status": { "type": "string" }, "from": { "type": "object", "properties": { "name": { "type": "string" }, "email": { "type": "string" } }, "required": [ "name", "email" ] }, "to": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "email": { "type": "string" } }, "required": [ "name", "email" ] } }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "modifiedAt": { "type": "string" } }, "required": [ "app", "channel", "status", "from", "to", "createdAt", "updatedAt", "modifiedAt" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "data", "links" ] }, "customer": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "data", "links" ] }, "conversation": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "data", "links" ] }, "createdBy": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "data", "links" ] }, "modifiedBy": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "data", "links" ] }, "attachments": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "data", "links" ] } } }, "required": [ "org", "customer", "conversation", "createdBy", "modifiedBy" ] } }, "required": [ "id", "type", "attributes", "relationships" ] } }, "required": [ "data" ] }, "example": { "data": { "id": "5823e4d3bff98a100085320e", "type": "forward", "attributes": { "app": "postmark", "channel": "email", "status": "draft", "from": { "name": "Support", "email": "support@example.com" }, "to": [ { "name": "Billing", "email": "billing@email.com" } ], "createdAt": "2016-11-10T03:09:07.575Z", "updatedAt": "2016-11-10T03:09:07.575Z", "modifiedAt": "2016-11-10T03:09:07.575Z" }, "relationships": { "org": { "data": { "type": "org", "id": "57f29863a1dbf61100e6aa92" }, "links": { "self": "/v1/orgs/57f29863a1dbf61100e6aa92" } }, "customer": { "data": { "type": "customer", "id": "58210c3db0f09110006b7953" }, "links": { "self": "/v1/customers/58210c3db0f09110006b7953" } }, "conversation": { "data": { "type": "conversation", "id": "58210c3db0f09110006b7954" }, "links": { "self": "/v1/conversation/58210c3db0f09110006b7954" } }, "createdBy": { "data": { "type": "user", "id": "58190b991f2932100010d683" }, "links": { "self": "/v1/users/58190b991f2932100010d683" } }, "modifiedBy": { "data": { "type": "user", "id": "58190b991f2932100010d683" }, "links": { "self": "/v1/users/58190b991f2932100010d683" } } } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] }, "get": { "security": [ { "httpBearer": [] } ], "tags": [ "Conversations (Forwards)" ], "summary": "Get all forwards by conversation", "description": "Retrieves all forwarded conversations based on the unique conversation ID.\n\nTo learn more, see [Forwarding conversations](https://help.kustomer.com/forwarding-SJN_iaACN) in the Kustomer Help Center.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.draft.read|org.permission.draft.read|", "operationId": "GetAllForwardsByConversation", "parameters": [ { "name": "id", "in": "path", "description": "Unique ID of the conversation.", "required": true, "style": "simple", "schema": { "type": "string", "example": "58210c3d728107110018662f" } }, { "name": "page", "in": "query", "schema": { "type": "number", "default": 1, "example": 1 }, "description": "Number of pages to return for results. Default value: 1." }, { "name": "pageSize", "in": "query", "required": false, "schema": { "type": "number", "default": 100, "example": 100 }, "description": "Number of results to return per page. Default value: 100." } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "meta": { "type": "object", "properties": { "pageSize": { "type": "integer" }, "page": { "type": "integer" } }, "required": [ "pageSize", "page" ] }, "data": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string" }, "attributes": { "type": "object", "properties": { "app": { "type": "string" }, "channel": { "type": "string" }, "from": { "type": "object", "properties": { "name": { "type": "string" }, "email": { "type": "string" } }, "required": [ "name", "email" ] }, "to": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "email": { "type": "string" } }, "required": [ "name", "email" ] } }, "body": { "type": "string" }, "payload": { "type": "object", "properties": { "draftJs": { "type": "object", "properties": { "blocks": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "object" }, "entityRanges": { "type": "array" }, "inlineStyleRanges": { "type": "array" }, "depth": { "type": "integer" }, "type": { "type": "string" }, "text": { "type": "string" }, "key": { "type": "string" } }, "required": [ "data", "entityRanges", "inlineStyleRanges", "depth", "type", "text", "key" ] } }, "entityMap": { "type": "object" } }, "required": [ "blocks", "entityMap" ] } }, "required": [ "draftJs" ] }, "status": { "type": "string" }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "modifiedAt": { "type": "string" } }, "required": [ "app", "channel", "from", "to", "body", "status", "createdAt", "updatedAt", "modifiedAt" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "data", "links" ] }, "customer": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "data", "links" ] }, "createdBy": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "data", "links" ] }, "modifiedBy": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "data", "links" ] }, "conversation": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "data", "links" ] } }, "required": [ "org", "customer", "createdBy", "modifiedBy" ] } }, "required": [ "id", "type", "attributes", "relationships" ] } }, "links": { "type": "object", "properties": { "self": { "type": "string" }, "first": { "type": "string" }, "prev": { "type": "string", "nullable": true }, "next": { "type": "string", "nullable": true } }, "required": [ "self", "first", "prev", "next" ] } }, "required": [ "meta", "data", "links" ] }, "example": { "meta": { "pageSize": 100, "page": 1 }, "data": [ { "id": "58210c6c2a8b9910002f6730", "type": "forward", "attributes": { "app": "postmark", "channel": "email", "from": { "name": "Sales", "email": "sales@example.com" }, "to": [ { "name": "Billing", "email": "billing@email.com" } ], "body": "", "payload": { "draftJs": { "blocks": [ { "data": {}, "entityRanges": [], "inlineStyleRanges": [], "depth": 0, "type": "unstyled", "text": "", "key": "dv926" } ], "entityMap": {} } }, "status": "draft", "createdAt": "2016-11-07T23:21:16.945Z", "updatedAt": "2016-11-08T18:49:32.730Z", "modifiedAt": "2016-11-08T18:49:32.730Z" }, "relationships": { "org": { "data": { "type": "org", "id": "57f29863a1dbf61100e6aa92" }, "links": { "self": "/v1/orgs/57f29863a1dbf61100e6aa92" } }, "customer": { "data": { "type": "customer", "id": "58210c3db0f09110006b7953" }, "links": { "self": "/v1/customers/58210c3db0f09110006b7953" } }, "createdBy": { "data": { "type": "user", "id": "57fd2d309d0ef811009cfdd6" }, "links": { "self": "/v1/users/57fd2d309d0ef811009cfdd6" } }, "modifiedBy": { "data": { "type": "user", "id": "58190b991f2932100010d683" }, "links": { "self": "/v1/users/58190b991f2932100010d683" } }, "conversation": { "data": { "type": "conversation", "id": "58210c3d728107110018662f" }, "links": { "self": "/v1/conversations/58210c3d728107110018662f" } } } }, { "id": "58210cedbff98a10008531da", "type": "forward", "attributes": { "app": "gmail", "channel": "email", "body": "Hi John! ", "from": { "name": "Sales", "email": "sales@example.com" }, "to": [ { "name": "Billing", "email": "billing@email.com" } ], "payload": { "draftJs": { "blocks": [ { "data": {}, "entityRanges": [], "inlineStyleRanges": [], "depth": 0, "type": "unstyled", "text": "Hi John! ", "key": "a789" } ], "entityMap": {} } }, "status": "draft", "createdAt": "2016-11-07T23:23:25.706Z", "updatedAt": "2016-11-09T16:13:12.665Z", "modifiedAt": "2016-11-09T16:13:12.665Z" }, "relationships": { "org": { "data": { "type": "org", "id": "57f29863a1dbf61100e6aa92" }, "links": { "self": "/v1/orgs/57f29863a1dbf61100e6aa92" } }, "customer": { "data": { "type": "customer", "id": "58210c3db0f09110006b7953" }, "links": { "self": "/v1/customers/58210c3db0f09110006b7953" } }, "createdBy": { "data": { "type": "user", "id": "57fd2d309d0ef811009cfdd6" }, "links": { "self": "/v1/users/57fd2d309d0ef811009cfdd6" } }, "modifiedBy": { "data": { "type": "user", "id": "5808d9c95cf6ce1100e1acda" }, "links": { "self": "/v1/users/5808d9c95cf6ce1100e1acda" } }, "conversation": { "data": { "type": "conversation", "id": "58210c99b0f09110006b7969" }, "links": { "self": "/v1/conversations/58210c99b0f09110006b7969" } } } }, { "id": "5823e4d3bff98a100085320e", "type": "forward", "attributes": { "app": "postmark", "channel": "email", "body": "A great response", "from": { "name": "Sales", "email": "sales@example.com" }, "to": [ { "name": "Billing", "email": "billing@email.com" } ], "status": "draft", "createdAt": "2016-11-10T03:09:07.575Z", "updatedAt": "2016-11-10T03:16:55.464Z", "modifiedAt": "2016-11-10T03:16:55.464Z" }, "relationships": { "org": { "data": { "type": "org", "id": "57f29863a1dbf61100e6aa92" }, "links": { "self": "/v1/orgs/57f29863a1dbf61100e6aa92" } }, "customer": { "data": { "type": "customer", "id": "58210c3db0f09110006b7953" }, "links": { "self": "/v1/customers/58210c3db0f09110006b7953" } }, "createdBy": { "data": { "type": "user", "id": "58190b991f2932100010d683" }, "links": { "self": "/v1/users/58190b991f2932100010d683" } }, "modifiedBy": { "data": { "type": "user", "id": "58190b991f2932100010d683" }, "links": { "self": "/v1/users/58190b991f2932100010d683" } } } } ], "links": { "self": "/v1/conversations/58210c3db0f09110006b7953/forwards?page=1&pageSize=100", "first": "/v1/conversations/58210c3db0f09110006b7953/forwards?page=1&pageSize=100", "prev": null, "next": null } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] } }, "/conversations/{id}/times": { "get": { "security": [ { "httpBearer": [] } ], "tags": [ "Conversations (Time)" ], "summary": "Get conversation times by conversation", "description": "Retrieves `conversation_time`s by the unique ID of the related conversation.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.conversation.read|org.permission.conversation.read|", "operationId": "GetConversationTimesByConversationId", "parameters": [ { "name": "id", "in": "path", "required": true, "description": "Unique ID of the conversation.", "style": "simple", "schema": { "type": "string", "example": "5f184e74c61792001af42e49" } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "meta": { "type": "object", "properties": { "pageSize": { "type": "integer" }, "page": { "type": "integer" } }, "required": [ "pageSize", "page" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" }, "first": { "type": "string" }, "prev": { "type": "string", "nullable": true }, "next": { "type": "string", "nullable": true } }, "required": [ "self", "first", "prev", "next" ] }, "data": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "createdAt": { "type": "string" }, "createdByTeams": { "type": "array", "items": { "type": "string" } }, "assignedUsers": { "type": "array", "items": { "type": "string" } }, "assignedTeams": { "type": "array" }, "handleAt": { "type": "string" }, "handleTime": { "type": "integer" }, "channels": { "type": "array", "items": { "type": "string" } }, "messageAt": { "type": "string" }, "messageTime": { "type": "integer" } }, "required": [ "createdAt", "createdByTeams", "assignedUsers", "assignedTeams", "handleAt", "handleTime", "channels" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "customer": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "conversation": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "createdBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "customer", "conversation", "createdBy" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } } }, "required": [ "meta", "links", "data" ] }, "example": { "meta": { "pageSize": 100, "page": 1 }, "links": { "self": "/v1/conversations/5f184e74c61792001af42e49/times?page=1&pageSize=100", "first": "/v1/conversations/5f184e74c61792001af42e49/times?page=1&pageSize=100", "prev": null, "next": null }, "data": [ { "type": "conversation_time", "id": "5faee8bd01b6a7060833dafb", "attributes": { "createdAt": "2020-11-13T20:12:45.025Z", "createdByTeams": [ "5d8bb1995886ef001aee07d3" ], "assignedUsers": [ "5ce4672fcce83d001a9e83e8" ], "assignedTeams": [], "handleAt": "2020-11-13T20:12:26.299Z", "handleTime": 19, "channels": [ "chat" ] }, "relationships": { "org": { "links": { "self": "/v1/orgs/58ff8ca3ce53ff1000a47865" }, "data": { "type": "org", "id": "58ff8ca3ce53ff1000a47865" } }, "customer": { "links": { "self": "/v1/customers/5f184e74d3bc42001946cdb9" }, "data": { "type": "customer", "id": "5f184e74d3bc42001946cdb9" } }, "conversation": { "links": { "self": "/v1/conversations/5f184e74c61792001af42e49" }, "data": { "type": "conversation", "id": "5f184e74c61792001af42e49" } }, "createdBy": { "links": { "self": "/v1/users/5ce4672fcce83d001a9e83e8" }, "data": { "type": "user", "id": "5ce4672fcce83d001a9e83e8" } } }, "links": { "self": "/v1/conversations/times/5faee8bd01b6a7060833dafb" } }, { "type": "conversation_time", "id": "5faee897fb0938dedea1a991", "attributes": { "createdAt": "2020-11-13T20:12:07.209Z", "createdByTeams": [ "5d8bb1995886ef001aee07d3" ], "assignedUsers": [ "5ce4672fcce83d001a9e83e8" ], "assignedTeams": [], "handleAt": "2020-11-13T20:11:56.347Z", "handleTime": 11, "channels": [ "chat" ] }, "relationships": { "org": { "links": { "self": "/v1/orgs/58ff8ca3ce53ff1000a47865" }, "data": { "type": "org", "id": "58ff8ca3ce53ff1000a47865" } }, "customer": { "links": { "self": "/v1/customers/5f184e74d3bc42001946cdb9" }, "data": { "type": "customer", "id": "5f184e74d3bc42001946cdb9" } }, "conversation": { "links": { "self": "/v1/conversations/5f184e74c61792001af42e49" }, "data": { "type": "conversation", "id": "5f184e74c61792001af42e49" } }, "createdBy": { "links": { "self": "/v1/users/5ce4672fcce83d001a9e83e8" }, "data": { "type": "user", "id": "5ce4672fcce83d001a9e83e8" } } }, "links": { "self": "/v1/conversations/times/5faee897fb0938dedea1a991" } }, { "type": "conversation_time", "id": "5f9b026e0622fb0bce6fdca0", "attributes": { "createdAt": "2020-10-29T17:57:02.287Z", "createdByTeams": [ "5be5f8270d61de001c52241c", "5d8bb1995886ef001aee07d3" ], "assignedUsers": [], "assignedTeams": [], "handleAt": "2020-10-29T17:57:00.525Z", "handleTime": 2, "channels": [ "chat" ] }, "relationships": { "org": { "links": { "self": "/v1/orgs/58ff8ca3ce53ff1000a47865" }, "data": { "type": "org", "id": "58ff8ca3ce53ff1000a47865" } }, "customer": { "links": { "self": "/v1/customers/5f184e74d3bc42001946cdb9" }, "data": { "type": "customer", "id": "5f184e74d3bc42001946cdb9" } }, "conversation": { "links": { "self": "/v1/conversations/5f184e74c61792001af42e49" }, "data": { "type": "conversation", "id": "5f184e74c61792001af42e49" } }, "createdBy": { "links": { "self": "/v1/users/5d7a8ffb28b5f90014e93d17" }, "data": { "type": "user", "id": "5d7a8ffb28b5f90014e93d17" } } }, "links": { "self": "/v1/conversations/times/5f9b026e0622fb0bce6fdca0" } }, { "type": "conversation_time", "id": "5f9b02691272d35654ac0c6f", "attributes": { "createdAt": "2020-10-29T17:56:57.201Z", "createdByTeams": [ "5be5f8270d61de001c52241c", "5d8bb1995886ef001aee07d3" ], "assignedUsers": [], "assignedTeams": [], "handleAt": "2020-10-29T17:56:55.704Z", "handleTime": 2, "channels": [ "chat" ] }, "relationships": { "org": { "links": { "self": "/v1/orgs/58ff8ca3ce53ff1000a47865" }, "data": { "type": "org", "id": "58ff8ca3ce53ff1000a47865" } }, "customer": { "links": { "self": "/v1/customers/5f184e74d3bc42001946cdb9" }, "data": { "type": "customer", "id": "5f184e74d3bc42001946cdb9" } }, "conversation": { "links": { "self": "/v1/conversations/5f184e74c61792001af42e49" }, "data": { "type": "conversation", "id": "5f184e74c61792001af42e49" } }, "createdBy": { "links": { "self": "/v1/users/5d7a8ffb28b5f90014e93d17" }, "data": { "type": "user", "id": "5d7a8ffb28b5f90014e93d17" } } }, "links": { "self": "/v1/conversations/times/5f9b02691272d35654ac0c6f" } }, { "type": "conversation_time", "id": "5f6b9d4ba33e17001abbe989", "attributes": { "createdAt": "2020-09-23T19:08:59.900Z", "createdByTeams": [ "5d8bb1995886ef001aee07d3" ], "assignedUsers": [ "5e28b213e80e1b00128e7011" ], "assignedTeams": [], "handleAt": "2020-09-23T19:08:52.497Z", "handleTime": 8, "channels": [ "chat" ] }, "relationships": { "org": { "links": { "self": "/v1/orgs/58ff8ca3ce53ff1000a47865" }, "data": { "type": "org", "id": "58ff8ca3ce53ff1000a47865" } }, "customer": { "links": { "self": "/v1/customers/5f184e74d3bc42001946cdb9" }, "data": { "type": "customer", "id": "5f184e74d3bc42001946cdb9" } }, "conversation": { "links": { "self": "/v1/conversations/5f184e74c61792001af42e49" }, "data": { "type": "conversation", "id": "5f184e74c61792001af42e49" } }, "createdBy": { "links": { "self": "/v1/users/5e28b213e80e1b00128e7011" }, "data": { "type": "user", "id": "5e28b213e80e1b00128e7011" } } }, "links": { "self": "/v1/conversations/times/5f6b9d4ba33e17001abbe989" } }, { "type": "conversation_time", "id": "5f185df6fe1951001a0ffa6f", "attributes": { "createdAt": "2020-07-22T15:40:38.206Z", "createdByTeams": [], "assignedUsers": [], "assignedTeams": [], "messageAt": "2020-07-22T14:39:07.287Z", "messageTime": 3691, "handleAt": "2020-07-22T14:39:06.472Z", "handleTime": 3692, "channels": [ "chat" ] }, "relationships": { "org": { "links": { "self": "/v1/orgs/58ff8ca3ce53ff1000a47865" }, "data": { "type": "org", "id": "58ff8ca3ce53ff1000a47865" } }, "customer": { "links": { "self": "/v1/customers/5f184e74d3bc42001946cdb9" }, "data": { "type": "customer", "id": "5f184e74d3bc42001946cdb9" } }, "conversation": { "links": { "self": "/v1/conversations/5f184e74c61792001af42e49" }, "data": { "type": "conversation", "id": "5f184e74c61792001af42e49" } }, "createdBy": { "links": { "self": "/v1/users/5e386464e1968c0019638c07" }, "data": { "type": "user", "id": "5e386464e1968c0019638c07" } } }, "links": { "self": "/v1/conversations/times/5f185df6fe1951001a0ffa6f" } }, { "type": "conversation_time", "id": "5f184f88fe1951001a0e9231", "attributes": { "createdAt": "2020-07-22T14:39:04.394Z", "createdByTeams": [], "assignedUsers": [], "assignedTeams": [], "messageAt": "2020-07-22T14:37:45.285Z", "messageTime": 80, "handleAt": "2020-07-22T14:37:43.542Z", "handleTime": 81, "channels": [ "chat" ] }, "relationships": { "org": { "links": { "self": "/v1/orgs/58ff8ca3ce53ff1000a47865" }, "data": { "type": "org", "id": "58ff8ca3ce53ff1000a47865" } }, "customer": { "links": { "self": "/v1/customers/5f184e74d3bc42001946cdb9" }, "data": { "type": "customer", "id": "5f184e74d3bc42001946cdb9" } }, "conversation": { "links": { "self": "/v1/conversations/5f184e74c61792001af42e49" }, "data": { "type": "conversation", "id": "5f184e74c61792001af42e49" } }, "createdBy": { "links": { "self": "/v1/users/5e386464e1968c0019638c07" }, "data": { "type": "user", "id": "5e386464e1968c0019638c07" } } }, "links": { "self": "/v1/conversations/times/5f184f88fe1951001a0e9231" } } ] } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] } }, "/conversations/times/{ids}": { "get": { "security": [ { "httpBearer": [] } ], "tags": [ "Conversations (Time)" ], "summary": "Get conversation time by ids", "description": "Retrieves `conversation_time`s base on the unique ID or the IDs of `conversation_time`(s).\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.conversation.read|org.permission.conversation.read|", "operationId": "GetConversationTimeByIds", "parameters": [ { "name": "ids", "in": "path", "required": true, "description": "Unique ID of the `conversation_time`.", "style": "simple", "schema": { "type": "string", "example": "5f184e74c61792001af42e49" } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "createdAt": { "type": "string" }, "createdByTeams": { "type": "array", "items": { "type": "string" } }, "assignedUsers": { "type": "array", "items": { "type": "string" } }, "assignedTeams": { "type": "array" }, "handleAt": { "type": "string" }, "handleTime": { "type": "integer" }, "channels": { "type": "array", "items": { "type": "string" } } }, "required": [ "createdAt", "createdByTeams", "assignedUsers", "assignedTeams", "handleAt", "handleTime", "channels" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "customer": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "conversation": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "createdBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "customer", "conversation", "createdBy" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "conversation_time", "id": "5faee8bd01b6a7060833dafb", "attributes": { "createdAt": "2020-11-13T20:12:45.025Z", "createdByTeams": [ "5d8bb1995886ef001aee07d3" ], "assignedUsers": [ "5ce4672fcce83d001a9e83e8" ], "assignedTeams": [], "handleAt": "2020-11-13T20:12:26.299Z", "handleTime": 19, "channels": [ "chat" ] }, "relationships": { "org": { "links": { "self": "/v1/orgs/58ff8ca3ce53ff1000a47865" }, "data": { "type": "org", "id": "58ff8ca3ce53ff1000a47865" } }, "customer": { "links": { "self": "/v1/customers/5f184e74d3bc42001946cdb9" }, "data": { "type": "customer", "id": "5f184e74d3bc42001946cdb9" } }, "conversation": { "links": { "self": "/v1/conversations/5f184e74c61792001af42e49" }, "data": { "type": "conversation", "id": "5f184e74c61792001af42e49" } }, "createdBy": { "links": { "self": "/v1/users/5ce4672fcce83d001a9e83e8" }, "data": { "type": "user", "id": "5ce4672fcce83d001a9e83e8" } } }, "links": { "self": "/v1/conversations/times/5faee8bd01b6a7060833dafb" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] } }, "/conversations/{id}/notes": { "post": { "security": [ { "httpBearer": [] } ], "tags": [ "Notes (Conversations)", "Conversations (Notes)" ], "summary": "Create note within conversation", "description": "Creates a new note within a conversation. Optionally, allows you to @mention another user in your Kustomer organization.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.note.read|org.permission.note.create|\n\n### Authorization\nThe `org.admin` role is required for setting `createdAt`, `createdBy`, `modifiedAt`, and `modifiedBy`. Otherwise, these attributes are automatically set by the token.\n\n### Rate limit\nNotes are subject to a rate limit. A single client can create up to 120 notes per minute per customer.", "operationId": "CreateNoteWithinConversation", "parameters": [ { "name": "id", "in": "path", "description": "Unique ID of the Conversation", "required": true, "style": "simple", "schema": { "type": "string", "example": "" } } ], "requestBody": { "description": "", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string" }, "conversation": { "type": "string" }, "externalId": { "type": "string", "maxLength": 256 }, "body": { "type": "string", "minLength": 1, "maxLength": 10240 }, "userMentions": { "type": "array", "maxItems": 20, "items": { "type": "object", "properties": { "user": { "type": "string" }, "team": { "type": "string" } } } }, "attachments": { "type": "array", "items": { "type": "object", "properties": { "_id": { "type": "string", "format": "object-id" }, "name": { "type": "string" }, "contentType": { "type": "string" }, "contentLength": { "type": "number" }, "sourceId": { "type": "string", "format": "object-id" } }, "required": [ "_id", "name", "contentType", "contentLength" ], "additionalProperties": false }, "uniqueItems": true }, "createdAt": { "type": "string", "format": "date-time" }, "modifiedAt": { "type": "string", "format": "date-time" }, "createdBy": { "type": "string", "format": "object-id" }, "modifiedBy": { "type": "string", "format": "object-id" }, "importedAt": { "type": "string", "format": "date-time" }, "lang": { "type": "string", "maxLength": 100, "nullable": true } }, "required": [ "body" ], "additionalProperties": false } } } }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "body": { "type": "string" }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" } }, "required": [ "body", "createdAt", "updatedAt" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "customer": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "createdBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "conversation": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "userMentions": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } } }, "required": [ "data" ] } }, "required": [ "org", "customer", "createdBy", "conversation", "userMentions" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "note", "id": "5828a3be7c7f551a00b5b720", "attributes": { "body": "Hey __Agent Smith__, do you know the answer to this problem?", "createdAt": "2016-11-13T17:32:46.480Z", "updatedAt": "2016-11-13T17:32:46.480Z" }, "relationships": { "org": { "links": { "self": "/v1/orgs/57bb5d2e32e83a130052e94e" }, "data": { "type": "org", "id": "57bb5d2e32e83a130052e94e" } }, "customer": { "links": { "self": "/v1/customers/57c08ccde595371400462df2" }, "data": { "type": "customer", "id": "57c08ccde595371400462df2" } }, "createdBy": { "links": { "self": "/v1/users/57bb5d2e32e83a130052e94f" }, "data": { "type": "user", "id": "57bb5d2e32e83a130052e94f" } }, "conversation": { "links": { "self": "/v1/conversations/57c8d2b365f7cc14004e674f" }, "data": { "type": "conversation", "id": "57c8d2b365f7cc14004e674f" } }, "userMentions": { "data": [ { "type": "user", "id": "57c8ccd7b417854d0003246b" } ] } }, "links": { "self": "/v1/notes/5828a3be7c7f551a00b5b720" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] }, "get": { "security": [ { "httpBearer": [] } ], "tags": [ "Conversations (Notes)", "Notes (Conversations)" ], "summary": "Get notes by conversation", "description": "Retrieves notes found in a specific conversation based on the conversation ID.\n\nTo learn more, see [Notes](https://help.kustomer.com/using-notes-HJvDjNP58) in the Kustomer Help Center.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.note.read|org.permission.note.read|", "operationId": "GetNotesByConversation", "parameters": [ { "name": "id", "in": "path", "description": "Unique ID of the conversation.", "required": true, "style": "simple", "schema": { "type": "string", "example": "57c8d2b365f7cc14004e674f" } }, { "name": "page", "in": "query", "schema": { "type": "number", "default": 1, "example": 1 }, "description": "Number of pages to return for results. Default value: 1." }, { "name": "pageSize", "in": "query", "required": false, "schema": { "type": "number", "default": 100, "example": 100 }, "description": "Number of results to return per page. Default value: 100." } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "meta": { "type": "object", "properties": { "pageSize": { "type": "integer" }, "page": { "type": "integer" } }, "required": [ "pageSize", "page" ] }, "data": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "body": { "type": "string" }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" } }, "required": [ "body", "createdAt", "updatedAt" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "customer": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "createdBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "conversation": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "userMentions": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } } }, "required": [ "data" ] } }, "required": [ "org", "customer", "createdBy", "conversation", "userMentions" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "links": { "type": "object", "properties": { "self": { "type": "string" }, "first": { "type": "string" }, "prev": { "type": "string", "nullable": true }, "next": { "type": "string", "nullable": true } }, "required": [ "self", "first", "prev", "next" ] } }, "required": [ "meta", "data", "links" ] }, "example": { "meta": { "pageSize": 100, "page": 1 }, "data": [ { "type": "note", "id": "5828a3be7c7f551a00b5b720", "attributes": { "body": "Hey __Agent Smith__, do you know the answer to this problem?", "createdAt": "2016-11-13T17:32:46.480Z", "updatedAt": "2016-11-13T17:32:46.480Z" }, "relationships": { "org": { "links": { "self": "/v1/orgs/57bb5d2e32e83a130052e94e" }, "data": { "type": "org", "id": "57bb5d2e32e83a130052e94e" } }, "customer": { "links": { "self": "/v1/customers/57c08ccde595371400462df2" }, "data": { "type": "customer", "id": "57c08ccde595371400462df2" } }, "createdBy": { "links": { "self": "/v1/users/57bb5d2e32e83a130052e94f" }, "data": { "type": "user", "id": "57bb5d2e32e83a130052e94f" } }, "conversation": { "links": { "self": "/v1/conversations/57c8d2b365f7cc14004e674f" }, "data": { "type": "conversation", "id": "57c8d2b365f7cc14004e674f" } }, "userMentions": { "data": [ { "type": "user", "id": "57c8ccd7b417854d0003246b" } ] } }, "links": { "self": "/v1/notes/5828a3be7c7f551a00b5b720" } } ], "links": { "self": "/v1/conversations/57c8d2b365f7cc14004e674f/notes?page=1&pageSize=100", "first": "/v1/conversations/57c8d2b365f7cc14004e674f/notes?page=1&pageSize=100", "prev": null, "next": null } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] } }, "/customers/bulk": { "post": { "security": [ { "httpBearer": [] } ], "tags": [ "Customers (Bulk)" ], "summary": "Bulk create customers", "description": "Creates customers in bulk.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.customer.write|org.permission.customer.create|", "operationId": "BulkCreateCustomers", "parameters": [], "requestBody": { "description": "", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "maxLength": 256, "nullable": true }, "company": { "type": "string", "nullable": true }, "externalId": { "type": "string", "minLength": 1, "maxLength": 256, "nullable": true }, "username": { "type": "string", "maxLength": 256, "nullable": true }, "signedUpAt": { "type": "string", "format": "date-time", "nullable": true }, "lastActivityAt": { "type": "string", "format": "date-time", "nullable": true }, "lastCustomerActivityAt": { "type": "string", "format": "date-time", "nullable": true }, "lastSeenAt": { "type": "string", "format": "date-time", "nullable": true }, "avatarUrl": { "type": "string", "format": "uri", "nullable": true }, "externalIds": { "type": "array", "items": { "type": "object", "properties": { "externalId": { "type": "string", "minLength": 1, "maxLength": 255 }, "verified": { "type": "boolean" } }, "required": [ "externalId" ], "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "sharedExternalIds": { "type": "array", "items": { "type": "object", "properties": { "externalId": { "type": "string", "minLength": 1, "maxLength": 255 }, "verified": { "type": "boolean" } }, "required": [ "externalId" ], "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "emails": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "home", "work", "other" ] }, "email": { "type": "string", "format": "email-relaxed" }, "verified": { "type": "boolean" } }, "required": [ "email" ], "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "sharedEmails": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "home", "work", "other" ] }, "email": { "type": "string", "format": "email-relaxed" }, "verified": { "type": "boolean" } }, "required": [ "email" ], "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "phones": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "mobile", "home", "work", "fax", "other" ] }, "phone": { "type": "string", "format": "phone-number" }, "verified": { "type": "boolean" } }, "required": [ "phone" ], "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "sharedPhones": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "mobile", "home", "work", "fax", "other" ] }, "phone": { "type": "string", "format": "phone-number" }, "verified": { "type": "boolean" } }, "required": [ "phone" ], "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "whatsapps": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "mobile" ] }, "phone": { "type": "string", "format": "whatsapp-number" }, "verified": { "type": "boolean" } }, "required": [ "phone" ], "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "facebookIds": { "type": "array", "items": { "type": "object", "properties": { "pageId": { "type": "string", "maxLength": 255 }, "userId": { "type": "string", "maxLength": 255 }, "name": { "type": "string", "maxLength": 255 } }, "required": [ "pageId", "userId" ], "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "instagramIds": { "type": "array", "items": { "type": "object", "properties": { "pageId": { "type": "string", "maxLength": 255 }, "threadId": { "type": "string", "maxLength": 255 }, "username": { "type": "string", "maxLength": 255 }, "instagramId": { "type": "string", "maxLength": 255 } }, "required": [ "pageId", "threadId", "username" ], "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "socials": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "twitter", "facebook", "instagram", "linkedin", "pinterest" ] }, "userid": { "type": "string", "maxLength": 256 }, "username": { "type": "string", "minLength": 1, "maxLength": 256 }, "url": { "type": "string", "format": "uri" }, "verified": { "type": "boolean" } }, "required": [ "type", "username" ], "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "sharedSocials": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "twitter", "facebook", "instagram", "linkedin", "pinterest" ] }, "userid": { "type": "string", "maxLength": 256 }, "username": { "type": "string", "minLength": 1, "maxLength": 256 }, "url": { "type": "string", "format": "uri" }, "verified": { "type": "boolean" } }, "required": [ "type", "username" ], "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "urls": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "website", "blog", "other" ] }, "url": { "type": "string", "format": "url" } }, "required": [ "url" ], "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "locations": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "home", "work", "other" ], "nullable": true }, "name": { "type": "string", "nullable": true }, "address": { "type": "string", "maxLength": 256, "nullable": true }, "address2": { "type": "string", "maxLength": 256, "nullable": true }, "address3": { "type": "string", "maxLength": 256, "nullable": true }, "latitude": { "type": "number", "nullable": true }, "longitude": { "type": "number", "nullable": true }, "countryCode": { "type": "string", "minLength": 2, "maxLength": 2, "nullable": true }, "countryName": { "type": "string", "maxLength": 64, "nullable": true }, "regionCode": { "type": "string", "maxLength": 2, "nullable": true }, "regionName": { "type": "string", "maxLength": 128, "nullable": true }, "cityName": { "type": "string", "maxLength": 128, "nullable": true }, "zipCode": { "type": "string", "maxLength": 30, "nullable": true }, "areaCode": { "type": "string", "maxLength": 30, "nullable": true } }, "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "locale": { "type": "string", "maxLength": 16, "nullable": true }, "timeZone": { "type": "string", "maxLength": 64, "nullable": true }, "tags": { "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 64, "pattern": "^[0-9a-zA-ZÀ-ÿ_/<>\\-.]{1}[0-9a-zA-ZÀ-ÿ _/<>\\-.]{0,63}$" }, "maxItems": 20, "uniqueItems": true }, "sentiment": { "type": "object", "properties": { "polarity": { "type": "number", "enum": [ -1, 0, 1 ] }, "confidence": { "type": "number", "minimum": -1, "maximum": 1 } }, "required": [ "polarity", "confidence" ], "additionalProperties": false }, "custom": { "type": "object", "maxProperties": 100, "additionalProperties": false }, "birthdayAt": { "type": "string", "format": "date-time", "nullable": true }, "gender": { "type": "string", "enum": [ "m", "f" ], "nullable": true }, "createdAt": { "type": "string", "format": "date-time" }, "importedAt": { "type": "string", "format": "date-time" }, "rev": { "type": "number" }, "defaultLang": { "type": "string", "maxLength": 100, "nullable": true } }, "additionalProperties": false }, "maxItems": 100 } } } }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "ids": { "type": "array" }, "context": { "type": "string" }, "status": { "type": "string" }, "v2": { "type": "boolean" }, "payload": { "type": "object", "properties": { "api": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" } }, "required": [ "name" ] } }, "path": { "type": "string" }, "user": { "type": "object", "properties": { "id": { "type": "string" }, "userType": { "type": "string" }, "roles": { "type": "array", "items": { "type": "string" } }, "orgName": { "type": "string" }, "subject": { "type": "string" }, "org": { "type": "string" } }, "required": [ "id", "userType", "roles", "orgName", "subject", "org" ] }, "requestId": { "type": "string" }, "service": { "type": "string" }, "method": { "type": "string" } }, "required": [ "data", "path", "user", "requestId", "service", "method" ] } }, "required": [ "api" ] }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "completed": { "type": "boolean" } }, "required": [ "ids", "context", "status", "v2", "payload", "createdAt", "updatedAt", "completed" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "createdBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "createdBy" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "bulk", "id": "5b3bddb67f8469003df370a4", "attributes": { "ids": [], "context": "api.sobjects.customers.bulk-create", "status": "complete", "v2": true, "payload": { "api": { "data": [ { "name": "Customer1" }, { "name": "Customer2" } ], "path": "/v1/customers", "user": { "id": "5a96dac46dd73800112fab30", "userType": "user", "roles": [ "org" ], "orgName": "mycompany", "subject": "5a96dac46dd73800112fab30", "org": "5a96dac36dd73800112fab2e" }, "requestId": "5b3bddb6b6e494001779fa38", "service": "sobjects", "method": "POST" } }, "createdAt": "2018-07-03T20:33:58.486Z", "updatedAt": "2018-07-03T20:34:03.873Z", "completed": true }, "relationships": { "org": { "links": { "self": "/v1/orgs/5a96dac36dd73800112fab2e" }, "data": { "type": "org", "id": "5a96dac36dd73800112fab2e" } }, "createdBy": { "links": { "self": "/v1/users/5a96dac46dd73800112fab30" }, "data": { "type": "user", "id": "5a96dac46dd73800112fab30" } } }, "links": { "self": "/v1/bulk/5b3bddb67f8469003df370a4" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] }, "put": { "security": [ { "httpBearer": [] } ], "tags": [ "Customers (Bulk)" ], "summary": "Bulk batch update customers", "description": "Updates a bulk batch of customers.\n\nUse the `ids` query param to update multiple customers in bulk with the same data.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.customer.write|org.permission.customer.update|", "operationId": "BulkBatchUpdateCustomers", "parameters": [ { "schema": { "type": "string", "example": "id1,id2" }, "in": "query", "name": "ids", "description": "Comma-separated list of unique customer IDs." } ], "requestBody": { "description": "", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string", "maxLength": 256, "nullable": true }, "company": { "type": "string", "nullable": true }, "externalId": { "type": "string", "minLength": 1, "maxLength": 256, "nullable": true }, "username": { "type": "string", "maxLength": 256, "nullable": true }, "signedUpAt": { "type": "string", "format": "date-time", "nullable": true }, "lastActivityAt": { "type": "string", "format": "date-time", "nullable": true }, "lastCustomerActivityAt": { "type": "string", "format": "date-time", "nullable": true }, "lastSeenAt": { "type": "string", "format": "date-time", "nullable": true }, "avatarUrl": { "type": "string", "format": "uri", "nullable": true }, "externalIds": { "type": "array", "items": { "type": "object", "properties": { "externalId": { "type": "string", "minLength": 1, "maxLength": 255 }, "verified": { "type": "boolean" } }, "required": [ "externalId" ], "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "sharedExternalIds": { "type": "array", "items": { "type": "object", "properties": { "externalId": { "type": "string", "minLength": 1, "maxLength": 255 }, "verified": { "type": "boolean" } }, "required": [ "externalId" ], "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "emails": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "home", "work", "other" ] }, "email": { "type": "string", "format": "email-relaxed" }, "verified": { "type": "boolean" } }, "required": [ "email" ], "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "sharedEmails": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "home", "work", "other" ] }, "email": { "type": "string", "format": "email-relaxed" }, "verified": { "type": "boolean" } }, "required": [ "email" ], "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "phones": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "mobile", "home", "work", "fax", "other" ] }, "phone": { "type": "string", "format": "phone-number" }, "verified": { "type": "boolean" } }, "required": [ "phone" ], "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "sharedPhones": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "mobile", "home", "work", "fax", "other" ] }, "phone": { "type": "string", "format": "phone-number" }, "verified": { "type": "boolean" } }, "required": [ "phone" ], "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "facebookIds": { "type": "array", "items": { "type": "object", "properties": { "pageId": { "type": "string", "maxLength": 255 }, "userId": { "type": "string", "maxLength": 255 }, "name": { "type": "string", "maxLength": 255 } }, "required": [ "pageId", "userId" ], "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "socials": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "twitter", "facebook", "instagram", "linkedin", "pinterest" ] }, "userid": { "type": "string", "maxLength": 256 }, "username": { "type": "string", "minLength": 1, "maxLength": 256 }, "url": { "type": "string", "format": "uri" }, "verified": { "type": "boolean" } }, "required": [ "type", "username" ], "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "sharedSocials": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "twitter", "facebook", "instagram", "linkedin", "pinterest" ] }, "userid": { "type": "string", "maxLength": 256 }, "username": { "type": "string", "minLength": 1, "maxLength": 256 }, "url": { "type": "string", "format": "uri" }, "verified": { "type": "boolean" } }, "required": [ "type", "username" ], "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "urls": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "website", "blog", "other" ] }, "url": { "type": "string", "format": "url" } }, "required": [ "url" ], "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "locations": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "home", "work", "other" ], "nullable": true }, "name": { "type": "string", "nullable": true }, "address": { "type": "string", "maxLength": 256, "nullable": true }, "address2": { "type": "string", "maxLength": 256, "nullable": true }, "address3": { "type": "string", "maxLength": 256, "nullable": true }, "latitude": { "type": "number", "nullable": true }, "longitude": { "type": "number", "nullable": true }, "countryCode": { "type": "string", "minLength": 2, "maxLength": 2, "nullable": true }, "countryName": { "type": "string", "maxLength": 64, "nullable": true }, "regionCode": { "type": "string", "maxLength": 2, "nullable": true }, "regionName": { "type": "string", "maxLength": 128, "nullable": true }, "cityName": { "type": "string", "maxLength": 128, "nullable": true }, "zipCode": { "type": "string", "maxLength": 30, "nullable": true }, "areaCode": { "type": "string", "maxLength": 30, "nullable": true } }, "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "locale": { "type": "string", "maxLength": 16, "nullable": true }, "timeZone": { "type": "string", "maxLength": 64, "nullable": true }, "tags": { "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 64, "pattern": "^[0-9a-zA-ZÀ-ÿ_/<>\\-.]{1}[0-9a-zA-ZÀ-ÿ _/<>\\-.]{0,63}$" }, "maxItems": 20, "uniqueItems": true }, "sentiment": { "type": "object", "properties": { "polarity": { "type": "number", "enum": [ -1, 0, 1 ] }, "confidence": { "type": "number", "minimum": -1, "maximum": 1 } }, "required": [ "polarity", "confidence" ], "additionalProperties": false }, "custom": { "type": "object", "maxProperties": 100, "additionalProperties": false }, "birthdayAt": { "type": "string", "format": "date-time", "nullable": true }, "gender": { "type": "string", "enum": [ "m", "f" ], "nullable": true }, "createdAt": { "type": "string", "format": "date-time" }, "importedAt": { "type": "string", "format": "date-time" }, "rev": { "type": "number" }, "defaultLang": { "type": "string", "maxLength": 100, "nullable": true } }, "required": [ "id" ] }, "maxItems": 100 } } } }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "ids": { "type": "array" }, "context": { "type": "string" }, "status": { "type": "string" }, "v2": { "type": "boolean" }, "payload": { "type": "object", "properties": { "api": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" } }, "required": [ "id", "name" ] } }, "path": { "type": "string" }, "user": { "type": "object", "properties": { "id": { "type": "string" }, "userType": { "type": "string" }, "roles": { "type": "array", "items": { "type": "string" } }, "orgName": { "type": "string" }, "subject": { "type": "string" }, "org": { "type": "string" } }, "required": [ "id", "userType", "roles", "orgName", "subject", "org" ] }, "requestId": { "type": "string" }, "service": { "type": "string" }, "method": { "type": "string" } }, "required": [ "data", "path", "user", "requestId", "service", "method" ] } }, "required": [ "api" ] }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "completed": { "type": "boolean" } }, "required": [ "ids", "context", "status", "v2", "payload", "createdAt", "updatedAt", "completed" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "createdBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "createdBy" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "bulk", "id": "5b3bddb67f8469003df370a4", "attributes": { "ids": [], "context": "api.sobjects.customers.bulk-create", "status": "complete", "v2": true, "payload": { "api": { "data": [ { "id": "5a96dac46dd73800112fab28", "name": "Customer1" }, { "id": "5a96dac46dd73800112fab29", "name": "Customer2" } ], "path": "/v1/customers", "user": { "id": "5a96dac46dd73800112fab30", "userType": "user", "roles": [ "org" ], "orgName": "mycompany", "subject": "5a96dac46dd73800112fab30", "org": "5a96dac36dd73800112fab2e" }, "requestId": "5b3bddb6b6e494001779fa38", "service": "sobjects", "method": "POST" } }, "createdAt": "2018-07-03T20:33:58.486Z", "updatedAt": "2018-07-03T20:34:03.873Z", "completed": true }, "relationships": { "org": { "links": { "self": "/v1/orgs/5a96dac36dd73800112fab2e" }, "data": { "type": "org", "id": "5a96dac36dd73800112fab2e" } }, "createdBy": { "links": { "self": "/v1/users/5a96dac46dd73800112fab30" }, "data": { "type": "user", "id": "5a96dac46dd73800112fab30" } } }, "links": { "self": "/v1/bulk/5b3bddb67f8469003df370a4" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] }, "delete": { "security": [ { "httpBearer": [] } ], "tags": [ "Customers (Bulk)" ], "summary": "Bulk delete customers", "description": "Deletes multiple customers in bulk.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.customer.delete|org.permission.customer.delete|", "operationId": "BulkDeleteCustomers", "parameters": [ { "schema": { "type": "string", "example": "id1,id2" }, "in": "query", "description": "Comma-separated list of unique customer IDs.", "name": "ids" } ], "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "ids": { "type": "array", "items": { "type": "string" } }, "context": { "type": "string" }, "status": { "type": "string" }, "v2": { "type": "boolean" }, "payload": { "type": "object", "properties": { "api": { "type": "object", "properties": { "data": { "type": "object" }, "path": { "type": "string" }, "user": { "type": "object", "properties": { "id": { "type": "string" }, "userType": { "type": "string" }, "roles": { "type": "array", "items": { "type": "string" } }, "orgName": { "type": "string" }, "subject": { "type": "string" }, "org": { "type": "string" } }, "required": [ "id", "userType", "roles", "orgName", "subject", "org" ] }, "requestId": { "type": "string" }, "service": { "type": "string" }, "method": { "type": "string" } }, "required": [ "data", "path", "user", "requestId", "service", "method" ] } }, "required": [ "api" ] }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "completed": { "type": "boolean" } }, "required": [ "ids", "context", "status", "v2", "payload", "createdAt", "updatedAt", "completed" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "createdBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "createdBy" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "bulk", "id": "5b3bddb67f8469003df370a4", "attributes": { "ids": [ "id1", "id2" ], "context": "api.sobjects.customers.bulk-delete", "status": "complete", "v2": true, "payload": { "api": { "data": {}, "path": "/v1/klasses/orders", "user": { "id": "5a96dac46dd73800112fab30", "userType": "user", "roles": [ "org" ], "orgName": "mycompany", "subject": "5a96dac46dd73800112fab30", "org": "5a96dac36dd73800112fab2e" }, "requestId": "5b3bddb6b6e494001779fa38", "service": "sobjects", "method": "POST" } }, "createdAt": "2018-07-03T20:33:58.486Z", "updatedAt": "2018-07-03T20:34:03.873Z", "completed": true }, "relationships": { "org": { "links": { "self": "/v1/orgs/5a96dac36dd73800112fab2e" }, "data": { "type": "org", "id": "5a96dac36dd73800112fab2e" } }, "createdBy": { "links": { "self": "/v1/users/5a96dac46dd73800112fab30" }, "data": { "type": "user", "id": "5a96dac46dd73800112fab30" } } }, "links": { "self": "/v1/bulk/5b3bddb67f8469003df370a4" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] } }, "/customers/{id}/conversations": { "post": { "security": [ { "httpBearer": [] } ], "tags": [ "Customers (Conversations)" ], "summary": "Create conversation for customer", "description": "Creates a new, empty conversation for a customer.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.conversation.write|org.permission.conversation.create|\n\n### Custom Attributes\n[Custom attributes](https://help.kustomer.com/define-attributes-Skr924HI) are optional and allow you to specify\ncustom key-value pairs.\n\nKustomer uses a naming convention for custom attributes to specify the field data type with a name suffix:\n\n#### Naming Suffix\n\n* `Num` *number* or *null*\n* `At` *date-time* or *null*\n* `Str` *string* or *null*, length: [ 0 .. 1024 ] characters\n* `Txt` *string* or *null*, length: [ 0 .. 1024 ] characters\n* `Bool` *boolean* or *null*\n* `Url` *string* or *null*, format: *uri*", "operationId": "CreateConversationForCustomer", "parameters": [ { "name": "id", "in": "path", "description": "Unique ID of the customer.", "required": true, "style": "simple", "schema": { "type": "string", "example": "58210c3db0f09110006b7953" } } ], "requestBody": { "description": "", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string", "format": "object-id" }, "externalId": { "type": "string", "maxLength": 256 }, "campaign": { "type": "string", "format": "object-id" }, "name": { "type": "string", "maxLength": 256 }, "status": { "type": "string", "enum": [ "open", "done" ] }, "priority": { "type": "integer", "minimum": 1, "maximum": 5 }, "createdAt": { "type": "string", "format": "date-time" }, "importedAt": { "type": "string", "format": "date-time" }, "direction": { "type": "string", "enum": [ "in", "out" ] }, "replyChannel": { "type": "string", "maxLength": 256, "nullable": true }, "tags": { "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 64, "pattern": "^[0-9a-zA-ZÀ-ÿ_/<>\\-.]{1}[0-9a-zA-ZÀ-ÿ _/<>\\-.]{0,63}$" }, "maxItems": 20, "uniqueItems": true }, "assignedUsers": { "type": "array", "items": { "type": "string", "format": "object-id" }, "maxItems": 10, "uniqueItems": true }, "assignedTeams": { "type": "array", "items": { "type": "string", "format": "object-id" }, "maxItems": 10, "uniqueItems": true }, "custom": { "type": "object", "maxProperties": 100, "additionalProperties": false }, "defaultLang": { "type": "string", "maxLength": 100, "nullable": true }, "queue": { "type": "object", "properties": { "id": { "type": "string", "nullable": true }, "external": { "type": "string", "enum": [ "amazon-connect" ], "nullable": true } }, "anyOf": [ { "required": [ "id" ] }, { "required": [ "external" ] } ], "additionalProperties": false } }, "additionalProperties": false } } } }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "name": { "type": "string" }, "channels": { "type": "array" }, "status": { "type": "string" }, "messageCount": { "type": "integer" }, "noteCount": { "type": "integer" }, "satisfaction": { "type": "integer" }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "modifiedAt": { "type": "string" }, "tags": { "type": "array" }, "suggestedTags": { "type": "array" }, "sentiment": { "type": "object" }, "lastMessageIn": { "type": "object" }, "assignedUsers": { "type": "array" }, "assignedTeams": { "type": "array" }, "firstResponse": { "type": "object" }, "direction": { "type": "string" }, "outboundMessageCount": { "type": "integer" }, "rev": { "type": "integer" } }, "required": [ "name", "channels", "status", "messageCount", "noteCount", "satisfaction", "createdAt", "updatedAt", "modifiedAt", "tags", "suggestedTags", "sentiment", "lastMessageIn", "assignedUsers", "assignedTeams", "firstResponse", "direction", "outboundMessageCount", "rev" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "customer": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "messages": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "links" ] }, "createdBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "modifiedBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "customer", "messages", "createdBy", "modifiedBy" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "conversation", "id": "58228e05d4e96711004eccb7", "attributes": { "name": "New Conversation", "channels": [], "status": "open", "messageCount": 0, "noteCount": 0, "satisfaction": 0, "createdAt": "2016-11-09T02:46:29.789Z", "updatedAt": "2016-11-09T02:46:29.789Z", "modifiedAt": "2016-11-09T02:46:29.789Z", "tags": [], "suggestedTags": [], "sentiment": {}, "lastMessageIn": {}, "assignedUsers": [], "assignedTeams": [], "firstResponse": {}, "direction": "in", "outboundMessageCount": 0, "rev": 1 }, "relationships": { "org": { "links": { "self": "/v1/orgs/57f29863a1dbf61100e6aa92" }, "data": { "type": "org", "id": "57f29863a1dbf61100e6aa92" } }, "customer": { "links": { "self": "/v1/customers/58210c3db0f09110006b7953" }, "data": { "type": "customer", "id": "58210c3db0f09110006b7953" } }, "messages": { "links": { "self": "/v1/conversations/58228e05d4e96711004eccb7/messages" } }, "createdBy": { "links": { "self": "/v1/users/58190b991f2932100010d683" }, "data": { "type": "user", "id": "58190b991f2932100010d683" } }, "modifiedBy": { "links": { "self": "/v1/users/58190b991f2932100010d683" }, "data": { "type": "user", "id": "58190b991f2932100010d683" } } }, "links": { "self": "/v1/conversations/58228e05d4e96711004eccb7" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] }, "get": { "security": [ { "httpBearer": [] } ], "tags": [ "Customers (Conversations)" ], "summary": "Get conversations by customer", "description": "Retrieves a paginated list of conversations using the unique Customer ID.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.conversation.read|org.permission.conversation.read|", "operationId": "GetConversationsByCustomer", "parameters": [ { "name": "id", "in": "path", "description": "Unique ID of the customer.", "required": true, "style": "simple", "schema": { "type": "string", "example": "58210c3db0f09110006b7953" } }, { "name": "page", "in": "query", "schema": { "type": "number", "default": 1, "example": 1 }, "description": "Number of pages to return for results. Default value: 1." }, { "name": "pageSize", "in": "query", "required": false, "schema": { "type": "number", "default": 100, "example": 100 }, "description": "Number of results to return per page. Default value: 100." }, { "name": "fromDate", "in": "query", "required": false, "schema": { "type": "string", "format": "date-time", "example": "2016-11-09T00:00:00.000Z" }, "description": "`date-time` string in Internet Date/Time format ([ISO 8601](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6))." } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "meta": { "type": "object", "properties": { "pageSize": { "type": "integer" }, "page": { "type": "integer" } }, "required": [ "pageSize", "page" ] }, "data": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "name": { "type": "string" }, "channels": { "type": "array", "items": { "type": "string" } }, "status": { "type": "string" }, "messageCount": { "type": "integer" }, "noteCount": { "type": "integer" }, "satisfaction": { "type": "integer" }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "modifiedAt": { "type": "string" }, "tags": { "type": "array" }, "suggestedTags": { "type": "array" }, "sentiment": { "type": "object" }, "lastMessageIn": { "type": "object" }, "assignedUsers": { "type": "array" }, "assignedTeams": { "type": "array" }, "firstResponse": { "type": "object" }, "direction": { "type": "string" }, "outboundMessageCount": { "type": "integer" }, "rev": { "type": "integer" } }, "required": [ "name", "channels", "status", "messageCount", "noteCount", "satisfaction", "createdAt", "updatedAt", "modifiedAt", "tags", "suggestedTags", "sentiment", "lastMessageIn", "assignedUsers", "assignedTeams", "firstResponse", "direction", "outboundMessageCount", "rev" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "customer": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "messages": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "links" ] }, "createdBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "modifiedBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "customer", "messages", "createdBy", "modifiedBy" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "links": { "type": "object", "properties": { "self": { "type": "string" }, "first": { "type": "string" }, "prev": { "type": "string", "nullable": true }, "next": { "type": "string", "nullable": true } }, "required": [ "self", "first", "prev", "next" ] } }, "required": [ "meta", "data", "links" ] }, "example": { "meta": { "pageSize": 100, "page": 1 }, "data": [ { "type": "conversation", "id": "58228e05d4e96711004eccb7", "attributes": { "name": "Conversation1", "channels": [ "email" ], "status": "done", "messageCount": 0, "noteCount": 0, "satisfaction": 0, "createdAt": "2016-11-09T02:46:29.789Z", "updatedAt": "2016-11-09T03:23:34.064Z", "modifiedAt": "2016-11-09T03:23:34.064Z", "tags": [], "suggestedTags": [], "sentiment": {}, "lastMessageIn": {}, "assignedUsers": [], "assignedTeams": [], "firstResponse": {}, "direction": "in", "outboundMessageCount": 0, "rev": 1 }, "relationships": { "org": { "links": { "self": "/v1/orgs/57f29863a1dbf61100e6aa92" }, "data": { "type": "org", "id": "57f29863a1dbf61100e6aa92" } }, "customer": { "links": { "self": "/v1/customers/58210c3db0f09110006b7953" }, "data": { "type": "customer", "id": "58210c3db0f09110006b7953" } }, "messages": { "links": { "self": "/v1/conversations/58228e05d4e96711004eccb7/messages" } }, "createdBy": { "links": { "self": "/v1/users/58190b991f2932100010d683" }, "data": { "type": "user", "id": "58190b991f2932100010d683" } }, "modifiedBy": { "links": { "self": "/v1/users/58190b991f2932100010d683" }, "data": { "type": "user", "id": "58190b991f2932100010d683" } } }, "links": { "self": "/v1/conversations/58228e05d4e96711004eccb7" } } ], "links": { "self": "/v1/customers/58210c3db0f09110006b7953/conversations?page=1&pageSize=100&fromDate=2016-11-09T00:00:00.000Z", "first": "/v1/customers/58210c3db0f09110006b7953/conversations?page=1&pageSize=100&fromDate=2016-11-09T00:00:00.000Z", "prev": null, "next": null } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] } }, "/customers/{id}/drafts": { "get": { "security": [ { "httpBearer": [] } ], "tags": [ "Customers (Drafts)" ], "summary": "Get all drafts for customer", "description": "Retrieves all outbound drafts to a customer based on the unique customer ID.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.draft.read|org.permission.draft.read|", "operationId": "GetAllDraftsByCustomer", "parameters": [ { "name": "id", "in": "path", "description": "Unique ID of the customer.", "required": true, "style": "simple", "schema": { "type": "string", "example": "58210c3db0f09110006b7953" } }, { "name": "page", "in": "query", "schema": { "type": "number", "default": 1, "example": 1 }, "description": "Number of pages to return for results. Default value: 1." }, { "name": "pageSize", "in": "query", "required": false, "schema": { "type": "number", "default": 100, "example": 100 }, "description": "Number of results to return per page. Default value: 100." }, { "name": "include", "in": "query", "required": false, "schema": { "type": "string", "example": "attachments" }, "description": "List of resources to include in this response. Use a comma to separate resources. Supports the `attachments` resource. " } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "meta": { "type": "object", "properties": { "pageSize": { "type": "integer" }, "page": { "type": "integer" } }, "required": [ "pageSize", "page" ] }, "data": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string" }, "attributes": { "type": "object", "properties": { "channel": { "type": "string" }, "body": { "type": "string" }, "payload": { "type": "object", "properties": { "draftJs": { "type": "object", "properties": { "blocks": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "object" }, "entityRanges": { "type": "array" }, "inlineStyleRanges": { "type": "array" }, "depth": { "type": "integer" }, "type": { "type": "string" }, "text": { "type": "string" }, "key": { "type": "string" } }, "required": [ "data", "entityRanges", "inlineStyleRanges", "depth", "type", "text", "key" ] } }, "entityMap": { "type": "object" } }, "required": [ "blocks", "entityMap" ] } }, "required": [ "draftJs" ] }, "status": { "type": "string" }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "modifiedAt": { "type": "string" } }, "required": [ "channel", "body", "status", "createdAt", "updatedAt", "modifiedAt" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "data", "links" ] }, "customer": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "data", "links" ] }, "createdBy": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "data", "links" ] }, "modifiedBy": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "data", "links" ] }, "conversation": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "data", "links" ] } }, "required": [ "org", "customer", "createdBy", "modifiedBy" ] } }, "required": [ "id", "type", "attributes", "relationships" ] } }, "links": { "type": "object", "properties": { "self": { "type": "string" }, "first": { "type": "string" }, "prev": { "type": "string", "nullable": true }, "next": { "type": "string", "nullable": true } }, "required": [ "self", "first", "prev", "next" ] }, "included": { "type": "array" } }, "required": [ "meta", "data", "links", "included" ] }, "example": { "meta": { "pageSize": 100, "page": 1 }, "data": [ { "id": "58210c6c2a8b9910002f6730", "type": "draft", "attributes": { "channel": "chat", "body": "", "payload": { "draftJs": { "blocks": [ { "data": {}, "entityRanges": [], "inlineStyleRanges": [], "depth": 0, "type": "unstyled", "text": "", "key": "dv926" } ], "entityMap": {} } }, "status": "draft", "createdAt": "2016-11-07T23:21:16.945Z", "updatedAt": "2016-11-08T18:49:32.730Z", "modifiedAt": "2016-11-08T18:49:32.730Z" }, "relationships": { "org": { "data": { "type": "org", "id": "57f29863a1dbf61100e6aa92" }, "links": { "self": "/v1/orgs/57f29863a1dbf61100e6aa92" } }, "customer": { "data": { "type": "customer", "id": "58210c3db0f09110006b7953" }, "links": { "self": "/v1/customers/58210c3db0f09110006b7953" } }, "createdBy": { "data": { "type": "user", "id": "57fd2d309d0ef811009cfdd6" }, "links": { "self": "/v1/users/57fd2d309d0ef811009cfdd6" } }, "modifiedBy": { "data": { "type": "user", "id": "58190b991f2932100010d683" }, "links": { "self": "/v1/users/58190b991f2932100010d683" } }, "conversation": { "data": { "type": "conversation", "id": "58210c3d728107110018662f" }, "links": { "self": "/v1/conversations/58210c3d728107110018662f" } } } }, { "id": "58210cedbff98a10008531da", "type": "draft", "attributes": { "channel": "chat", "body": "Hi John! ", "payload": { "draftJs": { "blocks": [ { "data": {}, "entityRanges": [], "inlineStyleRanges": [], "depth": 0, "type": "unstyled", "text": "Hi John! ", "key": "a789" } ], "entityMap": {} } }, "status": "draft", "createdAt": "2016-11-07T23:23:25.706Z", "updatedAt": "2016-11-09T16:13:12.665Z", "modifiedAt": "2016-11-09T16:13:12.665Z" }, "relationships": { "org": { "data": { "type": "org", "id": "57f29863a1dbf61100e6aa92" }, "links": { "self": "/v1/orgs/57f29863a1dbf61100e6aa92" } }, "customer": { "data": { "type": "customer", "id": "58210c3db0f09110006b7953" }, "links": { "self": "/v1/customers/58210c3db0f09110006b7953" } }, "createdBy": { "data": { "type": "user", "id": "57fd2d309d0ef811009cfdd6" }, "links": { "self": "/v1/users/57fd2d309d0ef811009cfdd6" } }, "modifiedBy": { "data": { "type": "user", "id": "5808d9c95cf6ce1100e1acda" }, "links": { "self": "/v1/users/5808d9c95cf6ce1100e1acda" } }, "conversation": { "data": { "type": "conversation", "id": "58210c99b0f09110006b7969" }, "links": { "self": "/v1/conversations/58210c99b0f09110006b7969" } } } }, { "id": "5823e4d3bff98a100085320e", "type": "draft", "attributes": { "channel": "email", "body": "A great response", "status": "draft", "createdAt": "2016-11-10T03:09:07.575Z", "updatedAt": "2016-11-10T03:16:55.464Z", "modifiedAt": "2016-11-10T03:16:55.464Z" }, "relationships": { "org": { "data": { "type": "org", "id": "57f29863a1dbf61100e6aa92" }, "links": { "self": "/v1/orgs/57f29863a1dbf61100e6aa92" } }, "customer": { "data": { "type": "customer", "id": "58210c3db0f09110006b7953" }, "links": { "self": "/v1/customers/58210c3db0f09110006b7953" } }, "createdBy": { "data": { "type": "user", "id": "58190b991f2932100010d683" }, "links": { "self": "/v1/users/58190b991f2932100010d683" } }, "modifiedBy": { "data": { "type": "user", "id": "58190b991f2932100010d683" }, "links": { "self": "/v1/users/58190b991f2932100010d683" } } } } ], "links": { "self": "/v1/customers/58210c3db0f09110006b7953/drafts?include=attachments&page=1&pageSize=100", "first": "/v1/customers/58210c3db0f09110006b7953/drafts?include=attachments&page=1&pageSize=100", "prev": null, "next": null }, "included": [] } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] }, "post": { "security": [ { "httpBearer": [] } ], "tags": [ "Customers (Drafts)" ], "summary": "Create draft for customer", "description": "Creates an outbound draft to a customer through a specific channel (email, SMS, Facebook DM, etc).\n\nUse the `sendAt` property to designate a future date/time for the drafted message to be sent at.\n\nYou can also create [note](https://help.kustomer.com/using-notes-HJvDjNP58) drafts by specifying the channel as 'note' in the request body channel field. You can have one note draft per conversation.\n\n### Rate Limit\nCustomer drafts are subject to a rate limit. A single client can create up to 120 drafts per minute per customer, including drafts scheduled for the future.\n\nA `429 Too Many Requests` response will be returned if the rate limit has been reached for a customer.", "operationId": "CreateDraftByCustomer", "parameters": [ { "name": "id", "in": "path", "description": "Unique ID of the customer.", "required": true, "style": "simple", "schema": { "type": "string", "example": "58210c3db0f09110006b7953" } } ], "requestBody": { "description": "", "content": { "application/json": { "schema": { "oneOf": [ { "title": "Email", "type": "object", "properties": { "channel": { "type": "string", "enum": [ "email" ], "description": "The communication channel for the message." }, "conversation": { "type": "string", "format": "object-id" }, "app": { "type": "string", "enum": [ "gmail", "postmark" ] }, "customer": { "type": "string", "format": "object-id" }, "auto": { "type": "boolean", "description": "If true, message was automatically generated from a Kustomer workflow or auto-response feature. If set to true, this message will be excluded from reporting metrics. If false, message was created by a manual method." }, "sendAt": { "type": "string", "format": "date-time-math", "nullable": true, "description": "A timestamp for a future date/time the drafted message to be sent at." }, "source": { "type": "string", "enum": [ "bulk", "satisfaction" ] }, "lang": { "type": "string", "maxLength": 100, "nullable": true, "description": "The language the message is in." }, "shortcuts": { "type": "array", "description": "The ID string associated with a shortcut. Shortcuts are pre-defined blocks of text defined in Kustomer. See [Get All Shortcuts](https://developer.kustomer.com/kustomer-api-docs/reference/getallshortcuts) endpoint view currently available shortcuts or create a shortcut with the [Create Shortcut](https://developer.kustomer.com/kustomer-api-docs/reference/createashortcut) endpoint. to Learn more about shortcuts in the [Use workspace shortcuts](https://help.kustomer.com/en_us/use-shortcuts-BymTcNSU) article.", "items": { "type": "string", "format": "object-id" } }, "kbArticles": { "type": "array", "items": { "type": "string", "format": "object-id" } }, "to": { "oneOf": [ { "type": "array", "items": { "type": "object", "properties": { "email": { "type": "string", "format": "email-relaxed", "minLength": 3, "maxLength": 256 }, "name": { "type": "string", "minLength": 1 } }, "required": [ "email" ], "additionalProperties": false } }, { "type": "object", "properties": { "email": { "type": "string", "format": "email-relaxed", "minLength": 3, "maxLength": 256 }, "name": { "type": "string", "minLength": 1 } }, "required": [ "email" ], "additionalProperties": false } ] }, "from": { "type": "object", "properties": { "email": { "type": "string", "format": "email-relaxed", "minLength": 3, "maxLength": 256 }, "name": { "type": "string", "minLength": 1 } }, "required": [ "email" ], "additionalProperties": false }, "body": { "type": "string", "maxLength": 10240 }, "cc": { "type": "array", "items": { "type": "object", "properties": { "email": { "type": "string", "format": "email-relaxed", "minLength": 3, "maxLength": 256 }, "name": { "type": "string", "minLength": 1 } }, "required": [ "email" ], "additionalProperties": false } }, "bcc": { "type": "array", "items": { "type": "object", "properties": { "email": { "type": "string", "format": "email-relaxed", "minLength": 3, "maxLength": 256 }, "name": { "type": "string", "minLength": 1 } }, "required": [ "email" ], "additionalProperties": false } }, "subject": { "type": "string", "minLength": 1 }, "replyTo": { "type": "string", "format": "email-relaxed", "minLength": 3, "maxLength": 256 }, "headers": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1 }, "value": { "type": "string", "minLength": 1 } }, "required": [ "name" ], "additionalProperties": false } }, "template": { "type": "string", "format": "object-id", "nullable": true }, "payload": { "type": "object" } }, "required": [ "channel" ], "additionalProperties": false }, { "title": "SMS", "type": "object", "properties": { "channel": { "type": "string", "enum": [ "sms" ] }, "app": { "type": "string", "enum": [ "twilio", "zipwhip" ] }, "conversation": { "type": "string", "format": "object-id" }, "customer": { "type": "string", "format": "object-id" }, "auto": { "type": "boolean" }, "sendAt": { "type": "string", "description": "A timestamp for a future date/time the drafted message to be sent at.", "format": "date-time-math", "nullable": true }, "source": { "type": "string", "enum": [ "bulk", "satisfaction" ] }, "lang": { "type": "string", "maxLength": 100, "nullable": true }, "shortcuts": { "type": "array", "items": { "type": "string", "format": "object-id" } }, "kbArticles": { "type": "array", "items": { "type": "string", "format": "object-id" } }, "to": { "type": "string", "format": "phone-number" }, "from": { "type": "string", "maxLength": 32 }, "body": { "type": "string", "maxLength": 1600 }, "payload": { "type": "object" } }, "required": [ "channel" ], "additionalProperties": false }, { "title": "WhatsApp (Basic Message)", "description": "Use this set of params to send a basic WhatsApp message with text, attached media, or attached media with a caption.", "allOf": [ { "type": "object", "properties": { "channel": { "type": "string", "enum": [ "whatsapp" ] }, "conversation": { "type": "string", "format": "object-id" }, "customer": { "type": "string", "format": "object-id" }, "auto": { "type": "boolean", "description": "If true, message was automatically generated from a Kustomer workflow or auto-response feature. If set to true, this message will be excluded from reporting metrics. If false, message was created by a manual method." }, "sendAt": { "type": "string", "format": "date-time-math", "nullable": true }, "source": { "type": "string", "enum": [ "bulk", "satisfaction", "biz-rules" ] }, "lang": { "type": "string", "maxLength": 100, "nullable": true }, "shortcuts": { "type": "array", "items": { "type": "string", "format": "object-id" } }, "kbArticles": { "type": "array", "items": { "type": "string", "format": "object-id" } }, "to": { "type": "string", "format": "whatsapp-number" }, "from": { "type": "string", "format": "whatsapp-number" }, "payload": { "type": "object" } }, "required": [ "channel" ] }, { "type": "object", "properties": { "app": { "type": "string", "enum": [ "twilio_whatsapp", "messagebird", "whatsapp" ] }, "body": { "type": "string", "description": "Required if the message doesn't have any attachments. If the message has an image or video attachment, this field is optional and will be used as the caption for the attached media. If the attachment is any other type, this field is ignored.", "maxLength": 1600 } }, "required": [ "channel", "app", "body" ], "additionalProperties": false } ] }, { "title": "WhatsApp (Interactive Message)", "description": "Use this set of params to send an interactive WhatsApp message that can include buttons or lists in addition to header, body, and footer text.", "allOf": [ { "type": "object", "properties": { "channel": { "type": "string", "enum": [ "whatsapp" ] }, "conversation": { "type": "string", "format": "object-id" }, "customer": { "type": "string", "format": "object-id" }, "auto": { "type": "boolean", "description": "If true, message was automatically generated from a Kustomer workflow or auto-response feature. If set to true, this message will be excluded from reporting metrics. If false, message was created by a manual method." }, "sendAt": { "type": "string", "format": "date-time-math", "nullable": true }, "source": { "type": "string", "enum": [ "bulk", "satisfaction", "biz-rules" ] }, "lang": { "type": "string", "maxLength": 100, "nullable": true }, "shortcuts": { "type": "array", "items": { "type": "string", "format": "object-id" } }, "kbArticles": { "type": "array", "items": { "type": "string", "format": "object-id" } }, "to": { "type": "string", "format": "whatsapp-number" }, "from": { "type": "string", "format": "whatsapp-number" }, "payload": { "type": "object" } }, "required": [ "channel" ] }, { "type": "object", "properties": { "app": { "type": "string", "description": "WhatsApp interactive messages are only officially supported for Kustomer native WhatsApp for now.", "enum": [ "whatsapp" ] }, "meta": { "type": "object", "properties": { "interactive": { "oneOf": [ { "title": "Interactive List", "type": "object", "properties": { "type": { "type": "string", "enum": [ "list" ] }, "header": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "text" ] }, "text": { "type": "string", "minLength": 1, "maxLength": 60 } }, "required": [ "type", "text" ], "additionalProperties": false }, "body": { "type": "object", "properties": { "text": { "type": "string", "minLength": 1, "maxLength": 1024 } }, "required": [ "text" ], "additionalProperties": false }, "footer": { "type": "object", "properties": { "text": { "type": "string", "minLength": 1, "maxLength": 60 } }, "required": [ "text" ], "additionalProperties": false }, "action": { "type": "object", "properties": { "button": { "type": "string", "minLength": 1, "maxLength": 20 }, "sections": { "type": "array", "items": { "type": "object", "properties": { "title": { "type": "string", "maxLength": 24 }, "rows": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "maxLength": 200 }, "title": { "type": "string", "maxLength": 24 }, "description": { "type": "string", "maxLength": 72 } }, "required": [ "id", "title" ], "additionalProperties": false }, "maxItems": 10 } }, "required": [ "rows" ], "additionalProperties": false }, "maxItems": 1 } }, "required": [ "button", "sections" ], "additionalProperties": false } }, "required": [ "body", "type", "action" ], "additionalProperties": false }, { "title": "Interactive Button", "type": "object", "properties": { "type": { "type": "string", "enum": [ "button" ] }, "header": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "text" ] }, "text": { "type": "string", "minLength": 1, "maxLength": 60 } }, "required": [ "type", "text" ], "additionalProperties": false }, "body": { "type": "object", "properties": { "text": { "type": "string", "minLength": 1, "maxLength": 1024 } }, "required": [ "text" ], "additionalProperties": false }, "footer": { "type": "object", "properties": { "text": { "type": "string", "minLength": 1, "maxLength": 60 } }, "required": [ "text" ], "additionalProperties": false }, "action": { "type": "object", "properties": { "buttons": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "reply" ] }, "reply": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 256 }, "title": { "type": "string", "minLength": 1, "maxLength": 20 } }, "required": [ "id", "title" ], "additionalProperties": false } }, "required": [ "type", "reply" ], "additionalProperties": false }, "maxItems": 3 } }, "required": [ "buttons" ], "additionalProperties": false } }, "required": [ "action", "type", "body" ], "additionalProperties": false } ] } }, "additionalProperties": false, "required": [ "interactive" ] } }, "required": [ "app", "meta" ], "additionalProperties": false } ] }, { "title": "WhatsApp (Template Message)", "description": "Use this set of params to send a WhatsApp message using a template. To use this feature, you must have at least one template created in WhatsApp Manager and approved by WhatsApp. Using a message template is the only way to initiate conversations with customers, or to reply to customers who have not sent you a message in over 24-hours. For more information, see https://help.kustomer.com/en_us/whatsapp-message-templates-SJBOnNoGo.", "allOf": [ { "type": "object", "properties": { "channel": { "type": "string", "enum": [ "whatsapp" ] }, "conversation": { "type": "string", "format": "object-id" }, "customer": { "type": "string", "format": "object-id" }, "auto": { "type": "boolean", "description": "If true, message was automatically generated from a Kustomer workflow or auto-response feature. If set to true, this message will be excluded from reporting metrics. If false, message was created by a manual method." }, "sendAt": { "type": "string", "format": "date-time-math", "nullable": true }, "source": { "type": "string", "enum": [ "bulk", "satisfaction", "biz-rules" ] }, "lang": { "type": "string", "maxLength": 100, "nullable": true }, "shortcuts": { "type": "array", "items": { "type": "string", "format": "object-id" } }, "kbArticles": { "type": "array", "items": { "type": "string", "format": "object-id" } }, "to": { "type": "string", "format": "whatsapp-number" }, "from": { "type": "string", "format": "whatsapp-number" }, "payload": { "type": "object" } }, "required": [ "channel" ] }, { "type": "object", "properties": { "app": { "type": "string", "description": "WhatsApp templates are only officially supported for Kustomer native WhatsApp for now.", "enum": [ "whatsapp" ] }, "meta": { "type": "object", "properties": { "template": { "type": "string", "format": "object-id", "description": "Template IDs can be found at /v1/whatsapp/accounts/{accountId}/templates" }, "components": { "type": "object", "properties": { "header": { "oneOf": [ { "title": "Text", "type": "object", "properties": { "type": { "type": "string", "enum": [ "text" ] }, "text": { "type": "object", "description": "A map of parameter indices to values. The keys of this map should be single digit, 1-indexed numbers (e.g. '{ 1: \"{ \"type\": \"text\", \"text\": \"YOUR_TEXT_GOES_HERE\" }, 2: { ... } }')", "additionalProperties": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "text" ] }, "text": { "type": "string" } }, "additionalProperties": false } } }, "required": [ "type", "text" ], "additionalProperties": false }, { "title": "Media", "description": "To create a template message with attached media in the header, you will need to first create an empty draft, then add the attachment to it to get an attachment ID, then finally modify the draft to match this payload.", "type": "object", "properties": { "type": { "type": "string", "enum": [ "image", "video", "document" ] }, "attachment": { "type": "string", "format": "object-id" } }, "required": [ "type", "attachment" ], "additionalProperties": false } ] }, "body": { "type": "object", "additionalProperties": { "description": "A map of parameter indices to values. The keys of this map should be single digit, 1-indexed numbers (e.g. '{ 1: \"{ \"type\": \"text\", \"text\": \"YOUR_TEXT_GOES_HERE\" }, 2: { ... } }')", "type": "object", "properties": { "type": { "type": "string", "enum": [ "text" ] }, "text": { "type": "string" } }, "additionalProperties": false } }, "buttons": { "type": "array", "description": "We currently only support parameterizing one button. The `index` and `sub_type` fields should be the same for all entries in this array, and the numbered parameters provided will only be applied to the button indexed by the `index` value provided.", "items": { "type": "object", "additionalProperties": { "description": "Parameters for the button can be provided by adding additional keys to this object. The parameter entries should have keys that are single digit, 1-indexed numbers (e.g. '{ 1: \"{ \"type\": \"text\", \"text\": \"YOUR_TEXT_GOES_HERE\" }, 2: { ... } }')", "type": "object", "properties": { "type": { "type": "string", "enum": [ "text" ] }, "text": { "type": "string" } } }, "properties": { "index": { "type": "number" }, "sub_type": { "type": "string", "enum": [ "url" ] } }, "required": [ "index", "sub_type" ] } } }, "additionalProperties": false } }, "additionalProperties": false, "required": [ "template" ] } }, "required": [ "app", "meta" ], "additionalProperties": false } ] }, { "title": "Chat", "type": "object", "properties": { "channel": { "type": "string", "enum": [ "chat" ] }, "conversation": { "type": "string", "format": "object-id" }, "customer": { "type": "string", "format": "object-id" }, "auto": { "type": "boolean" }, "sendAt": { "description": "A timestamp for a future date/time the drafted message to be sent at.", "type": "string", "format": "date-time-math", "nullable": true }, "source": { "type": "string", "enum": [ "bulk", "satisfaction" ] }, "lang": { "type": "string", "maxLength": 100, "nullable": true }, "shortcuts": { "type": "array", "items": { "type": "string", "format": "object-id" } }, "kbArticles": { "type": "array", "items": { "type": "string", "format": "object-id" } }, "to": { "type": "string" }, "from": { "type": "string" }, "body": { "type": "string", "maxLength": 1024 }, "payload": { "type": "object" }, "attachments": { "type": "array", "items": { "type": "string", "format": "object-id" } } }, "required": [ "channel" ], "additionalProperties": false }, { "title": "Facebook", "type": "object", "properties": { "channel": { "type": "string", "enum": [ "facebook" ] }, "conversation": { "type": "string", "format": "object-id" }, "customer": { "type": "string", "format": "object-id" }, "auto": { "type": "boolean" }, "sendAt": { "type": "string", "description": "A timestamp for a future date/time the drafted message to be sent at.", "format": "date-time-math", "nullable": true }, "source": { "type": "string", "enum": [ "bulk", "satisfaction" ] }, "lang": { "type": "string", "maxLength": 100, "nullable": true }, "shortcuts": { "type": "array", "items": { "type": "string", "format": "object-id" } }, "kbArticles": { "type": "array", "items": { "type": "string", "format": "object-id" } }, "to": { "type": "string" }, "from": { "type": "string" }, "body": { "type": "string", "maxLength": 2000 }, "payload": { "type": "object" } }, "required": [ "channel" ], "additionalProperties": false }, { "title": "Twitter (Tweet)", "type": "object", "properties": { "channel": { "type": "string", "enum": [ "twitter-tweet" ] }, "conversation": { "type": "string", "format": "object-id" }, "customer": { "type": "string", "format": "object-id" }, "auto": { "type": "boolean" }, "sendAt": { "description": "A timestamp for a future date/time the drafted message to be sent at.", "type": "string", "format": "send-at" }, "source": { "type": "string", "enum": [ "bulk", "satisfaction" ] }, "lang": { "type": "string", "maxLength": 100, "nullable": true }, "shortcuts": { "type": "array", "items": { "type": "string", "format": "object-id" } }, "kbArticles": { "type": "array", "items": { "type": "string", "format": "object-id" } }, "to": { "type": "string" }, "from": { "type": "string" }, "body": { "type": "string", "maxLength": 280 }, "payload": { "type": "object" } }, "required": [ "channel" ], "additionalProperties": false }, { "title": "Twitter (DM)", "type": "object", "properties": { "channel": { "type": "string", "enum": [ "twitter-dm" ] }, "conversation": { "type": "string", "format": "object-id" }, "customer": { "type": "string", "format": "object-id" }, "auto": { "type": "boolean" }, "sendAt": { "description": "A timestamp for a future date/time the drafted message to be sent at.", "type": "string", "format": "send-at" }, "source": { "type": "string", "enum": [ "bulk", "satisfaction" ] }, "lang": { "type": "string", "maxLength": 100, "nullable": true }, "shortcuts": { "type": "array", "items": { "type": "string", "format": "object-id" } }, "kbArticles": { "type": "array", "items": { "type": "string", "format": "object-id" } }, "to": { "type": "string" }, "from": { "type": "string" }, "body": { "type": "string", "maxLength": 10000 }, "payload": { "type": "object" } }, "required": [ "channel" ], "additionalProperties": false }, { "title": "Note", "type": "object", "properties": { "channel": { "type": "string", "enum": [ "note" ] }, "conversation": { "type": "string", "format": "object-id" }, "customer": { "type": "string", "format": "object-id" }, "sendAt": { "description": "A timestamp for a future date/time the drafted message to be sent at.", "type": "string", "format": "date-time-math", "nullable": true }, "source": { "type": "string", "enum": [ "bulk" ] }, "lang": { "type": "string", "maxLength": 100, "nullable": true }, "shortcuts": { "type": "array", "items": { "type": "string", "format": "object-id" } }, "kbArticles": { "type": "array", "items": { "type": "string", "format": "object-id" } }, "body": { "type": "string", "maxLength": 10240 }, "payload": { "type": "object" }, "userMentions": { "type": "array", "maxItems": 20, "items": { "type": "object", "properties": { "user": { "type": "string" }, "team": { "type": "string" } } } } }, "required": [ "channel" ], "additionalProperties": false }, { "title": "Instagram", "type": "object", "properties": { "channel": { "type": "string", "enum": [ "instagram" ] }, "conversation": { "type": "string", "format": "object-id" }, "customer": { "type": "string", "format": "object-id" }, "auto": { "type": "boolean" }, "sendAt": { "description": "A timestamp for a future date/time the drafted message to be sent at.", "type": "string", "format": "date-time-math", "nullable": true }, "source": { "type": "string", "enum": [ "bulk", "satisfaction" ] }, "lang": { "type": "string", "maxLength": 100, "nullable": true }, "shortcuts": { "type": "array", "items": { "type": "string", "format": "object-id" } }, "kbArticles": { "type": "array", "items": { "type": "string", "format": "object-id" } }, "to": { "type": "string" }, "from": { "type": "string" }, "body": { "type": "string", "maxLength": 1000 }, "payload": { "type": "object" } }, "required": [ "channel" ], "additionalProperties": false } ] } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string" }, "attributes": { "type": "object", "properties": { "channel": { "type": "string" }, "status": { "type": "string" }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "modifiedAt": { "type": "string" } }, "required": [ "channel", "status", "createdAt", "updatedAt", "modifiedAt" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "data", "links" ] }, "customer": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "data", "links" ] }, "createdBy": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "data", "links" ] }, "modifiedBy": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "data", "links" ] } }, "required": [ "org", "customer", "createdBy", "modifiedBy" ] } }, "required": [ "id", "type", "attributes", "relationships" ] } }, "required": [ "data" ] }, "example": { "data": { "id": "5823e4d3bff98a100085320e", "type": "draft", "attributes": { "channel": "email", "status": "draft", "createdAt": "2016-11-10T03:09:07.575Z", "updatedAt": "2016-11-10T03:09:07.575Z", "modifiedAt": "2016-11-10T03:09:07.575Z" }, "relationships": { "org": { "data": { "type": "org", "id": "57f29863a1dbf61100e6aa92" }, "links": { "self": "/v1/orgs/57f29863a1dbf61100e6aa92" } }, "customer": { "data": { "type": "customer", "id": "58210c3db0f09110006b7953" }, "links": { "self": "/v1/customers/58210c3db0f09110006b7953" } }, "createdBy": { "data": { "type": "user", "id": "58190b991f2932100010d683" }, "links": { "self": "/v1/users/58190b991f2932100010d683" } }, "modifiedBy": { "data": { "type": "user", "id": "58190b991f2932100010d683" }, "links": { "self": "/v1/users/58190b991f2932100010d683" } } } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] } }, "/customers/{customerId}/events/{id}": { "get": { "security": [ { "httpBearer": [] } ], "tags": [ "Customers (Events)" ], "summary": "Get customer event", "description": "Retrieves a single customer event based on the unique IDs of the customer and the event.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.event.read|org.permission.event.read|", "operationId": "GetaCustomerEvent", "parameters": [ { "name": "customerId", "in": "path", "description": "Unique ID of the customer.", "required": true, "style": "simple", "schema": { "type": "string", "example": "58210c3db0f09110006b7953" } }, { "name": "id", "in": "path", "description": "Unique ID of the event.", "required": true, "style": "simple", "schema": { "type": "string", "example": "58210c3d7281071100186631" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "name": { "type": "string" }, "type": { "type": "string" }, "publishedAt": { "type": "string" }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "modifiedAt": { "type": "string", "nullable": true }, "changes": { "type": "object", "properties": { "attributes": { "type": "object", "properties": { "conversationCounts": { "type": "object", "properties": { "op": { "type": "string" }, "before": { "type": "object", "properties": { "all": { "type": "integer" }, "snoozed": { "type": "integer" }, "open": { "type": "integer" }, "done": { "type": "integer" } }, "required": [ "all", "snoozed", "open", "done" ] }, "after": { "type": "object", "properties": { "all": { "type": "integer" }, "snoozed": { "type": "integer" }, "open": { "type": "integer" }, "done": { "type": "integer" } }, "required": [ "all", "snoozed", "open", "done" ] } }, "required": [ "op", "before", "after" ] }, "progressiveStatus": { "type": "object", "properties": { "op": { "type": "string" }, "before": { "type": "string", "nullable": true }, "after": { "type": "string" } }, "required": [ "op", "before", "after" ] }, "rev": { "type": "object", "properties": { "op": { "type": "string" }, "before": { "type": "integer" }, "after": { "type": "integer" } }, "required": [ "op", "before", "after" ] } }, "required": [ "conversationCounts", "progressiveStatus", "rev" ] }, "relationships": { "type": "object" } }, "required": [ "attributes", "relationships" ] }, "location": { "type": "string", "nullable": true }, "meta": { "type": "string", "nullable": true } }, "required": [ "name", "type", "publishedAt", "createdAt", "updatedAt", "modifiedAt", "changes", "location", "meta" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "createdBy": { "type": "string", "nullable": true }, "modifiedBy": { "type": "string", "nullable": true }, "customer": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "createdBy", "modifiedBy", "customer" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "customer_event", "id": "58210c3d7281071100186631", "attributes": { "name": "kustomer.customer.update", "type": "customer", "publishedAt": "2016-11-07T23:20:29.355Z", "createdAt": "2016-11-07T23:20:29.080Z", "updatedAt": "2016-11-07T23:20:29.080Z", "modifiedAt": null, "changes": { "attributes": { "conversationCounts": { "op": "replace", "before": { "all": 0, "snoozed": 0, "open": 0, "done": 0 }, "after": { "all": 1, "snoozed": 0, "open": 1, "done": 0 } }, "progressiveStatus": { "op": "add", "before": null, "after": "open" }, "rev": { "op": "replace", "before": 1, "after": 2 } }, "relationships": {} }, "location": null, "meta": null }, "relationships": { "org": { "links": { "self": "/v1/orgs/57f29863a1dbf61100e6aa92" }, "data": { "type": "org", "id": "57f29863a1dbf61100e6aa92" } }, "createdBy": null, "modifiedBy": null, "customer": { "links": { "self": "/v1/customers/58210c3db0f09110006b7953" }, "data": { "type": "customer", "id": "58210c3db0f09110006b7953" } } }, "links": { "self": "/v1/customers/58210c3db0f09110006b7953/events/58210c3d7281071100186631" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] } }, "/customers/{customerId}/sessions/{sessionId}/events": { "get": { "security": [ { "httpBearer": [] } ], "tags": [ "Customers (Events)" ], "summary": "Get all events by customer for session", "description": "Retrieves all tracking events for a specific customer session based on the unique IDs of the customer and the session.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.event.read|org.permission.event.read|", "operationId": "GetAllEventsByCustomerForSession", "parameters": [ { "name": "customerId", "in": "path", "description": "Unique ID of the customer.", "required": true, "style": "simple", "schema": { "type": "string", "example": "58290b8b7c7f551a00b5b738" } }, { "name": "sessionId", "in": "path", "description": "Unique ID of the session.", "required": true, "style": "simple", "schema": { "type": "string", "example": "58290fb391113b1900bbee4c" } }, { "name": "page", "in": "query", "schema": { "type": "number", "default": 1, "example": 1 }, "description": "Number of pages to return for results. Default value: 1." }, { "name": "pageSize", "in": "query", "required": false, "schema": { "type": "number", "default": 100, "example": 100 }, "description": "Number of results to return per page. Default value: 100." } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "meta": { "type": "object" }, "data": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "name": { "type": "string" }, "trackingEvent": { "type": "string" }, "app": { "type": "string", "nullable": true }, "publishedAt": { "type": "string" }, "createdAt": { "type": "string" }, "location": { "type": "object", "properties": { "countryCode": { "type": "string" }, "countryName": { "type": "string" }, "regionCode": { "type": "string" }, "cityName": { "type": "string" }, "zipCode": { "type": "string" }, "latitude": { "type": "number" }, "longitude": { "type": "number" }, "areaCode": { "type": "string" }, "regionName": { "type": "string" } }, "required": [ "countryCode", "countryName", "regionCode", "cityName", "zipCode", "latitude", "longitude", "areaCode", "regionName" ] }, "meta": { "type": "object", "properties": { "statusStr": { "type": "string" } }, "required": [ "statusStr" ] }, "sessionId": { "type": "string" }, "realIp": { "type": "string" } }, "required": [ "name", "trackingEvent", "app", "publishedAt", "createdAt", "location", "meta", "sessionId", "realIp" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "createdBy": { "type": "string", "nullable": true }, "modifiedBy": { "type": "string", "nullable": true }, "customer": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "createdBy", "modifiedBy", "customer" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "links": { "type": "object", "properties": { "self": { "type": "string" }, "first": { "type": "string" }, "prev": { "type": "string", "nullable": true }, "next": { "type": "string", "nullable": true } }, "required": [ "self", "first", "prev", "next" ] } }, "required": [ "meta", "data", "links" ] }, "example": { "meta": {}, "data": [ { "type": "customer_event", "id": "582911c191113b1900bbee4f", "attributes": { "name": "kustomer.tracking.identified.event", "trackingEvent": "tracking.foobar-event", "app": null, "publishedAt": "2016-11-14T01:22:09.476Z", "createdAt": "2016-11-14T01:31:30.187Z", "location": { "countryCode": "US", "countryName": "United States", "regionCode": "NY", "cityName": "Huntington", "zipCode": "11743", "latitude": 40.87190000000001, "longitude": -73.4347, "areaCode": "631", "regionName": "New York" }, "meta": { "statusStr": "Silver" }, "sessionId": "58290fb391113b1900bbee4c", "realIp": "68.132.72.101" }, "relationships": { "org": { "links": { "self": "/v1/orgs/57bb5d2e32e83a130052e94e" }, "data": { "type": "org", "id": "57bb5d2e32e83a130052e94e" } }, "createdBy": null, "modifiedBy": null, "customer": { "links": { "self": "/v1/customers/58290b8b7c7f551a00b5b738" }, "data": { "type": "customer", "id": "58290b8b7c7f551a00b5b738" } } }, "links": { "self": "/v1/customers/58290b8b7c7f551a00b5b738/events/582911c191113b1900bbee4f" } }, { "type": "customer_event", "id": "58290fb391113b1900bbee4d", "attributes": { "name": "kustomer.tracking.identified.event", "trackingEvent": "tracking.foobar-event", "app": null, "publishedAt": "2016-11-14T01:13:23.132Z", "createdAt": "2016-11-14T01:31:30.194Z", "location": { "countryCode": "US", "countryName": "United States", "regionCode": "NY", "cityName": "Huntington", "zipCode": "11743", "latitude": 40.87190000000001, "longitude": -73.4347, "areaCode": "631", "regionName": "New York" }, "meta": { "statusStr": "Silver" }, "sessionId": "58290fb391113b1900bbee4c", "realIp": "68.132.72.101" }, "relationships": { "org": { "links": { "self": "/v1/orgs/57bb5d2e32e83a130052e94e" }, "data": { "type": "org", "id": "57bb5d2e32e83a130052e94e" } }, "createdBy": null, "modifiedBy": null, "customer": { "links": { "self": "/v1/customers/58290b8b7c7f551a00b5b738" }, "data": { "type": "customer", "id": "58290b8b7c7f551a00b5b738" } } }, "links": { "self": "/v1/customers/58290b8b7c7f551a00b5b738/events/58290fb391113b1900bbee4d" } } ], "links": { "self": "/v1/customers/58290b8b7c7f551a00b5b738/sessions/58290fb391113b1900bbee4c/events?page=1&pageSize=100", "first": "/v1/customers/58290b8b7c7f551a00b5b738/sessions/58290fb391113b1900bbee4c/events?page=1&pageSize=100", "prev": null, "next": null } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] } }, "/customers/{id}/events": { "get": { "security": [ { "httpBearer": [] } ], "tags": [ "Customers (Events)" ], "summary": "Get all customer events (deprecated)", "description": "Retrieves a single customer event based on the unique IDs of the customer and the event.\n\n### Deprecation notice\n> This endpoint has been deprecated and returns a `404 Not Found` error. Use [Get all events by customer for session](https://developer.kustomer.com/kustomer-api-docs/reference/customers-events#getalleventsbycustomerforsession) or [Get conversation events](https://developer.kustomer.com/kustomer-api-docs/reference/conversations#getconversationevents) instead.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.event.read|org.permission.event.read|", "operationId": "GetAllCustomerEvents", "parameters": [ { "name": "id", "in": "path", "description": "Unique ID of the customer.", "required": true, "style": "simple", "schema": { "type": "string", "example": "58210c3db0f09110006b7953" } }, { "name": "page", "in": "query", "schema": { "type": "number", "default": 1, "example": 1 }, "description": "Number of pages to return for results. Default value: 1." }, { "name": "pageSize", "in": "query", "required": false, "schema": { "type": "number", "default": 100, "example": 100 }, "description": "Number of results to return per page. Default value: 100." }, { "schema": { "type": "string", "example": "foobar" }, "in": "query", "name": "name", "description": "Comma-separated list of event names to filter results." } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "meta": { "type": "object" }, "data": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "name": { "type": "string" }, "type": { "type": "string" }, "publishedAt": { "type": "string" }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "modifiedAt": { "type": "string", "nullable": true }, "location": { "type": "string", "nullable": true }, "meta": { "type": "string", "nullable": true }, "changes": { "type": "object", "properties": { "attributes": { "type": "object", "properties": { "conversationCounts": { "type": "object", "properties": { "op": { "type": "string" }, "before": { "type": "object", "properties": { "all": { "type": "integer" }, "snoozed": { "type": "integer" }, "open": { "type": "integer" }, "done": { "type": "integer" } }, "required": [ "all", "snoozed", "open", "done" ] }, "after": { "type": "object", "properties": { "all": { "type": "integer" }, "snoozed": { "type": "integer" }, "open": { "type": "integer" }, "done": { "type": "integer" } }, "required": [ "all", "snoozed", "open", "done" ] } }, "required": [ "op", "before", "after" ] }, "progressiveStatus": { "type": "object", "properties": { "op": { "type": "string" }, "before": { "type": "string", "nullable": true }, "after": { "type": "string" } }, "required": [ "op", "before", "after" ] }, "rev": { "type": "object", "properties": { "op": { "type": "string" }, "before": { "type": "integer" }, "after": { "type": "integer" } }, "required": [ "op", "before", "after" ] }, "presence": { "type": "object", "properties": { "op": { "type": "string" }, "before": { "type": "string", "nullable": true }, "after": { "type": "string" } }, "required": [ "op", "before", "after" ] }, "updatedAt": { "type": "object", "properties": { "op": { "type": "string" }, "before": { "type": "string" }, "after": { "type": "string" } }, "required": [ "op", "before", "after" ] }, "lastSeenAt": { "type": "object", "properties": { "op": { "type": "string" }, "before": { "type": "string", "nullable": true }, "after": { "type": "string" } }, "required": [ "op", "before", "after" ] }, "lastActivityAt": { "type": "object", "properties": { "op": { "type": "string" }, "before": { "type": "string" }, "after": { "type": "string" } }, "required": [ "op", "before", "after" ] }, "lastCustomerActivityAt": { "type": "object", "properties": { "op": { "type": "string" }, "before": { "type": "string", "nullable": true }, "after": { "type": "string" } }, "required": [ "op", "before", "after" ] } }, "required": [ "rev" ] }, "relationships": { "type": "object" } }, "required": [ "attributes", "relationships" ] } }, "required": [ "name", "type", "publishedAt", "createdAt", "updatedAt", "modifiedAt", "location", "meta" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "createdBy": { "type": "string", "nullable": true }, "modifiedBy": { "type": "string", "nullable": true }, "customer": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "conversation": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "message": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "createdBy", "modifiedBy", "customer" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "links": { "type": "object", "properties": { "self": { "type": "string" }, "first": { "type": "string" }, "prev": { "type": "string", "nullable": true }, "next": { "type": "string", "nullable": true } }, "required": [ "self", "first", "prev", "next" ] } }, "required": [ "meta", "data", "links" ] }, "example": { "meta": {}, "data": [ { "type": "customer_event", "id": "58210c3d7281071100186630", "attributes": { "name": "kustomer.conversation.create", "type": "conversation", "publishedAt": "2016-11-07T23:20:29.343Z", "createdAt": "2016-11-07T23:20:29.327Z", "updatedAt": "2016-11-07T23:20:29.327Z", "modifiedAt": null, "location": null, "meta": null }, "relationships": { "org": { "links": { "self": "/v1/orgs/57f29863a1dbf61100e6aa92" }, "data": { "type": "org", "id": "57f29863a1dbf61100e6aa92" } }, "createdBy": null, "modifiedBy": null, "customer": { "links": { "self": "/v1/customers/58210c3db0f09110006b7953" }, "data": { "type": "customer", "id": "58210c3db0f09110006b7953" } }, "conversation": { "links": { "self": "/v1/conversations/58210c3d728107110018662f" }, "data": { "type": "conversation", "id": "58210c3d728107110018662f" } } }, "links": { "self": "/v1/customers/58210c3db0f09110006b7953/events/58210c3d7281071100186630" } }, { "type": "customer_event", "id": "58210c3d7281071100186631", "attributes": { "name": "kustomer.customer.update", "type": "customer", "publishedAt": "2016-11-07T23:20:29.355Z", "createdAt": "2016-11-07T23:20:29.080Z", "updatedAt": "2016-11-07T23:20:29.080Z", "modifiedAt": null, "changes": { "attributes": { "conversationCounts": { "op": "replace", "before": { "all": 0, "snoozed": 0, "open": 0, "done": 0 }, "after": { "all": 1, "snoozed": 0, "open": 1, "done": 0 } }, "progressiveStatus": { "op": "add", "before": null, "after": "open" }, "rev": { "op": "replace", "before": 1, "after": 2 } }, "relationships": {} }, "location": null, "meta": null }, "relationships": { "org": { "links": { "self": "/v1/orgs/57f29863a1dbf61100e6aa92" }, "data": { "type": "org", "id": "57f29863a1dbf61100e6aa92" } }, "createdBy": null, "modifiedBy": null, "customer": { "links": { "self": "/v1/customers/58210c3db0f09110006b7953" }, "data": { "type": "customer", "id": "58210c3db0f09110006b7953" } } }, "links": { "self": "/v1/customers/58210c3db0f09110006b7953/events/58210c3d7281071100186631" } }, { "type": "customer_event", "id": "58210c3db0f09110006b7954", "attributes": { "name": "kustomer.customer.create", "type": "customer", "publishedAt": "2016-11-07T23:20:29.091Z", "createdAt": "2016-11-07T23:20:29.080Z", "updatedAt": "2016-11-07T23:20:29.080Z", "modifiedAt": null, "location": null, "meta": null }, "relationships": { "org": { "links": { "self": "/v1/orgs/57f29863a1dbf61100e6aa92" }, "data": { "type": "org", "id": "57f29863a1dbf61100e6aa92" } }, "createdBy": null, "modifiedBy": null, "customer": { "links": { "self": "/v1/customers/58210c3db0f09110006b7953" }, "data": { "type": "customer", "id": "58210c3db0f09110006b7953" } } }, "links": { "self": "/v1/customers/58210c3db0f09110006b7953/events/58210c3db0f09110006b7954" } }, { "type": "customer_event", "id": "58210c3eb0f09110006b7955", "attributes": { "name": "kustomer.customer.update", "type": "customer", "publishedAt": "2016-11-07T23:20:30.179Z", "createdAt": "2016-11-07T23:20:29.080Z", "updatedAt": "2016-11-07T23:20:30.168Z", "modifiedAt": null, "changes": { "attributes": { "presence": { "op": "add", "before": null, "after": "online" }, "updatedAt": { "op": "replace", "before": "2016-11-07T23:20:29.080Z", "after": "2016-11-07T23:20:30.168Z" }, "lastSeenAt": { "op": "add", "before": null, "after": "2016-11-07T23:20:30.168Z" }, "lastActivityAt": { "op": "replace", "before": "2016-11-07T23:20:29.080Z", "after": "2016-11-07T23:20:30.168Z" }, "lastCustomerActivityAt": { "op": "add", "before": null, "after": "2016-11-07T23:20:30.168Z" }, "rev": { "op": "replace", "before": 2, "after": 3 } }, "relationships": {} }, "location": null, "meta": null }, "relationships": { "org": { "links": { "self": "/v1/orgs/57f29863a1dbf61100e6aa92" }, "data": { "type": "org", "id": "57f29863a1dbf61100e6aa92" } }, "createdBy": null, "modifiedBy": null, "customer": { "links": { "self": "/v1/customers/58210c3db0f09110006b7953" }, "data": { "type": "customer", "id": "58210c3db0f09110006b7953" } } }, "links": { "self": "/v1/customers/58210c3db0f09110006b7953/events/58210c3eb0f09110006b7955" } }, { "type": "customer_event", "id": "58210c3eb0f09110006b7956", "attributes": { "name": "kustomer.message.create", "type": "message", "publishedAt": "2016-11-07T23:20:30.627Z", "createdAt": "2016-11-07T23:20:30.613Z", "updatedAt": "2016-11-07T23:20:30.613Z", "modifiedAt": null, "location": null, "meta": null }, "relationships": { "org": { "links": { "self": "/v1/orgs/57f29863a1dbf61100e6aa92" }, "data": { "type": "org", "id": "57f29863a1dbf61100e6aa92" } }, "createdBy": null, "modifiedBy": null, "customer": { "links": { "self": "/v1/customers/58210c3db0f09110006b7953" }, "data": { "type": "customer", "id": "58210c3db0f09110006b7953" } }, "conversation": { "links": { "self": "/v1/conversations/58210c3d728107110018662f" }, "data": { "type": "conversation", "id": "58210c3d728107110018662f" } }, "message": { "links": { "self": "/v1/messages/58210c3df63b57100092ae94" }, "data": { "type": "message", "id": "58210c3df63b57100092ae94" } } }, "links": { "self": "/v1/customers/58210c3db0f09110006b7953/events/58210c3eb0f09110006b7956" } } ], "links": { "self": "/v1/customers/58210c3db0f09110006b7953/events?page=1&pageSize=100", "first": "/v1/customers/58210c3db0f09110006b7953/events?page=1&pageSize=100", "prev": null, "next": null } } } } } }, "deprecated": true, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] } }, "/customers/{id}/sessions": { "get": { "security": [ { "httpBearer": [] } ], "tags": [ "Customers (Events)" ], "summary": "Get all customer sessions", "description": "Retrieves all sessions for a single customer based on the unique customer ID.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.event.read|org.permission.event.read|", "operationId": "GetCustomerSessions", "parameters": [ { "name": "id", "in": "path", "description": "Unique ID of the customer.", "required": true, "style": "simple", "schema": { "type": "string", "example": "58290b8b7c7f551a00b5b738" } }, { "name": "page", "in": "query", "schema": { "type": "number", "default": 1, "example": 1 }, "description": "Number of pages to return for results. Default value: 1." }, { "name": "pageSize", "in": "query", "required": false, "schema": { "type": "number", "default": 100, "example": 100 }, "description": "Number of results to return per page. Default value: 100." } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "meta": { "type": "object" }, "data": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "sessionId": { "type": "string" }, "firstEventAt": { "type": "string" }, "lastEventAt": { "type": "string" }, "count": { "type": "integer" } }, "required": [ "sessionId", "firstEventAt", "lastEventAt", "count" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "customer": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "customer" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "links": { "type": "object", "properties": { "self": { "type": "string" }, "first": { "type": "string" }, "prev": { "type": "string", "nullable": true }, "next": { "type": "string", "nullable": true } }, "required": [ "self", "first", "prev", "next" ] } }, "required": [ "meta", "data", "links" ] }, "example": { "meta": {}, "data": [ { "type": "customer_session", "id": "58290fb4cca9b0a5e0189628", "attributes": { "sessionId": "58290fb391113b1900bbee4c", "firstEventAt": "2016-11-14T01:13:23.132Z", "lastEventAt": "2016-11-14T01:22:09.476Z", "count": 2 }, "relationships": { "org": { "links": { "self": "/v1/orgs/57bb5d2e32e83a130052e94e" }, "data": { "type": "org", "id": "57bb5d2e32e83a130052e94e" } }, "customer": { "links": { "self": "/v1/customers/58290b8b7c7f551a00b5b738" }, "data": { "type": "customer", "id": "58290b8b7c7f551a00b5b738" } } }, "links": { "self": "/v1/customers/58290b8b7c7f551a00b5b738/sessions" } } ], "links": { "self": "/v1/customers/58290b8b7c7f551a00b5b738/sessions?page=1&pageSize=100", "first": "/v1/customers/58290b8b7c7f551a00b5b738/sessions?page=1&pageSize=100", "prev": null, "next": null } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] } }, "/customers/{id}/klasses/{name}": { "post": { "security": [ { "httpBearer": [] } ], "tags": [ "Customers (KObjects)", "KObjects (Custom Objects)" ], "summary": "Create customer KObject (custom Object)", "description": "Creates a new [KObject (custom object)](https://help.kustomer.com/define-attributes-Skr924HI) and links the KObject to a customer based on the unique customer ID.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.kobject.write|org.permission.kobject.create|\n||org.permission.kobject.kobject_*.create|", "operationId": "CreateCustomerKObject", "parameters": [ { "name": "id", "in": "path", "description": "Unique ID of the customer.", "required": true, "style": "simple", "schema": { "type": "string", "example": "57c08ccde595371400462df2" } }, { "name": "name", "in": "path", "description": "Name of the Klass.", "required": true, "style": "simple", "schema": { "type": "string", "example": "order" } } ], "requestBody": { "description": "", "content": { "application/json": { "schema": { "type": "object", "properties": { "customer": { "type": "string" }, "company": { "type": "string" }, "externalId": { "type": "string", "minLength": 1, "maxLength": 256 }, "title": { "type": "string", "minLength": 1, "maxLength": 256 }, "description": { "type": "string", "maxLength": 10240 }, "images": { "type": "array", "items": { "type": "string", "format": "url" }, "maxItems": 20, "uniqueItems": true }, "icon": { "type": "string", "maxLength": 64 }, "data": { "type": "object" }, "custom": { "type": "object", "maxProperties": 100, "additionalProperties": false }, "tags": { "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 64, "pattern": "^[0-9a-zA-ZÀ-ÿ_/<>\\-.]{1}[0-9a-zA-ZÀ-ÿ _/<>\\-.]{0,63}$" }, "maxItems": 20, "uniqueItems": true }, "createdAt": { "type": "string", "format": "date-time" }, "importedAt": { "type": "string", "format": "date-time" } }, "required": [ "title" ], "additionalProperties": false } } } }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "title": { "type": "string" }, "icon": { "type": "string" }, "images": { "type": "array", "items": { "type": "string" } }, "custom": { "type": "object", "properties": { "orderStatusStr": { "type": "string" }, "shippingStatusStr": { "type": "string" }, "billingStatusStr": { "type": "string" }, "specialInstructionsStr": { "type": "string" }, "orderNumberNum": { "type": "integer" }, "orderDescriptionStr": { "type": "string" }, "totalPriceNum": { "type": "number" }, "orderUpdatedAt": { "type": "string" } }, "required": [ "orderStatusStr", "shippingStatusStr", "billingStatusStr", "specialInstructionsStr", "orderNumberNum", "orderDescriptionStr", "totalPriceNum", "orderUpdatedAt" ] }, "tags": { "type": "array" }, "updatedAt": { "type": "string" }, "createdAt": { "type": "string" }, "rev": { "type": "integer" } }, "required": [ "title", "icon", "images", "custom", "tags", "updatedAt", "createdAt", "rev" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "klass": { "type": "object", "properties": { "link": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "link", "data" ] }, "customer": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "klass", "customer" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "kobject.order", "id": "5826b2a30fcc2514008b2a99", "attributes": { "title": "Order #1059 (3 items ordered for $64.67)", "icon": "truck-delivery", "images": [ "https://cdn.shopify.com/s/files/1/1489/4596/products/hoodie-2_1.jpg", "https://kustomer-integrations.s3.amazonaws.com/kusty-swag/img/koffee.png", "https://cdn.shopify.com/s/files/1/1489/4596/products/shirt-3_large.jpg?v=1473819771" ], "custom": { "orderStatusStr": "fulfilled", "shippingStatusStr": "fulfilled", "billingStatusStr": "authorized", "specialInstructionsStr": "The tshirt is a gift, can you include a gift bag?", "orderNumberNum": 1059, "orderDescriptionStr": "3 items ordered for $64.67", "totalPriceNum": 64.67, "orderUpdatedAt": "2016-11-06T13:54:29-05:00" }, "tags": [], "updatedAt": "2016-11-12T06:11:47.466Z", "createdAt": "2016-11-12T06:11:47.466Z", "rev": 0 }, "relationships": { "org": { "links": { "self": "/v1/orgs/57bb5d2e32e83a130052e94e" }, "data": { "type": "org", "id": "57bb5d2e32e83a130052e94e" } }, "klass": { "link": { "self": "/v1/klasses/order" }, "data": { "type": "klass", "id": "order" } }, "customer": { "links": { "self": "/v1/customers/57c08ccde595371400462df2" }, "data": { "type": "customer", "id": "57c08ccde595371400462df2" } } }, "links": { "self": "/v1/klasses/orders/5826b2a30fcc2514008b2a99" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] }, "get": { "security": [ { "httpBearer": [] } ], "tags": [ "Customers (KObjects)", "KObjects (Custom Objects)" ], "summary": "Find customer KObjects (custom Objects)", "description": "Finds all [KObjects (custom objects)](https://help.kustomer.com/define-attributes-Skr924HI) linked to a customer based on the name of the Klass.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.customer.read|org.permission.customer.read|", "operationId": "FindCustomerKObjects", "parameters": [ { "name": "id", "in": "path", "description": "Unique ID of the customer.", "required": true, "style": "simple", "schema": { "type": "string", "example": "57c08ccde595371400462df2" } }, { "name": "name", "in": "path", "description": "Name of the Klass.", "required": true, "style": "simple", "schema": { "type": "string", "example": "order" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "meta": { "type": "object", "required": [ "pageSize", "page" ], "properties": { "pageSize": { "type": "integer" }, "page": { "type": "integer" } } }, "data": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "required": [ "title", "icon", "images", "custom", "tags", "updatedAt", "createdAt", "rev" ], "properties": { "title": { "type": "string" }, "description": { "type": "string" }, "icon": { "type": "string" }, "images": { "type": "array", "items": { "type": "string" } }, "s3DataUrl": { "type": "string" }, "custom": { "type": "object", "required": [ "orderStatusStr", "shippingStatusStr", "billingStatusStr", "specialInstructionsStr", "orderNumberNum", "orderDescriptionStr", "totalPriceNum", "orderUpdatedAt" ], "properties": { "orderStatusStr": { "type": "string" }, "shippingStatusStr": { "type": "string" }, "billingStatusStr": { "type": "string" }, "specialInstructionsStr": { "type": "string" }, "orderNumberNum": { "type": "integer" }, "orderDescriptionStr": { "type": "string" }, "totalPriceNum": { "type": "number" }, "orderUpdatedAt": { "type": "string" } } }, "tags": { "type": "array", "items": {} }, "updatedAt": { "type": "string" }, "createdAt": { "type": "string" }, "rev": { "type": "integer" } } }, "relationships": { "type": "object", "required": [ "org", "klass", "customer" ], "properties": { "org": { "type": "object", "required": [ "links", "data" ], "properties": { "links": { "type": "object", "required": [ "self" ], "properties": { "self": { "type": "string" } } }, "data": { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "type": "string" }, "id": { "type": "string" } } } } }, "klass": { "type": "object", "required": [ "link", "data" ], "properties": { "link": { "type": "object", "required": [ "self" ], "properties": { "self": { "type": "string" } } }, "data": { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "type": "string" }, "id": { "type": "string" } } } } }, "customer": { "type": "object", "required": [ "links", "data" ], "properties": { "links": { "type": "object", "required": [ "self" ], "properties": { "self": { "type": "string" } } }, "data": { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "type": "string" }, "id": { "type": "string" } } } } } } }, "links": { "type": "object", "required": [ "self" ], "properties": { "self": { "type": "string" } } } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "links": { "type": "object", "required": [ "self", "first", "prev", "next" ], "properties": { "self": { "type": "string" }, "first": { "type": "string" }, "prev": { "type": "string", "nullable": true }, "next": { "type": "string", "nullable": true } } } }, "required": [ "meta", "data", "links" ] }, "example": { "meta": { "pageSize": 100, "page": 1 }, "data": [ { "type": "kobject.order", "id": "5826ab180fcc2514008b2a94", "attributes": { "title": "Order #1059 (3 items ordered for $64.67)", "icon": "truck-delivery", "images": [ "https://cdn.shopify.com/s/files/1/1489/4596/products/hoodie-2_1.jpg", "https://kustomer-integrations.s3.amazonaws.com/kusty-swag/img/koffee.png", "https://cdn.shopify.com/s/files/1/1489/4596/products/shirt-3_large.jpg?v=1473819771" ], "custom": { "orderStatusStr": "fulfilled", "shippingStatusStr": "fulfilled", "billingStatusStr": "authorized", "specialInstructionsStr": "The tshirt is a gift, can you include a gift bag?", "orderNumberNum": 1059, "orderDescriptionStr": "3 items ordered for $64.67", "totalPriceNum": 64.67, "orderUpdatedAt": "2016-11-06T13:54:29-05:00" }, "tags": [], "updatedAt": "2016-11-12T05:39:36.976Z", "createdAt": "2016-11-12T05:39:36.976Z", "rev": 0 }, "relationships": { "org": { "links": { "self": "/v1/orgs/57bb5d2e32e83a130052e94e" }, "data": { "type": "org", "id": "57bb5d2e32e83a130052e94e" } }, "klass": { "link": { "self": "/v1/klasses/order" }, "data": { "type": "klass", "id": "order" } }, "customer": { "links": { "self": "/v1/customers/57c08ccde595371400462df2" }, "data": { "type": "customer", "id": "57c08ccde595371400462df2" } } }, "links": { "self": "/v1/klasses/orders/5826ab180fcc2514008b2a94" } } ], "links": { "self": "/v1/klasses/order?page=1&pageSize=100", "first": "/v1/klasses/order?page=1&pageSize=100", "prev": null, "next": null } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] } }, "/customers/merges": { "post": { "security": [ { "httpBearer": [] } ], "tags": [ "Customers (Merges)" ], "summary": "Create customer merge", "description": "Creates a [customer merge](https://help.kustomer.com/merge-customers-SksSuFLaZ) based on a set of source customer and target customer IDs.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.customer.write|org.permission.customer_merge.create|\n|org.admin.customer.merge.write|\n\n### Merge rules\n\nCustomer merges follow these rules:\n\n**Merge the following fields**:\n\n - Emails\n - Phones\n - Socials\n - Locations\n - Watchers\n - Custom (target customer ID takes precedence with same attribute names)\n - Tags\n - KlassNames\n - conversationCounts (sums all values)\n\n**Choose based on most recent value**:\n\n- Preview - Based on `preview.previewAt`\n- LastMessageIn - Based on `lastMessageIn.sentAt`\n- lastConversation - Based on `lastMessageIn.sentAt`\n- recentLocation - Based on `recentLocation.updatedAt`\n- signedUpAt\n- modifiedAt / modifiedBy\n- lastSeenAt\n- lastActivityAt\n\n**Choose based on the oldest value**:\n- createdAt / createdBy\n\n**Give precedence to the target customer ID value**:\n- Company\n- name\n- externalId\n- username\n- avatarUrl\n- locale\n- timeZone\n- birthdayAt\n- gender", "operationId": "CreateCustomerMerge", "parameters": [], "requestBody": { "description": "", "content": { "application/json": { "schema": { "type": "object", "properties": { "source": { "type": "string", "format": "object-id" }, "target": { "type": "string", "format": "object-id" } }, "required": [ "source", "target" ], "additionalProperties": false } } } }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "status": { "type": "string" }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" } }, "required": [ "status", "createdAt", "updatedAt" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "source": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "target": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "createdBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "source", "target", "createdBy" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "customer_merge", "id": "5822bab2aa5f92110005d6b2", "attributes": { "status": "success", "createdAt": "2016-11-09T05:57:06.913Z", "updatedAt": "2016-11-09T05:57:07.029Z" }, "relationships": { "org": { "links": { "self": "/v1/orgs/57f29863a1dbf61100e6aa92" }, "data": { "type": "org", "id": "57f29863a1dbf61100e6aa92" } }, "source": { "links": { "self": "/v1/customers/5822ba88d4e96711004eccd5" }, "data": { "type": "customer", "id": "5822ba88d4e96711004eccd5" } }, "target": { "links": { "self": "/v1/customers/58210c3db0f09110006b7953" }, "data": { "type": "customer", "id": "58210c3db0f09110006b7953" } }, "createdBy": { "links": { "self": "/v1/users/58190b991f2932100010d683" }, "data": { "type": "user", "id": "58190b991f2932100010d683" } } }, "links": { "self": "/v1/customers/merges/5822bab2aa5f92110005d6b2" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] } }, "/customers/merges/{id}": { "get": { "security": [ { "httpBearer": [] } ], "tags": [ "Customers (Merges)" ], "summary": "Get customer merge", "description": "Retrieves an existing customer merge based on the unique ID.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.customer.read|org.permission.customer_merge.create|\n|org.admin.customer.merge.read|", "operationId": "GetCustomerMerge", "parameters": [ { "name": "id", "in": "path", "description": "Unique ID of the customer merge.", "required": true, "style": "simple", "schema": { "type": "string", "example": "5822bab2aa5f92110005d6b2" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "status": { "type": "string" }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" } }, "required": [ "status", "createdAt", "updatedAt" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "source": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "target": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "createdBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "source", "target", "createdBy" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "customer_merge", "id": "5822bab2aa5f92110005d6b2", "attributes": { "status": "success", "createdAt": "2016-11-09T05:57:06.913Z", "updatedAt": "2016-11-09T05:57:07.029Z" }, "relationships": { "org": { "links": { "self": "/v1/orgs/57f29863a1dbf61100e6aa92" }, "data": { "type": "org", "id": "57f29863a1dbf61100e6aa92" } }, "source": { "links": { "self": "/v1/customers/5822ba88d4e96711004eccd5" }, "data": { "type": "customer", "id": "5822ba88d4e96711004eccd5" } }, "target": { "links": { "self": "/v1/customers/58210c3db0f09110006b7953" }, "data": { "type": "customer", "id": "58210c3db0f09110006b7953" } }, "createdBy": { "links": { "self": "/v1/users/58190b991f2932100010d683" }, "data": { "type": "user", "id": "58190b991f2932100010d683" } } }, "links": { "self": "/v1/customers/merges/5822bab2aa5f92110005d6b2" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] } }, "/customers/{id}/merges": { "get": { "security": [ { "httpBearer": [] } ], "tags": [ "Customers (Merges)" ], "summary": "Get customer merges by customer ID", "description": "Retrieves customer merges based on the unique ID of the customer.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.customer.read|org.permission.customer_merge.read|\n|org.admin.customer.merge.read|", "operationId": "GetCustomerMergesByCustomer", "parameters": [ { "name": "id", "in": "path", "description": "Unique ID of the customer.", "required": true, "style": "simple", "schema": { "type": "string", "example": "5822ba88d4e96711004eccd5" } }, { "name": "page", "in": "query", "schema": { "type": "number", "default": 1, "example": 1 }, "description": "Number of pages to return for results. Default value: 1." }, { "name": "pageSize", "in": "query", "required": false, "schema": { "type": "number", "default": 100, "example": 100 }, "description": "Number of results to return per page. Default value: 100." } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "meta": { "type": "object", "properties": { "pageSize": { "type": "integer" }, "page": { "type": "integer" } }, "required": [ "pageSize", "page" ] }, "data": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "status": { "type": "string" }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" } }, "required": [ "status", "createdAt", "updatedAt" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "source": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "target": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "createdBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "source", "target", "createdBy" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "links": { "type": "object", "properties": { "self": { "type": "string" }, "first": { "type": "string" }, "prev": { "type": "string", "nullable": true }, "next": { "type": "string", "nullable": true } }, "required": [ "self", "first", "prev", "next" ] } }, "required": [ "meta", "data", "links" ] }, "example": { "meta": { "pageSize": 100, "page": 1 }, "data": [ { "type": "customer_merge", "id": "5822bab2aa5f92110005d6b2", "attributes": { "status": "success", "createdAt": "2016-11-09T05:57:06.913Z", "updatedAt": "2016-11-09T05:57:07.029Z" }, "relationships": { "org": { "links": { "self": "/v1/orgs/57f29863a1dbf61100e6aa92" }, "data": { "type": "org", "id": "57f29863a1dbf61100e6aa92" } }, "source": { "links": { "self": "/v1/customers/5822ba88d4e96711004eccd5" }, "data": { "type": "customer", "id": "5822ba88d4e96711004eccd5" } }, "target": { "links": { "self": "/v1/customers/58210c3db0f09110006b7953" }, "data": { "type": "customer", "id": "58210c3db0f09110006b7953" } }, "createdBy": { "links": { "self": "/v1/users/58190b991f2932100010d683" }, "data": { "type": "user", "id": "58190b991f2932100010d683" } } }, "links": { "self": "/v1/customers/merges/5822bab2aa5f92110005d6b2" } } ], "links": { "self": "/v1/customers/5822ba88d4e96711004eccd5/merges?page=1&pageSize=100", "first": "/v1/customers/5822ba88d4e96711004eccd5/merges?page=1&pageSize=100", "prev": null, "next": null } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] } }, "/customers/{id}/messages": { "post": { "security": [ { "httpBearer": [] } ], "tags": [ "Customers (Messages)", "Messages" ], "summary": "Create message by customer ID", "description": "Creates a new message based on the unique customer ID.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.message.write|org.permission.message.create|\n\n### Note\n> If a conversation is specified, the message will be linked to the existing conversation. Otherwise, a new\nconversation will be created and associated with the message.\n\n### Authorization\nThe `org.admin` role is required for setting `createdAt`, `createdBy`, `modifiedAt`, and `modifiedBy`. Otherwise, these attributes are automatically set by the token.\n\n### Rate Limit\nMessages are subject to a rate limit. A single client can create up to 120 messages per minute per customer.\nMessages with `importedAt` in their body will not be subject to the rate limit.\n\nA `429 Too Many Requests` response will be returned if the rate limit has been reached for a customer.", "operationId": "CreateMessageByCustomer", "parameters": [ { "name": "id", "in": "path", "description": "Unique ID of the customer.", "required": true, "style": "simple", "schema": { "type": "string", "example": "57c08ccde595371400462df2" } } ], "requestBody": { "description": "Creates a new message.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.message.write|org.permission.message.create|\n\n### Note\n> If a conversation is specified, the message will be linked to the existing conversation. Otherwise, a new\nconversation will be created and associated with the message.\n\n### Authorization\nThe `org.admin` role is required for setting createdAt, createdBy, modifiedAt, and modifiedBy. Otherwise, these attributes are automatically set by the token.\n\n### Rate Limit\nMessages are subject to a rate limit. A single client can create up to 120 messages per minute per customer.\nMessages with `importedAt` in their body will not be subject to the rate limit.\n\nA `429 Too Many Requests` response will be returned if the rate limit has been reached for a customer.", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string", "format": "object-id" }, "externalId": { "type": "string", "maxLength": 256 }, "conversation": { "type": "string", "format": "object-id" }, "reference": { "type": "object", "properties": { "message": { "type": "string", "format": "object-id" }, "type": { "type": "string", "enum": [ "reply", "replyAll", "forward" ] } }, "required": [ "message", "type" ], "additionalProperties": false }, "channel": { "type": "string", "enum": [ "email", "sms", "chat", "facebook", "twitter-dm", "twitter-tweet", "voice", "instagram", "whatsapp" ] }, "preview": { "type": "string", "maxLength": 10240 }, "subject": { "type": "string", "maxLength": 256 }, "direction": { "type": "string", "enum": [ "in", "out" ] }, "app": { "type": "string" }, "size": { "type": "number" }, "related": { "type": "string" }, "status": { "type": "string", "enum": [ "sent", "received", "error" ] }, "error": { "type": "object", "properties": { "status": { "type": "number" }, "code": { "type": "string" }, "title": { "type": "string" }, "detail": { "type": "string" }, "source": { "type": "object" }, "meta": { "type": "object" }, "links": { "type": "object" } }, "additionalProperties": false }, "errorAt": { "type": "string", "format": "date-time" }, "auto": { "type": "boolean" }, "sentAt": { "type": "string", "format": "date-time" }, "source": { "type": "string", "enum": [ "bulk", "satisfaction" ] }, "shortcuts": { "type": "array", "items": { "type": "string", "format": "object-id" } }, "kbArticles": { "type": "array", "items": { "type": "string", "format": "object-id" } }, "attachments": { "anyOf": [ { "type": "array", "items": { "type": "object", "properties": { "_id": { "type": "string", "format": "object-id" }, "name": { "type": "string" }, "contentType": { "type": "string" }, "contentLength": { "type": "number" }, "sourceId": { "type": "string", "format": "object-id" } }, "required": [ "_id", "name", "contentType", "contentLength" ], "additionalProperties": false }, "uniqueItems": true }, { "type": "array", "items": { "type": "string", "format": "object-id" }, "uniqueItems": true } ] }, "location": { "type": "object", "properties": { "name": { "type": "string" }, "address": { "type": "string", "maxLength": 256 }, "address2": { "type": "string", "maxLength": 256 }, "address3": { "type": "string", "maxLength": 256 }, "latitude": { "type": "number" }, "longitude": { "type": "number" }, "countryCode": { "type": "string", "minLength": 2, "maxLength": 2 }, "countryName": { "type": "string", "maxLength": 64 }, "regionCode": { "type": "string", "maxLength": 2 }, "regionName": { "type": "string", "maxLength": 128 }, "cityName": { "type": "string", "maxLength": 128 }, "zipCode": { "type": "string", "maxLength": 30 }, "areaCode": { "type": "string", "maxLength": 30 } } }, "meta": { "type": "object", "maxProperties": 100 }, "custom": { "type": "object", "maxProperties": 100, "additionalProperties": false }, "sentiment": { "type": "object", "properties": { "polarity": { "type": "number", "enum": [ -1, 0, 1 ] }, "confidence": { "type": "number", "minimum": -1, "maximum": 1 } }, "required": [ "polarity", "confidence" ], "additionalProperties": false }, "createdAt": { "type": "string", "format": "date-time" }, "modifiedAt": { "type": "string", "format": "date-time" }, "createdBy": { "type": "string", "format": "object-id" }, "modifiedBy": { "type": "string", "format": "object-id" }, "importedAt": { "type": "string", "format": "date-time" }, "lang": { "type": "string", "maxLength": 100, "nullable": true }, "queue": { "type": "object", "properties": { "id": { "type": "string", "format": "object-id" }, "external": { "type": "string", "enum": [ "amazon-connect" ] } }, "anyOf": [ { "required": [ "id" ] }, { "required": [ "external" ] } ], "additionalProperties": false } }, "required": [ "channel", "app" ], "additionalProperties": false } } } }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "channel": { "type": "string" }, "app": { "type": "string" }, "size": { "type": "integer" }, "direction": { "type": "string" }, "meta": { "type": "object" }, "status": { "type": "string" }, "sentAt": { "type": "string" }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "modifiedAt": { "type": "string" } }, "required": [ "channel", "app", "size", "direction", "meta", "status", "sentAt", "createdAt", "updatedAt", "modifiedAt" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "createdBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "modifiedBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "customer": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "conversation": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "createdBy", "modifiedBy", "customer", "conversation" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "message", "id": "57a6082ae92c9510005e35ea", "attributes": { "channel": "email", "app": "postmark", "size": 1, "direction": "in", "meta": {}, "status": "received", "sentAt": "2016-11-13T15:44:35.625Z", "createdAt": "2016-05-22T22:42:44.723Z", "updatedAt": "2016-11-13T15:44:35.625Z", "modifiedAt": "2016-11-13T15:44:35.625Z" }, "relationships": { "org": { "links": { "self": "/v1/orgs/57bb5d2e32e83a130052e94e" }, "data": { "type": "org", "id": "57bb5d2e32e83a130052e94e" } }, "createdBy": { "links": { "self": "/v1/users/57bb5d2e32e83a130052e94f" }, "data": { "type": "user", "id": "57bb5d2e32e83a130052e94f" } }, "modifiedBy": { "links": { "self": "/v1/users/57bb5d2e32e83a130052e94f" }, "data": { "type": "user", "id": "57bb5d2e32e83a130052e94f" } }, "customer": { "links": { "self": "/v1/customers/57c08ccde595371400462df2" }, "data": { "type": "customers", "id": "57c08ccde595371400462df2" } }, "conversation": { "links": { "self": "/v1/conversations/58288a637c7f551a00b5b716" }, "data": { "type": "conversation", "id": "58288a637c7f551a00b5b716" } } }, "links": { "self": "/v1/messages/57a6082ae92c9510005e35ea" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] }, "get": { "security": [ { "httpBearer": [] } ], "tags": [ "Customers (Messages)", "Messages" ], "summary": "Get messages by customer ID", "description": "Retrieves messages for a specific customer based on the unique customer ID.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.message.read|org.permission.message.read|", "operationId": "GetMessagesByCustomer", "parameters": [ { "name": "id", "in": "path", "description": "Unique ID of the customer", "required": true, "style": "simple", "schema": { "type": "string", "example": "57c08ccde595371400462df2" } }, { "name": "page", "in": "query", "schema": { "type": "number", "default": 1, "example": 1 }, "description": "Number of pages to return for results. Default value: 1." }, { "name": "pageSize", "in": "query", "required": false, "schema": { "type": "number", "default": 100, "example": 100 }, "description": "Number of results to return per page. Default value: 100." }, { "name": "include", "in": "query", "required": false, "schema": { "type": "string", "example": "attachments" }, "description": "List of resources to include in this response. Use a comma to separate resources. Supports the `attachments` resource. " } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "meta": { "type": "object", "properties": { "pageSize": { "type": "integer" }, "page": { "type": "integer" } }, "required": [ "pageSize", "page" ] }, "data": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "externalId": { "type": "string" }, "channel": { "type": "string" }, "app": { "type": "string" }, "size": { "type": "integer" }, "direction": { "type": "string" }, "preview": { "type": "string" }, "sentiment": { "type": "object" }, "meta": { "type": "object", "properties": { "inReplyTo": { "type": "string" }, "recipient": { "type": "object", "properties": { "mailboxHash": { "type": "string" }, "email": { "type": "string" } }, "required": [ "mailboxHash", "email" ] }, "cc": { "type": "array" }, "to": { "type": "array", "items": { "type": "object", "properties": { "email": { "type": "string" } }, "required": [ "email" ] } }, "from": { "type": "string" }, "subject": { "type": "string" } }, "required": [ "inReplyTo", "recipient", "cc", "to", "from", "subject" ] }, "status": { "type": "string" }, "sentAt": { "type": "string" }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" } }, "required": [ "externalId", "channel", "app", "size", "direction", "preview", "sentiment", "meta", "status", "sentAt", "createdAt", "updatedAt" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "customer": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "conversation": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "customer", "conversation" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" }, "related": { "type": "string" } }, "required": [ "self", "related" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "links": { "type": "object", "properties": { "self": { "type": "string" }, "first": { "type": "string" }, "prev": { "type": "string", "nullable": true }, "next": { "type": "string", "nullable": true } }, "required": [ "self", "first", "prev", "next" ] } }, "required": [ "meta", "data", "links" ] }, "example": { "meta": { "pageSize": 100, "page": 1 }, "data": [ { "type": "message", "id": "57c8d2b01a57ed1400392073", "attributes": { "externalId": "", "channel": "email", "app": "postmark", "size": 0, "direction": "in", "preview": "Can you please help me?", "sentiment": {}, "meta": { "inReplyTo": "", "recipient": { "mailboxHash": "", "email": "support@kustomer.com" }, "cc": [], "to": [ { "email": "support@kustomer.com" } ], "from": "jeremy@kustomer.com", "subject": "Re: hey" }, "status": "received", "sentAt": "2016-09-02T01:15:14.000Z", "createdAt": "2016-09-02T01:15:31.140Z", "updatedAt": "2016-09-02T01:15:31.140Z" }, "relationships": { "org": { "links": { "self": "/v1/orgs/57bb5d2e32e83a130052e94e" }, "data": { "type": "org", "id": "57bb5d2e32e83a130052e94e" } }, "customer": { "links": { "self": "/v1/customers/57c08ccde595371400462df2" }, "data": { "type": "customers", "id": "57c08ccde595371400462df2" } }, "conversation": { "links": { "self": "/v1/conversations/57c8d2b365f7cc14004e674f" }, "data": { "type": "conversation", "id": "57c8d2b365f7cc14004e674f" } } }, "links": { "self": "/v1/messages/57c8d2b01a57ed1400392073", "related": "/v1/postmark/messages/57c8d2b01a57ed1400392073" } } ], "links": { "self": "/v1/customers/57c08ccde595371400462df2/messages?page=1&pageSize=100", "first": "/v1/customers/57c08ccde595371400462df2/messages?page=1&pageSize=100", "prev": null, "next": null } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] } }, "/customers/{id}/notes": { "get": { "security": [ { "httpBearer": [] } ], "tags": [ "Customers (Notes)", "Notes" ], "summary": "Get notes by customer ID", "description": "Retrieves notes for a specific customer based on the unique customer ID.\n\n[Notes](https://help.kustomer.com/using-notes-HJvDjNP58) are internal communications visible only to users in your Kustomer organization.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.note.read|org.permission.note.read|", "operationId": "GetNotesByCustomer", "parameters": [ { "name": "id", "in": "path", "description": "Unique ID of the customer.", "required": true, "style": "simple", "schema": { "type": "string", "example": "57c08ccde595371400462df2" } }, { "name": "page", "in": "query", "schema": { "type": "number", "default": 1, "example": 1 }, "description": "Number of pages to return for results. Default value: 1." }, { "name": "pageSize", "in": "query", "required": false, "schema": { "type": "number", "default": 100, "example": 100 }, "description": "Number of results to return per page. Default value: 100." } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "meta": { "type": "object", "properties": { "pageSize": { "type": "integer" }, "page": { "type": "integer" } }, "required": [ "pageSize", "page" ] }, "data": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "body": { "type": "string" }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" } }, "required": [ "body", "createdAt", "updatedAt" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "customer": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "createdBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "conversation": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "userMentions": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } } }, "required": [ "data" ] } }, "required": [ "org", "customer", "createdBy", "conversation", "userMentions" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "links": { "type": "object", "properties": { "self": { "type": "string" }, "first": { "type": "string" }, "prev": { "type": "string", "nullable": true }, "next": { "type": "string", "nullable": true } }, "required": [ "self", "first", "prev", "next" ] } }, "required": [ "meta", "data", "links" ] }, "example": { "meta": { "pageSize": 100, "page": 1 }, "data": [ { "type": "note", "id": "5828a3be7c7f551a00b5b720", "attributes": { "body": "Hey __Agent Smith__, do you know the answer to this problem?", "createdAt": "2016-11-13T17:32:46.480Z", "updatedAt": "2016-11-13T17:32:46.480Z" }, "relationships": { "org": { "links": { "self": "/v1/orgs/57bb5d2e32e83a130052e94e" }, "data": { "type": "org", "id": "57bb5d2e32e83a130052e94e" } }, "customer": { "links": { "self": "/v1/customers/57c08ccde595371400462df2" }, "data": { "type": "customer", "id": "57c08ccde595371400462df2" } }, "createdBy": { "links": { "self": "/v1/users/57bb5d2e32e83a130052e94f" }, "data": { "type": "user", "id": "57bb5d2e32e83a130052e94f" } }, "conversation": { "links": { "self": "/v1/conversations/57c8d2b365f7cc14004e674f" }, "data": { "type": "conversation", "id": "57c8d2b365f7cc14004e674f" } }, "userMentions": { "data": [ { "type": "user", "id": "57c8ccd7b417854d0003246b" } ] } }, "links": { "self": "/v1/notes/5828a3be7c7f551a00b5b720" } } ], "links": { "self": "/v1/customers/57c08ccde595371400462df2/notes?page=1&pageSize=100", "first": "/v1/customers/57c08ccde595371400462df2/notes?page=1&pageSize=100", "prev": null, "next": null } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] } }, "/customers/{id}/unmasking-windows": { "post": { "security": [ { "httpBearer": [] } ], "tags": [ "Customers (Unmasking Windows)", "Unmasking Windows" ], "summary": "Create unmasking window by customer ID", "description": "Creates or replaces an unmasking window based on the unique customer ID.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----------------------|--------------------------------------|\n|org.user.customer.write|org.permission.unmasking_window.create|\n\n### Note\n> If an unmasking window is created for a customer, any sensitive attributes for the customer and for the customer's conversations, messages, and custom objects will be returned unmasked during the unmasking window period.", "operationId": "CreateUnmaskingWindowByCustomer", "parameters": [ { "name": "id", "in": "path", "description": "Unique ID of the customer.", "required": true, "style": "simple", "schema": { "type": "string", "example": "57c08ccde595371400462df2" } } ], "requestBody": { "description": "Creates a new or replaces an existing unmasking window for a customer.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.customer.write|org.permission.unmasking_window.create|\n\n### Note\n> If an unmasking window is created for a customer, any sensitive attributes for the customer and for the customer's conversations, messages, and custom objects will be returned unmasked during the unmasking window period.", "content": { "text/plain": { "example": "" } } }, "responses": { "201": { "description": "Created", "content": { "application/json": { "example": { "data": { "type": "customer", "id": "57a6082ae92c9510005e35ea", "attributes": { "name": "Jane Smith", "unmaskingWindow": { "requestedBy": "628bf03a2ca24d0b81b7dfd3", "startDate": "2022-06-23T17:18:55.139Z", "endDate": "2022-06-24T01:18:55.139Z", "updatedAt": "2022-06-24T01:18:55.139Z", "createdAt": "2022-06-24T01:18:55.139Z" }, "createdAt": "2022-06-24T01:18:55.139Z", "updatedAt": "2022-06-24T01:18:55.139Z", "modifiedAt": "2022-06-24T01:18:55.139Z" }, "relationships": { "org": { "links": { "self": "/v1/orgs/57bb5d2e32e83a130052e94e" }, "data": { "type": "org", "id": "57bb5d2e32e83a130052e94e" } }, "createdBy": { "links": { "self": "/v1/users/57bb5d2e32e83a130052e94f" }, "data": { "type": "user", "id": "57bb5d2e32e83a130052e94f" } }, "modifiedBy": { "links": { "self": "/v1/users/628bf03a2ca24d0b81b7dfd3" }, "data": { "type": "user", "id": "628bf03a2ca24d0b81b7dfd3" } }, "customer": { "links": { "self": "/v1/customers/57c08ccde595371400462df2" }, "data": { "type": "customers", "id": "57c08ccde595371400462df2" } }, "conversation": { "links": { "self": "/v1/conversations/58288a637c7f551a00b5b716" }, "data": { "type": "conversation", "id": "58288a637c7f551a00b5b716" } } }, "links": { "self": "/v1/messages/57a6082ae92c9510005e35ea" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] }, "delete": { "security": [ { "httpBearer": [] } ], "tags": [ "Customers (Unmasking Windows)", "Unmasking Windows" ], "summary": "Deletes unmasking window by customer ID", "description": "Deletes an unmasking window based on the unique customer ID.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----------------------|--------------------------------------|\n|org.user.customer.write|org.permission.unmasking_window.delete|\n\n### Note\n> If an unmasking window is deleted for a customer, any sensitive attributes for the customer and for the customer's conversations, messages, and custom objects will be returned masked.", "operationId": "DeleteUnmaskingWindowByCustomer", "parameters": [ { "name": "id", "in": "path", "description": "Unique ID of the customer.", "required": true, "style": "simple", "schema": { "type": "string", "example": "57c08ccde595371400462df2" } } ], "requestBody": { "description": "Deletes an existing unmasking window for a customer.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.customer.write|org.permission.unmasking_window.delete|\n\n### Note\n> If an unmasking window is deleted for a customer, any sensitive attributes for the customer and for the customer's conversations, messages, and custom objects will be returned masked.", "content": { "text/plain": { "example": "" } } }, "responses": { "204": { "description": "No Content", "content": { "text/plain": { "example": "" } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] } }, "/customers": { "post": { "security": [ { "httpBearer": [] } ], "tags": [ "Customers" ], "summary": "Create customer", "description": "Creates a new customer record.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.customer.write|org.permission.customer.create|\n\n### Custom Attributes\n[Custom attributes](https://help.kustomer.com/define-attributes-Skr924HI) are optional and allow you to specify custom key-value pairs.\n\nKustomer uses a naming convention for custom attributes to specify the field data type with a name suffix:\n\n#### Naming Suffix\n\n* `Num` *number* or *null*\n* `At` *date-time* or *null*\n* `Str` *string* or *null*, length: [ 0 .. 1024 ] characters\n* `Txt` *string* or *null*, length: [ 0 .. 1024 ] characters\n* `Bool` *boolean* or *null*\n* `Url` *string* or *null*, format: *uri*", "operationId": "CreateCustomer", "parameters": [], "requestBody": { "description": "", "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string", "maxLength": 256, "nullable": true }, "company": { "type": "string", "nullable": true }, "externalId": { "type": "string", "minLength": 1, "maxLength": 256, "nullable": true }, "username": { "type": "string", "maxLength": 256, "nullable": true }, "signedUpAt": { "type": "string", "format": "date-time", "nullable": true }, "lastActivityAt": { "type": "string", "format": "date-time", "nullable": true }, "lastCustomerActivityAt": { "type": "string", "format": "date-time", "nullable": true }, "lastSeenAt": { "type": "string", "format": "date-time", "nullable": true }, "avatarUrl": { "type": "string", "format": "uri", "nullable": true }, "externalIds": { "type": "array", "items": { "type": "object", "properties": { "externalId": { "type": "string", "minLength": 1, "maxLength": 255 }, "verified": { "type": "boolean" } }, "required": [ "externalId" ], "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "sharedExternalIds": { "type": "array", "items": { "type": "object", "properties": { "externalId": { "type": "string", "minLength": 1, "maxLength": 255 }, "verified": { "type": "boolean" } }, "required": [ "externalId" ], "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "emails": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "home", "work", "other" ] }, "email": { "type": "string", "format": "email-relaxed" }, "verified": { "type": "boolean" } }, "required": [ "email" ], "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "sharedEmails": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "home", "work", "other" ] }, "email": { "type": "string", "format": "email-relaxed" }, "verified": { "type": "boolean" } }, "required": [ "email" ], "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "phones": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "mobile", "home", "work", "fax", "other" ] }, "phone": { "type": "string", "format": "phone-number" }, "verified": { "type": "boolean" } }, "required": [ "phone" ], "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "sharedPhones": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "mobile", "home", "work", "fax", "other" ] }, "phone": { "type": "string", "format": "phone-number" }, "verified": { "type": "boolean" } }, "required": [ "phone" ], "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "whatsapps": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "mobile" ] }, "phone": { "type": "string", "format": "whatsapp-number" }, "verified": { "type": "boolean" } }, "required": [ "phone" ], "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "facebookIds": { "type": "array", "items": { "type": "object", "properties": { "pageId": { "type": "string", "maxLength": 255 }, "userId": { "type": "string", "maxLength": 255 }, "name": { "type": "string", "maxLength": 255 } }, "required": [ "pageId", "userId" ], "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "instagramIds": { "type": "array", "items": { "type": "object", "properties": { "pageId": { "type": "string", "maxLength": 255 }, "threadId": { "type": "string", "maxLength": 255 }, "username": { "type": "string", "maxLength": 255 }, "instagramId": { "type": "string", "maxLength": 255 } }, "required": [ "pageId", "threadId", "username" ], "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "socials": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "twitter", "facebook", "instagram", "linkedin", "pinterest" ] }, "userid": { "type": "string", "maxLength": 256 }, "username": { "type": "string", "minLength": 1, "maxLength": 256 }, "url": { "type": "string", "format": "uri" }, "verified": { "type": "boolean" } }, "required": [ "type", "username" ], "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "sharedSocials": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "twitter", "facebook", "instagram", "linkedin", "pinterest" ] }, "userid": { "type": "string", "maxLength": 256 }, "username": { "type": "string", "minLength": 1, "maxLength": 256 }, "url": { "type": "string", "format": "uri" }, "verified": { "type": "boolean" } }, "required": [ "type", "username" ], "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "urls": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "website", "blog", "other" ] }, "url": { "type": "string", "format": "url" } }, "required": [ "url" ], "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "locations": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "home", "work", "other" ], "nullable": true }, "name": { "type": "string", "nullable": true }, "address": { "type": "string", "maxLength": 256, "nullable": true }, "address2": { "type": "string", "maxLength": 256, "nullable": true }, "address3": { "type": "string", "maxLength": 256, "nullable": true }, "latitude": { "type": "number", "nullable": true }, "longitude": { "type": "number", "nullable": true }, "countryCode": { "type": "string", "minLength": 2, "maxLength": 2, "nullable": true }, "countryName": { "type": "string", "maxLength": 64, "nullable": true }, "regionCode": { "type": "string", "maxLength": 2, "nullable": true }, "regionName": { "type": "string", "maxLength": 128, "nullable": true }, "cityName": { "type": "string", "maxLength": 128, "nullable": true }, "zipCode": { "type": "string", "maxLength": 30, "nullable": true }, "areaCode": { "type": "string", "maxLength": 30, "nullable": true } }, "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "locale": { "type": "string", "maxLength": 16, "nullable": true }, "timeZone": { "type": "string", "maxLength": 64, "nullable": true }, "tags": { "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 64, "pattern": "^[0-9a-zA-ZÀ-ÿ_/<>\\-.]{1}[0-9a-zA-ZÀ-ÿ _/<>\\-.]{0,63}$" }, "maxItems": 20, "uniqueItems": true }, "sentiment": { "type": "object", "properties": { "polarity": { "type": "number", "enum": [ -1, 0, 1 ] }, "confidence": { "type": "number", "minimum": -1, "maximum": 1 } }, "required": [ "polarity", "confidence" ], "additionalProperties": false }, "custom": { "type": "object", "maxProperties": 100, "additionalProperties": false }, "birthdayAt": { "type": "string", "format": "date-time", "nullable": true }, "gender": { "type": "string", "enum": [ "m", "f" ], "nullable": true }, "createdAt": { "type": "string", "format": "date-time" }, "importedAt": { "type": "string", "format": "date-time" }, "rev": { "type": "number" }, "defaultLang": { "type": "string", "maxLength": 100, "nullable": true } }, "additionalProperties": false } } } }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "name": { "type": "string" }, "displayName": { "type": "string" }, "displayColor": { "type": "string" }, "displayIcon": { "type": "string" }, "externalIds": { "type": "array" }, "sharedExternalIds": { "type": "array" }, "emails": { "type": "array", "items": { "type": "object", "properties": { "email": { "type": "string" }, "verified": { "type": "boolean" }, "type": { "type": "string" }, "id": { "type": "string", "nullable": true } }, "required": [ "email", "verified", "type", "id" ] } }, "sharedEmails": { "type": "array" }, "phones": { "type": "array", "items": { "type": "object", "properties": { "phone": { "type": "string" }, "verified": { "type": "boolean" }, "type": { "type": "string" }, "id": { "type": "string", "nullable": true } }, "required": [ "phone", "verified", "type", "id" ] } }, "sharedPhones": { "type": "array" }, "socials": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string" }, "userid": { "type": "string" }, "username": { "type": "string" }, "url": { "type": "string" }, "verified": { "type": "boolean" }, "id": { "type": "string", "nullable": true } }, "required": [ "type", "userid", "username", "url", "verified", "id" ] } }, "sharedSocials": { "type": "array" }, "urls": { "type": "array", "items": { "type": "object", "properties": { "url": { "type": "string" }, "type": { "type": "string" }, "id": { "type": "string", "nullable": true } }, "required": [ "url", "type", "id" ] } }, "locations": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string" }, "address": { "type": "string" }, "id": { "type": "string", "nullable": true } }, "required": [ "type", "address", "id" ] } }, "activeUsers": { "type": "array" }, "watchers": { "type": "array" }, "recentLocation": { "type": "object", "properties": { "updatedAt": { "type": "string" } }, "required": [ "updatedAt" ] }, "locale": { "type": "string" }, "defaultLang": { "type": "string" }, "gender": { "type": "string" }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "modifiedAt": { "type": "string" }, "lastActivityAt": { "type": "string" }, "lastConversation": { "type": "object", "properties": { "tags": { "type": "array" } }, "required": [ "tags" ] }, "conversationCounts": { "type": "object", "properties": { "all": { "type": "integer" }, "snoozed": { "type": "integer" }, "open": { "type": "integer" }, "done": { "type": "integer" } }, "required": [ "all", "snoozed", "open", "done" ] }, "tags": { "type": "array", "items": { "type": "string" } }, "progressiveStatus": { "type": "string", "nullable": true }, "verified": { "type": "boolean" }, "rev": { "type": "integer" } }, "required": [ "name", "displayName", "displayColor", "displayIcon", "externalIds", "sharedExternalIds", "emails", "sharedEmails", "phones", "sharedPhones", "socials", "sharedSocials", "urls", "locations", "activeUsers", "watchers", "recentLocation", "locale", "defaultLang", "gender", "createdAt", "updatedAt", "modifiedAt", "lastActivityAt", "lastConversation", "conversationCounts", "tags", "progressiveStatus", "verified", "rev" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "messages": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "links" ] }, "createdBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "modifiedBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "messages", "createdBy", "modifiedBy" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "customer", "id": "5822a4a5aa5f92110005d69a", "attributes": { "name": "John Smith", "displayName": "John Smith", "displayColor": "green", "displayIcon": "compass", "externalIds": [], "sharedExternalIds": [], "emails": [ { "email": "johnsmith@example.com", "verified": false, "type": "home", "id": null } ], "sharedEmails": [], "phones": [ { "phone": "+18005551212", "verified": false, "type": "work", "id": null } ], "sharedPhones": [], "socials": [ { "type": "twitter", "userid": "1234", "username": "@johnsmith", "url": "http://twitter.com/johnsmith", "verified": false, "id": null } ], "sharedSocials": [], "urls": [ { "url": "https://kustomer.com", "type": "website", "id": null } ], "locations": [ { "type": "work", "address": "530 7th Ave, New York, NY 10018", "id": null } ], "activeUsers": [], "watchers": [], "recentLocation": { "updatedAt": "2016-11-09T04:23:01.927Z" }, "locale": "en_US", "defaultLang": "pt", "gender": "m", "createdAt": "2016-11-09T04:23:01.925Z", "updatedAt": "2016-11-09T04:23:01.925Z", "modifiedAt": "2016-11-09T04:23:01.925Z", "lastActivityAt": "2016-11-09T04:23:01.925Z", "lastConversation": { "tags": [] }, "conversationCounts": { "all": 0, "snoozed": 0, "open": 0, "done": 0 }, "tags": [ "5822a4a5aa5f92110005d696", "5822a4a5aa5f92110005d698" ], "progressiveStatus": null, "verified": true, "rev": 1 }, "relationships": { "org": { "links": { "self": "/v1/orgs/57f29863a1dbf61100e6aa92" }, "data": { "type": "org", "id": "57f29863a1dbf61100e6aa92" } }, "messages": { "links": { "self": "/v1/customers/5822a4a5aa5f92110005d69a/messages" } }, "createdBy": { "links": { "self": "/v1/users/58190b991f2932100010d683" }, "data": { "type": "user", "id": "58190b991f2932100010d683" } }, "modifiedBy": { "links": { "self": "/v1/users/58190b991f2932100010d683" }, "data": { "type": "user", "id": "58190b991f2932100010d683" } } }, "links": { "self": "/v1/customers/5822a4a5aa5f92110005d69a" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] }, "get": { "security": [ { "httpBearer": [] } ], "tags": [ "Customers" ], "summary": "Get customers", "description": "Retrieves all customers in your organization. Results include customer data, such as their phone number, sentiment score, and the last message in a conversation.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.customer.read|org.permission.customer.read|", "operationId": "GetCustomers", "parameters": [], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "meta": { "type": "object", "properties": { "pageSize": { "type": "integer" }, "page": { "type": "integer" }, "total": { "type": "integer" }, "totalPages": { "type": "integer" } }, "required": [ "pageSize", "page", "total", "totalPages" ] }, "data": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "name": { "type": "string" }, "displayName": { "type": "string" }, "displayColor": { "type": "string" }, "displayIcon": { "type": "string" }, "externalIds": { "type": "array" }, "sharedExternalIds": { "type": "array" }, "emails": { "type": "array", "items": { "type": "object", "properties": { "email": { "type": "string" }, "verified": { "type": "boolean" }, "type": { "type": "string" } }, "required": [ "email", "verified", "type" ] } }, "sharedEmails": { "type": "array" }, "phones": { "type": "array", "items": { "type": "object", "properties": { "phone": { "type": "string" }, "verified": { "type": "boolean" }, "type": { "type": "string" } }, "required": [ "phone", "verified", "type" ] } }, "sharedPhones": { "type": "array" }, "socials": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string" }, "userid": { "type": "string" }, "username": { "type": "string" }, "url": { "type": "string" }, "verified": { "type": "boolean" } }, "required": [ "type", "userid", "username", "url", "verified" ] } }, "sharedSocials": { "type": "array" }, "urls": { "type": "array", "items": { "type": "object", "properties": { "url": { "type": "string" }, "type": { "type": "string" } }, "required": [ "url", "type" ] } }, "locations": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string" }, "address": { "type": "string" } }, "required": [ "type", "address" ] } }, "activeUsers": { "type": "array" }, "watchers": { "type": "array" }, "recentLocation": { "type": "object", "properties": { "updatedAt": { "type": "string" } }, "required": [ "updatedAt" ] }, "locale": { "type": "string" }, "gender": { "type": "string" }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "modifiedAt": { "type": "string" }, "lastActivityAt": { "type": "string" }, "lastMessageIn": { "type": "object", "properties": { "sentiment": { "type": "object" } }, "required": [ "sentiment" ] }, "lastConversation": { "type": "object", "properties": { "tags": { "type": "array" }, "sentiment": { "type": "object" } }, "required": [ "tags", "sentiment" ] }, "conversationCounts": { "type": "object", "properties": { "done": { "type": "integer" }, "open": { "type": "integer" }, "snoozed": { "type": "integer" }, "all": { "type": "integer" } }, "required": [ "done", "open", "snoozed", "all" ] }, "preview": { "type": "object" }, "tags": { "type": "array", "items": { "type": "string" } }, "progressiveStatus": { "type": "string", "nullable": true }, "verified": { "type": "boolean" }, "rev": { "type": "integer" } }, "required": [ "name", "displayName", "displayColor", "displayIcon", "externalIds", "sharedExternalIds", "emails", "sharedEmails", "phones", "sharedPhones", "socials", "sharedSocials", "urls", "locations", "activeUsers", "watchers", "recentLocation", "locale", "gender", "createdAt", "updatedAt", "modifiedAt", "lastActivityAt", "lastMessageIn", "lastConversation", "conversationCounts", "preview", "tags", "progressiveStatus", "verified", "rev" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "messages": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "links" ] }, "createdBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "modifiedBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "messages", "createdBy", "modifiedBy" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "links": { "type": "object", "properties": { "self": { "type": "string" }, "first": { "type": "string" }, "prev": { "type": "string", "nullable": true }, "next": { "type": "string", "nullable": true }, "last": { "type": "string" } }, "required": [ "self", "first", "prev", "next", "last" ] } }, "required": [ "meta", "data", "links" ] }, "example": { "meta": { "pageSize": 30, "page": 1, "total": 1, "totalPages": 1 }, "data": [ { "type": "customer", "id": "5822a4a5aa5f92110005d69a", "attributes": { "name": "John Smith", "displayName": "John Smith", "displayColor": "green", "displayIcon": "compass", "externalIds": [], "sharedExternalIds": [], "emails": [ { "email": "johnsmith@example.com", "verified": false, "type": "home" } ], "sharedEmails": [], "phones": [ { "phone": "+18005551212", "verified": false, "type": "work" } ], "sharedPhones": [], "socials": [ { "type": "twitter", "userid": "1234", "username": "@johnsmith", "url": "http://twitter.com/johnsmith", "verified": false } ], "sharedSocials": [], "urls": [ { "url": "https://kustomer.com", "type": "website" } ], "locations": [ { "type": "work", "address": "530 7th Ave, New York, NY 10018" } ], "activeUsers": [], "watchers": [], "recentLocation": { "updatedAt": "2016-11-09T04:23:01.927Z" }, "locale": "en_US", "gender": "m", "createdAt": "2016-11-09T04:23:01.925Z", "updatedAt": "2016-11-09T04:23:01.925Z", "modifiedAt": "2016-11-09T04:23:01.925Z", "lastActivityAt": "2016-11-09T04:23:01.925Z", "lastMessageIn": { "sentiment": {} }, "lastConversation": { "tags": [], "sentiment": {} }, "conversationCounts": { "done": 0, "open": 0, "snoozed": 0, "all": 0 }, "preview": {}, "tags": [ "5822a4a5aa5f92110005d696", "5822a4a5aa5f92110005d698" ], "progressiveStatus": null, "verified": true, "rev": 1 }, "relationships": { "org": { "links": { "self": "/v1/orgs/57f29863a1dbf61100e6aa92" }, "data": { "type": "org", "id": "57f29863a1dbf61100e6aa92" } }, "messages": { "links": { "self": "/v1/customers/5822a4a5aa5f92110005d69a/messages" } }, "createdBy": { "links": { "self": "/v1/users/58190b991f2932100010d683" }, "data": { "type": "user", "id": "58190b991f2932100010d683" } }, "modifiedBy": { "links": { "self": "/v1/users/58190b991f2932100010d683" }, "data": { "type": "user", "id": "58190b991f2932100010d683" } } }, "links": { "self": "/v1/customers/5822a4a5aa5f92110005d69a" } } ], "links": { "self": "/v1/customers?page=1&pageSize=30", "first": "/v1/customers?page=1&pageSize=30", "prev": null, "next": null, "last": "/v1/customers?page=1&pageSize=30" } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] } }, "/customers/{id}": { "get": { "security": [ { "httpBearer": [] } ], "tags": [ "Customers" ], "summary": "Get customer by ID", "description": "Retrieves a customer record based on the unique customer ID.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.customer.read|org.permission.customer.read|", "operationId": "GetCustomerById", "parameters": [ { "name": "id", "in": "path", "description": "Unique ID of the customer.", "required": true, "style": "simple", "schema": { "type": "string", "example": "58210c3db0f09110006b795" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "name": { "type": "string" }, "displayName": { "type": "string" }, "displayColor": { "type": "string" }, "displayIcon": { "type": "string" }, "externalId": { "type": "string" }, "externalIds": { "type": "array", "items": { "type": "object", "properties": { "externalId": { "type": "string" }, "verified": { "type": "boolean" }, "id": { "type": "string", "nullable": true } }, "required": [ "externalId", "verified", "id" ] } }, "sharedExternalIds": { "type": "array" }, "signedUpAt": { "type": "string", "nullable": true }, "avatarUrl": { "type": "string", "nullable": true }, "username": { "type": "string", "nullable": true }, "emails": { "type": "array", "items": { "type": "object", "properties": { "email": { "type": "string" }, "verified": { "type": "boolean" }, "type": { "type": "string" }, "id": { "type": "string", "nullable": true } }, "required": [ "email", "verified", "type", "id" ] } }, "sharedEmails": { "type": "array", "items": { "type": "object", "properties": { "email": { "type": "string" }, "verified": { "type": "boolean" }, "type": { "type": "string" }, "id": { "type": "string", "nullable": true } }, "required": [ "email", "verified", "type", "id" ] } }, "phones": { "type": "array" }, "sharedPhones": { "type": "array" }, "socials": { "type": "array" }, "sharedSocials": { "type": "array" }, "urls": { "type": "array" }, "locations": { "type": "array" }, "activeUsers": { "type": "array" }, "watchers": { "type": "array" }, "recentLocation": { "type": "object", "properties": { "updatedAt": { "type": "string" } }, "required": [ "updatedAt" ] }, "locale": { "type": "string", "nullable": true }, "timeZone": { "type": "string", "nullable": true }, "birthdayAt": { "type": "string", "nullable": true }, "gender": { "type": "string", "nullable": true }, "presence": { "type": "string" }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "modifiedAt": { "type": "string" }, "lastSeenAt": { "type": "string" }, "lastActivityAt": { "type": "string" }, "lastCustomerActivityAt": { "type": "string" }, "lastMessageIn": { "type": "object", "properties": { "sentAt": { "type": "string" }, "sentiment": { "type": "string", "nullable": true } }, "required": [ "sentAt", "sentiment" ] }, "lastConversation": { "type": "object", "properties": { "id": { "type": "string" }, "sentiment": { "type": "object", "properties": { "confidence": { "type": "number" }, "polarity": { "type": "integer" } }, "required": [ "confidence", "polarity" ] }, "tags": { "type": "array" } }, "required": [ "id", "sentiment", "tags" ] }, "conversationCounts": { "type": "object", "properties": { "all": { "type": "integer" }, "snoozed": { "type": "integer" }, "open": { "type": "integer" }, "done": { "type": "integer" } }, "required": [ "all", "snoozed", "open", "done" ] }, "preview": { "type": "object", "properties": { "previewAt": { "type": "string" }, "type": { "type": "string" }, "text": { "type": "string" }, "subject": { "type": "string" } }, "required": [ "previewAt", "type", "text", "subject" ] }, "tags": { "type": "array" }, "sentiment": { "type": "object", "properties": { "polarity": { "type": "integer" }, "confidence": { "type": "number" } }, "required": [ "polarity", "confidence" ] }, "progressiveStatus": { "type": "string" }, "verified": { "type": "boolean" }, "rev": { "type": "integer" } }, "required": [ "name", "displayName", "displayColor", "displayIcon", "externalId", "externalIds", "sharedExternalIds", "signedUpAt", "avatarUrl", "username", "emails", "sharedEmails", "phones", "sharedPhones", "socials", "sharedSocials", "urls", "locations", "activeUsers", "watchers", "recentLocation", "locale", "timeZone", "birthdayAt", "gender", "presence", "createdAt", "updatedAt", "modifiedAt", "lastSeenAt", "lastActivityAt", "lastCustomerActivityAt", "lastMessageIn", "lastConversation", "conversationCounts", "preview", "tags", "sentiment", "progressiveStatus", "verified", "rev" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "messages": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "links" ] }, "modifiedBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "messages", "modifiedBy" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "customer", "id": "58210c3db0f09110006b7953", "attributes": { "name": "John Smith Jr.", "displayName": "John Smith Jr.", "displayColor": "yellow", "displayIcon": "flower", "externalId": "my-customer-database-id", "externalIds": [ { "externalId": "my-customer-database-id", "verified": true, "id": null } ], "sharedExternalIds": [], "signedUpAt": null, "avatarUrl": null, "username": null, "emails": [ { "email": "abu@kustomer.com", "verified": true, "type": "home", "id": null } ], "sharedEmails": [ { "email": "abu@kustomer.com", "verified": false, "type": "home", "id": null } ], "phones": [], "sharedPhones": [], "socials": [], "sharedSocials": [], "urls": [], "locations": [], "activeUsers": [], "watchers": [], "recentLocation": { "updatedAt": "2016-11-07T23:22:01.746Z" }, "locale": null, "timeZone": null, "birthdayAt": null, "gender": null, "presence": "offline", "createdAt": "2016-11-07T23:20:29.080Z", "updatedAt": "2016-11-09T04:47:07.036Z", "modifiedAt": "2016-11-09T04:47:07.036Z", "lastSeenAt": "2016-11-07T23:23:51.582Z", "lastActivityAt": "2016-11-09T04:47:07.036Z", "lastCustomerActivityAt": "2016-11-07T23:23:51.582Z", "lastMessageIn": { "sentAt": "2016-11-07T23:22:02.281Z", "sentiment": null }, "lastConversation": { "id": "58210c99b0f09110006b7969", "sentiment": { "confidence": 0.649023, "polarity": 1 }, "tags": [] }, "conversationCounts": { "all": 3, "snoozed": 0, "open": 2, "done": 1 }, "preview": { "previewAt": "2016-11-07T23:23:26.039Z", "type": "message_out", "text": "dfsd fsdsfdsfdsf", "subject": "Hi, do you guys have an XXL hoodie" }, "tags": [], "sentiment": { "polarity": 1, "confidence": 0.649023 }, "progressiveStatus": "open", "verified": true, "rev": 37 }, "relationships": { "org": { "links": { "self": "/v1/orgs/57f29863a1dbf61100e6aa92" }, "data": { "type": "org", "id": "57f29863a1dbf61100e6aa92" } }, "messages": { "links": { "self": "/v1/customers/58210c3db0f09110006b7953/messages" } }, "modifiedBy": { "links": { "self": "/v1/users/58190b991f2932100010d683" }, "data": { "type": "user", "id": "58190b991f2932100010d683" } } }, "links": { "self": "/v1/customers/58210c3db0f09110006b7953" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] }, "put": { "security": [ { "httpBearer": [] } ], "tags": [ "Customers" ], "summary": "Update customer", "description": "Updates a customer based on the unique customer ID.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.customer.write|org.permission.customer.update|\n\n### Note\n> This endpoint is subject to Object Rate Limiting, which limits how many updates single user can make to a single customer. To learn more, see [Rate limiting](https://developer.kustomer.com/kustomer-api-docs/reference/rate-limiting).\n\n### Company\nIf you omit the company, the customer will no longer be linked to the company.\n\n### Custom Attributes\n[Custom attributes](https://help.kustomer.com/define-attributes-Skr924HI) are optional and allow you to specify custom key-value pairs.\n\nKustomer uses a naming convention for custom attributes to specify the field data type with a name suffix:\n\n#### Naming Suffix\n\n* `Num` *number* or *null*\n* `At` *date-time* or *null*\n* `Str` *string* or *null*, length: [ 0 .. 1024 ] characters\n* `Txt` *string* or *null*, length: [ 0 .. 1024 ] characters\n* `Bool` *boolean* or *null*\n* `Url` *string* or *null*, format: *uri*", "operationId": "UpdateCustomer", "parameters": [ { "name": "id", "in": "path", "description": "Unique ID of the customer.", "required": true, "style": "simple", "schema": { "type": "string", "example": "58210c3db0f09110006b7953" } }, { "name": "replace", "in": "query", "required": false, "schema": { "type": "boolean", "example": true, "default": false }, "description": "Set to `true` to update the document. Otherwise, performs the same update as a PATCH request. Default value: `false`." } ], "requestBody": { "description": "", "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string", "maxLength": 256, "nullable": true }, "company": { "type": "string", "nullable": true }, "externalId": { "type": "string", "minLength": 1, "maxLength": 256, "nullable": true }, "username": { "type": "string", "maxLength": 256, "nullable": true }, "signedUpAt": { "type": "string", "format": "date-time", "nullable": true }, "lastActivityAt": { "type": "string", "format": "date-time", "nullable": true }, "lastCustomerActivityAt": { "type": "string", "format": "date-time", "nullable": true }, "lastSeenAt": { "type": "string", "format": "date-time", "nullable": true }, "avatarUrl": { "type": "string", "format": "uri", "nullable": true }, "externalIds": { "type": "array", "items": { "type": "object", "properties": { "externalId": { "type": "string", "minLength": 1, "maxLength": 255 }, "verified": { "type": "boolean" } }, "required": [ "externalId" ], "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "sharedExternalIds": { "type": "array", "items": { "type": "object", "properties": { "externalId": { "type": "string", "minLength": 1, "maxLength": 255 }, "verified": { "type": "boolean" } }, "required": [ "externalId" ], "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "emails": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "home", "work", "other" ] }, "email": { "type": "string", "format": "email-relaxed" }, "verified": { "type": "boolean" } }, "required": [ "email" ], "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "sharedEmails": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "home", "work", "other" ] }, "email": { "type": "string", "format": "email-relaxed" }, "verified": { "type": "boolean" } }, "required": [ "email" ], "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "phones": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "mobile", "home", "work", "fax", "other" ] }, "phone": { "type": "string", "format": "phone-number" }, "verified": { "type": "boolean" } }, "required": [ "phone" ], "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "sharedPhones": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "mobile", "home", "work", "fax", "other" ] }, "phone": { "type": "string", "format": "phone-number" }, "verified": { "type": "boolean" } }, "required": [ "phone" ], "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "whatsapps": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "mobile" ] }, "phone": { "type": "string", "format": "whatsapp-number" }, "verified": { "type": "boolean" } }, "required": [ "phone" ], "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "facebookIds": { "type": "array", "items": { "type": "object", "properties": { "pageId": { "type": "string", "maxLength": 255 }, "userId": { "type": "string", "maxLength": 255 }, "name": { "type": "string", "maxLength": 255 } }, "required": [ "pageId", "userId" ], "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "instagramIds": { "type": "array", "items": { "type": "object", "properties": { "pageId": { "type": "string", "maxLength": 255 }, "threadId": { "type": "string", "maxLength": 255 }, "username": { "type": "string", "maxLength": 255 }, "instagramId": { "type": "string", "maxLength": 255 } }, "required": [ "pageId", "threadId", "username" ], "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "socials": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "twitter", "facebook", "instagram", "linkedin", "pinterest" ] }, "userid": { "type": "string", "maxLength": 256 }, "username": { "type": "string", "minLength": 1, "maxLength": 256 }, "url": { "type": "string", "format": "uri" }, "verified": { "type": "boolean" } }, "required": [ "type", "username" ], "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "sharedSocials": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "twitter", "facebook", "instagram", "linkedin", "pinterest" ] }, "userid": { "type": "string", "maxLength": 256 }, "username": { "type": "string", "minLength": 1, "maxLength": 256 }, "url": { "type": "string", "format": "uri" }, "verified": { "type": "boolean" } }, "required": [ "type", "username" ], "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "urls": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "website", "blog", "other" ] }, "url": { "type": "string", "format": "url" } }, "required": [ "url" ], "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "locations": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "home", "work", "other" ], "nullable": true }, "name": { "type": "string", "nullable": true }, "address": { "type": "string", "maxLength": 256, "nullable": true }, "address2": { "type": "string", "maxLength": 256, "nullable": true }, "address3": { "type": "string", "maxLength": 256, "nullable": true }, "latitude": { "type": "number", "nullable": true }, "longitude": { "type": "number", "nullable": true }, "countryCode": { "type": "string", "minLength": 2, "maxLength": 2, "nullable": true }, "countryName": { "type": "string", "maxLength": 64, "nullable": true }, "regionCode": { "type": "string", "maxLength": 2, "nullable": true }, "regionName": { "type": "string", "maxLength": 128, "nullable": true }, "cityName": { "type": "string", "maxLength": 128, "nullable": true }, "zipCode": { "type": "string", "maxLength": 30, "nullable": true }, "areaCode": { "type": "string", "maxLength": 30, "nullable": true } }, "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "locale": { "type": "string", "maxLength": 16, "nullable": true }, "timeZone": { "type": "string", "maxLength": 64, "nullable": true }, "tags": { "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 64, "pattern": "^[0-9a-zA-ZÀ-ÿ_/<>\\-.]{1}[0-9a-zA-ZÀ-ÿ _/<>\\-.]{0,63}$" }, "maxItems": 20, "uniqueItems": true }, "sentiment": { "type": "object", "properties": { "polarity": { "type": "number", "enum": [ -1, 0, 1 ] }, "confidence": { "type": "number", "minimum": -1, "maximum": 1 } }, "required": [ "polarity", "confidence" ], "additionalProperties": false }, "custom": { "type": "object", "maxProperties": 100, "additionalProperties": false }, "birthdayAt": { "type": "string", "format": "date-time", "nullable": true }, "gender": { "type": "string", "enum": [ "m", "f" ], "nullable": true }, "createdAt": { "type": "string", "format": "date-time" }, "importedAt": { "type": "string", "format": "date-time" }, "rev": { "type": "number" }, "defaultLang": { "type": "string", "maxLength": 100, "nullable": true } }, "additionalProperties": false } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "name": { "type": "string" }, "displayName": { "type": "string" }, "displayColor": { "type": "string" }, "displayIcon": { "type": "string" }, "externalId": { "type": "string" }, "externalIds": { "type": "array", "items": { "type": "object", "properties": { "externalId": { "type": "string" }, "verified": { "type": "boolean" }, "id": { "type": "string", "nullable": true } }, "required": [ "externalId", "verified", "id" ] } }, "sharedExternalIds": { "type": "array" }, "signedUpAt": { "type": "string", "nullable": true }, "avatarUrl": { "type": "string", "nullable": true }, "username": { "type": "string", "nullable": true }, "emails": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string" }, "email": { "type": "string" } }, "required": [ "type", "email" ] } }, "sharedEmails": { "type": "array" }, "phones": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string" }, "phone": { "type": "string" } }, "required": [ "type", "phone" ] } }, "sharedPhones": { "type": "array" }, "socials": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string" }, "userid": { "type": "string" }, "username": { "type": "string" }, "url": { "type": "string" } }, "required": [ "type", "userid", "username", "url" ] } }, "sharedSocials": { "type": "array" }, "urls": { "type": "array", "items": { "type": "object", "properties": { "url": { "type": "string" } }, "required": [ "url" ] } }, "locations": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string" }, "address": { "type": "string" } }, "required": [ "type", "address" ] } }, "activeUsers": { "type": "array" }, "watchers": { "type": "array" }, "recentLocation": { "type": "object", "properties": { "updatedAt": { "type": "string" } }, "required": [ "updatedAt" ] }, "locale": { "type": "string" }, "gender": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } }, "timeZone": { "type": "string", "nullable": true }, "birthdayAt": { "type": "string", "nullable": true }, "presence": { "type": "string" }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "modifiedAt": { "type": "string" }, "lastSeenAt": { "type": "string" }, "lastActivityAt": { "type": "string" }, "lastCustomerActivityAt": { "type": "string" }, "lastMessageIn": { "type": "object", "properties": { "sentAt": { "type": "string" }, "sentiment": { "type": "string", "nullable": true } }, "required": [ "sentAt", "sentiment" ] }, "lastConversation": { "type": "object", "properties": { "id": { "type": "string" }, "sentiment": { "type": "object", "properties": { "confidence": { "type": "number" }, "polarity": { "type": "integer" } }, "required": [ "confidence", "polarity" ] }, "tags": { "type": "array" } }, "required": [ "id", "sentiment", "tags" ] }, "defaultLang": { "type": "string" }, "conversationCounts": { "type": "object", "properties": { "all": { "type": "integer" }, "snoozed": { "type": "integer" }, "open": { "type": "integer" }, "done": { "type": "integer" } }, "required": [ "all", "snoozed", "open", "done" ] }, "preview": { "type": "object", "properties": { "previewAt": { "type": "string" }, "type": { "type": "string" }, "text": { "type": "string" }, "subject": { "type": "string" } }, "required": [ "previewAt", "type", "text", "subject" ] }, "sentiment": { "type": "object", "properties": { "polarity": { "type": "integer" }, "confidence": { "type": "number" } }, "required": [ "polarity", "confidence" ] }, "progressiveStatus": { "type": "string" }, "verified": { "type": "boolean" }, "rev": { "type": "integer" } }, "required": [ "name", "displayName", "displayColor", "displayIcon", "externalId", "externalIds", "sharedExternalIds", "signedUpAt", "avatarUrl", "username", "emails", "sharedEmails", "phones", "sharedPhones", "socials", "sharedSocials", "urls", "locations", "activeUsers", "watchers", "recentLocation", "locale", "gender", "tags", "timeZone", "birthdayAt", "presence", "createdAt", "updatedAt", "modifiedAt", "lastSeenAt", "lastActivityAt", "lastCustomerActivityAt", "lastMessageIn", "lastConversation", "defaultLang", "conversationCounts", "preview", "sentiment", "progressiveStatus", "verified", "rev" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "messages": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "links" ] }, "modifiedBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "messages", "modifiedBy" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "customer", "id": "58210c3db0f09110006b7953", "attributes": { "name": "John Smith", "displayName": "John Smith", "displayColor": "yellow", "displayIcon": "flower", "externalId": "my-customer-database-id", "externalIds": [ { "externalId": "my-customer-database-id", "verified": true, "id": null } ], "sharedExternalIds": [], "signedUpAt": null, "avatarUrl": null, "username": null, "emails": [ { "type": "home", "email": "johnsmith@example.com" } ], "sharedEmails": [], "phones": [ { "type": "work", "phone": "+18005551212" } ], "sharedPhones": [], "socials": [ { "type": "twitter", "userid": "1234", "username": "@johnsmith", "url": "http://twitter.com/johnsmith" } ], "sharedSocials": [], "urls": [ { "url": "https://kustomer.com" } ], "locations": [ { "type": "work", "address": "530 7th Ave, New York, NY 10018" } ], "activeUsers": [], "watchers": [], "recentLocation": { "updatedAt": "2016-11-07T23:22:01.746Z" }, "locale": "en_US", "gender": "m", "tags": [ "cool customer", "nice" ], "timeZone": null, "birthdayAt": null, "presence": "offline", "createdAt": "2016-11-07T23:20:29.080Z", "updatedAt": "2016-11-09T04:47:07.036Z", "modifiedAt": "2016-11-09T04:47:07.036Z", "lastSeenAt": "2016-11-07T23:23:51.582Z", "lastActivityAt": "2016-11-09T04:47:07.036Z", "lastCustomerActivityAt": "2016-11-07T23:23:51.582Z", "lastMessageIn": { "sentAt": "2016-11-07T23:22:02.281Z", "sentiment": null }, "lastConversation": { "id": "58210c99b0f09110006b7969", "sentiment": { "confidence": 0.649023, "polarity": 1 }, "tags": [] }, "defaultLang": "en_us", "conversationCounts": { "all": 3, "snoozed": 0, "open": 2, "done": 1 }, "preview": { "previewAt": "2016-11-07T23:23:26.039Z", "type": "message_out", "text": "dfsd fsdsfdsfdsf", "subject": "Hi, do you guys have an XXL hoodie" }, "sentiment": { "polarity": 1, "confidence": 0.649023 }, "progressiveStatus": "open", "verified": true, "rev": 37 }, "relationships": { "org": { "links": { "self": "/v1/orgs/57f29863a1dbf61100e6aa92" }, "data": { "type": "org", "id": "57f29863a1dbf61100e6aa92" } }, "messages": { "links": { "self": "/v1/customers/58210c3db0f09110006b7953/messages" } }, "modifiedBy": { "links": { "self": "/v1/users/58190b991f2932100010d683" }, "data": { "type": "user", "id": "58190b991f2932100010d683" } } }, "links": { "self": "/v1/customers/58210c3db0f09110006b7953" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] }, "patch": { "security": [ { "httpBearer": [] } ], "tags": [ "Customers" ], "summary": "Update customer attributes", "description": "Updates customer attributes.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.customer.write|org.permission.customer.update|\n\n### Note\n> This endpoint is subject to Object Rate Limiting, which limits how many updates single user can make to a single customer. To learn more, see [Rate limiting](https://developer.kustomer.com/kustomer-api-docs/reference/rate-limiting).\n\n### Company\nIf you omit the company, the customer will no longer be linked to the company.\n\n### Custom Attributes\n[Custom attributes](https://help.kustomer.com/define-attributes-Skr924HI) are optional and allow you to specify custom key-value pairs.\n\nKustomer uses a naming convention for custom attributes to specify the field data type with a name suffix:\n\n#### Naming Suffix\n\n* `Num` *number* or *null*\n* `At` *date-time* or *null*\n* `Str` *string* or *null*, length: [ 0 .. 1024 ] characters\n* `Txt` *string* or *null*, length: [ 0 .. 1024 ] characters\n* `Bool` *boolean* or *null*\n* `Url` *string* or *null*, format: *uri*", "operationId": "UpdateCustomerAttributes", "parameters": [ { "name": "id", "in": "path", "description": "Unique ID of the customer.", "required": true, "style": "simple", "schema": { "type": "string", "example": "58210c3db0f09110006b7953" } } ], "requestBody": { "description": "", "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string", "maxLength": 256, "nullable": true }, "company": { "type": "string", "nullable": true }, "externalId": { "type": "string", "minLength": 1, "maxLength": 256, "nullable": true }, "username": { "type": "string", "maxLength": 256, "nullable": true }, "signedUpAt": { "type": "string", "format": "date-time", "nullable": true }, "lastActivityAt": { "type": "string", "format": "date-time", "nullable": true }, "lastCustomerActivityAt": { "type": "string", "format": "date-time", "nullable": true }, "lastSeenAt": { "type": "string", "format": "date-time", "nullable": true }, "avatarUrl": { "type": "string", "format": "uri", "nullable": true }, "externalIds": { "type": "array", "items": { "type": "object", "properties": { "externalId": { "type": "string", "minLength": 1, "maxLength": 255 }, "verified": { "type": "boolean" } }, "required": [ "externalId" ], "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "sharedExternalIds": { "type": "array", "items": { "type": "object", "properties": { "externalId": { "type": "string", "minLength": 1, "maxLength": 255 }, "verified": { "type": "boolean" } }, "required": [ "externalId" ], "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "emails": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "home", "work", "other" ] }, "email": { "type": "string", "format": "email-relaxed" }, "verified": { "type": "boolean" } }, "required": [ "email" ], "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "sharedEmails": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "home", "work", "other" ] }, "email": { "type": "string", "format": "email-relaxed" }, "verified": { "type": "boolean" } }, "required": [ "email" ], "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "phones": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "mobile", "home", "work", "fax", "other" ] }, "phone": { "type": "string", "format": "phone-number" }, "verified": { "type": "boolean" } }, "required": [ "phone" ], "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "sharedPhones": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "mobile", "home", "work", "fax", "other" ] }, "phone": { "type": "string", "format": "phone-number" }, "verified": { "type": "boolean" } }, "required": [ "phone" ], "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "whatsapps": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "mobile" ] }, "phone": { "type": "string", "format": "whatsapp-number" }, "verified": { "type": "boolean" } }, "required": [ "phone" ], "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "facebookIds": { "type": "array", "items": { "type": "object", "properties": { "pageId": { "type": "string", "maxLength": 255 }, "userId": { "type": "string", "maxLength": 255 }, "name": { "type": "string", "maxLength": 255 } }, "required": [ "pageId", "userId" ], "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "instagramIds": { "type": "array", "items": { "type": "object", "properties": { "pageId": { "type": "string", "maxLength": 255 }, "threadId": { "type": "string", "maxLength": 255 }, "username": { "type": "string", "maxLength": 255 }, "instagramId": { "type": "string", "maxLength": 255 } }, "required": [ "pageId", "threadId", "username" ], "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "socials": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "twitter", "facebook", "instagram", "linkedin", "pinterest" ] }, "userid": { "type": "string", "maxLength": 256 }, "username": { "type": "string", "minLength": 1, "maxLength": 256 }, "url": { "type": "string", "format": "uri" }, "verified": { "type": "boolean" } }, "required": [ "type", "username" ], "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "sharedSocials": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "twitter", "facebook", "instagram", "linkedin", "pinterest" ] }, "userid": { "type": "string", "maxLength": 256 }, "username": { "type": "string", "minLength": 1, "maxLength": 256 }, "url": { "type": "string", "format": "uri" }, "verified": { "type": "boolean" } }, "required": [ "type", "username" ], "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "urls": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "website", "blog", "other" ] }, "url": { "type": "string", "format": "url" } }, "required": [ "url" ], "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "locations": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "home", "work", "other" ], "nullable": true }, "name": { "type": "string", "nullable": true }, "address": { "type": "string", "maxLength": 256, "nullable": true }, "address2": { "type": "string", "maxLength": 256, "nullable": true }, "address3": { "type": "string", "maxLength": 256, "nullable": true }, "latitude": { "type": "number", "nullable": true }, "longitude": { "type": "number", "nullable": true }, "countryCode": { "type": "string", "minLength": 2, "maxLength": 2, "nullable": true }, "countryName": { "type": "string", "maxLength": 64, "nullable": true }, "regionCode": { "type": "string", "maxLength": 2, "nullable": true }, "regionName": { "type": "string", "maxLength": 128, "nullable": true }, "cityName": { "type": "string", "maxLength": 128, "nullable": true }, "zipCode": { "type": "string", "maxLength": 30, "nullable": true }, "areaCode": { "type": "string", "maxLength": 30, "nullable": true } }, "additionalProperties": false }, "maxItems": 10, "uniqueItems": true }, "locale": { "type": "string", "maxLength": 16, "nullable": true }, "timeZone": { "type": "string", "maxLength": 64, "nullable": true }, "tags": { "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 64, "pattern": "^[0-9a-zA-ZÀ-ÿ_/<>\\-.]{1}[0-9a-zA-ZÀ-ÿ _/<>\\-.]{0,63}$" }, "maxItems": 20, "uniqueItems": true }, "sentiment": { "type": "object", "properties": { "polarity": { "type": "number", "enum": [ -1, 0, 1 ] }, "confidence": { "type": "number", "minimum": -1, "maximum": 1 } }, "required": [ "polarity", "confidence" ], "additionalProperties": false }, "custom": { "type": "object", "maxProperties": 100, "additionalProperties": false }, "birthdayAt": { "type": "string", "format": "date-time", "nullable": true }, "gender": { "type": "string", "enum": [ "m", "f" ], "nullable": true }, "createdAt": { "type": "string", "format": "date-time" }, "importedAt": { "type": "string", "format": "date-time" }, "rev": { "type": "number" }, "defaultLang": { "type": "string", "maxLength": 100, "nullable": true } }, "additionalProperties": false } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "name": { "type": "string" }, "displayName": { "type": "string" }, "displayColor": { "type": "string" }, "displayIcon": { "type": "string" }, "externalId": { "type": "string" }, "externalIds": { "type": "array", "items": { "type": "object", "properties": { "externalId": { "type": "string" }, "verified": { "type": "boolean" }, "id": { "type": "string", "nullable": true } }, "required": [ "externalId", "verified", "id" ] } }, "sharedExternalIds": { "type": "array" }, "signedUpAt": { "type": "string", "nullable": true }, "avatarUrl": { "type": "string", "nullable": true }, "username": { "type": "string", "nullable": true }, "emails": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string" }, "email": { "type": "string" } }, "required": [ "type", "email" ] } }, "sharedEmails": { "type": "array" }, "phones": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string" }, "phone": { "type": "string" } }, "required": [ "type", "phone" ] } }, "sharedPhones": { "type": "array" }, "socials": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string" }, "userid": { "type": "string" }, "username": { "type": "string" }, "url": { "type": "string" } }, "required": [ "type", "userid", "username", "url" ] } }, "sharedSocials": { "type": "array" }, "urls": { "type": "array", "items": { "type": "object", "properties": { "url": { "type": "string" } }, "required": [ "url" ] } }, "locations": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string" }, "address": { "type": "string" } }, "required": [ "type", "address" ] } }, "activeUsers": { "type": "array" }, "watchers": { "type": "array" }, "recentLocation": { "type": "object", "properties": { "updatedAt": { "type": "string" } }, "required": [ "updatedAt" ] }, "locale": { "type": "string" }, "gender": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } }, "timeZone": { "type": "string", "nullable": true }, "birthdayAt": { "type": "string", "nullable": true }, "presence": { "type": "string" }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "modifiedAt": { "type": "string" }, "lastSeenAt": { "type": "string" }, "lastActivityAt": { "type": "string" }, "lastCustomerActivityAt": { "type": "string" }, "lastMessageIn": { "type": "object", "properties": { "sentAt": { "type": "string" }, "sentiment": { "type": "string", "nullable": true } }, "required": [ "sentAt", "sentiment" ] }, "lastConversation": { "type": "object", "properties": { "id": { "type": "string" }, "sentiment": { "type": "object", "properties": { "confidence": { "type": "number" }, "polarity": { "type": "integer" } }, "required": [ "confidence", "polarity" ] }, "tags": { "type": "array" } }, "required": [ "id", "sentiment", "tags" ] }, "defaultLang": { "type": "string" }, "conversationCounts": { "type": "object", "properties": { "all": { "type": "integer" }, "snoozed": { "type": "integer" }, "open": { "type": "integer" }, "done": { "type": "integer" } }, "required": [ "all", "snoozed", "open", "done" ] }, "preview": { "type": "object", "properties": { "previewAt": { "type": "string" }, "type": { "type": "string" }, "text": { "type": "string" }, "subject": { "type": "string" } }, "required": [ "previewAt", "type", "text", "subject" ] }, "sentiment": { "type": "object", "properties": { "polarity": { "type": "integer" }, "confidence": { "type": "number" } }, "required": [ "polarity", "confidence" ] }, "progressiveStatus": { "type": "string" }, "verified": { "type": "boolean" }, "rev": { "type": "integer" } }, "required": [ "name", "displayName", "displayColor", "displayIcon", "externalId", "externalIds", "sharedExternalIds", "signedUpAt", "avatarUrl", "username", "emails", "sharedEmails", "phones", "sharedPhones", "socials", "sharedSocials", "urls", "locations", "activeUsers", "watchers", "recentLocation", "locale", "gender", "tags", "timeZone", "birthdayAt", "presence", "createdAt", "updatedAt", "modifiedAt", "lastSeenAt", "lastActivityAt", "lastCustomerActivityAt", "lastMessageIn", "lastConversation", "defaultLang", "conversationCounts", "preview", "sentiment", "progressiveStatus", "verified", "rev" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "messages": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "links" ] }, "modifiedBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "messages", "modifiedBy" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "customer", "id": "58210c3db0f09110006b7953", "attributes": { "name": "John Smith", "displayName": "John Smith", "displayColor": "yellow", "displayIcon": "flower", "externalId": "my-customer-database-id", "externalIds": [ { "externalId": "my-customer-database-id", "verified": true, "id": null } ], "sharedExternalIds": [], "signedUpAt": null, "avatarUrl": null, "username": null, "emails": [ { "type": "home", "email": "johnsmith@example.com" } ], "sharedEmails": [], "phones": [ { "type": "work", "phone": "+18005551212" } ], "sharedPhones": [], "socials": [ { "type": "twitter", "userid": "1234", "username": "@johnsmith", "url": "http://twitter.com/johnsmith" } ], "sharedSocials": [], "urls": [ { "url": "https://kustomer.com" } ], "locations": [ { "type": "work", "address": "530 7th Ave, New York, NY 10018" } ], "activeUsers": [], "watchers": [], "recentLocation": { "updatedAt": "2016-11-07T23:22:01.746Z" }, "locale": "en_US", "gender": "m", "tags": [ "cool customer", "nice" ], "timeZone": null, "birthdayAt": null, "presence": "offline", "createdAt": "2016-11-07T23:20:29.080Z", "updatedAt": "2016-11-09T04:47:07.036Z", "modifiedAt": "2016-11-09T04:47:07.036Z", "lastSeenAt": "2016-11-07T23:23:51.582Z", "lastActivityAt": "2016-11-09T04:47:07.036Z", "lastCustomerActivityAt": "2016-11-07T23:23:51.582Z", "lastMessageIn": { "sentAt": "2016-11-07T23:22:02.281Z", "sentiment": null }, "lastConversation": { "id": "58210c99b0f09110006b7969", "sentiment": { "confidence": 0.649023, "polarity": 1 }, "tags": [] }, "defaultLang": "en_us", "conversationCounts": { "all": 3, "snoozed": 0, "open": 2, "done": 1 }, "preview": { "previewAt": "2016-11-07T23:23:26.039Z", "type": "message_out", "text": "dfsd fsdsfdsfdsf", "subject": "Hi, do you guys have an XXL hoodie" }, "sentiment": { "polarity": 1, "confidence": 0.649023 }, "progressiveStatus": "open", "verified": true, "rev": 37 }, "relationships": { "org": { "links": { "self": "/v1/orgs/57f29863a1dbf61100e6aa92" }, "data": { "type": "org", "id": "57f29863a1dbf61100e6aa92" } }, "messages": { "links": { "self": "/v1/customers/58210c3db0f09110006b7953/messages" } }, "modifiedBy": { "links": { "self": "/v1/users/58190b991f2932100010d683" }, "data": { "type": "user", "id": "58190b991f2932100010d683" } } }, "links": { "self": "/v1/customers/58210c3db0f09110006b7953" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] }, "delete": { "security": [ { "httpBearer": [] } ], "tags": [ "Customers" ], "summary": "Delete customer", "description": "Deletes a customer record based on the unique customer ID.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.customer.delete|org.permission.customer.delete|", "operationId": "DeleteCustomer", "parameters": [ { "name": "id", "in": "path", "description": "Unique ID of the customer.", "required": true, "style": "simple", "schema": { "type": "string", "example": "58210c3db0f09110006b7953" } } ], "responses": { "204": { "description": "No Content", "content": { "text/plain": { "example": "" } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] } }, "/customers/email={email}": { "get": { "security": [ { "httpBearer": [] } ], "tags": [ "Customers" ], "summary": "Get customer by email", "description": "Retrieves a customer based on their email address.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.customer.read|org.permission.customer.read|", "operationId": "GetCustomerByEmail", "parameters": [ { "name": "email", "in": "path", "description": "Email address of the customer.", "required": true, "style": "simple", "schema": { "type": "string", "format": "email", "example": "customer.name@email.com" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "name": { "type": "string" }, "displayName": { "type": "string" }, "displayColor": { "type": "string" }, "displayIcon": { "type": "string" }, "externalId": { "type": "string" }, "externalIds": { "type": "array", "items": { "type": "object", "properties": { "externalId": { "type": "string" }, "verified": { "type": "boolean" }, "id": { "type": "string", "nullable": true } }, "required": [ "externalId", "verified", "id" ] } }, "sharedExternalIds": { "type": "array" }, "signedUpAt": { "type": "string", "nullable": true }, "avatarUrl": { "type": "string", "nullable": true }, "username": { "type": "string", "nullable": true }, "emails": { "type": "array", "items": { "type": "object", "properties": { "email": { "type": "string" }, "verified": { "type": "boolean" }, "type": { "type": "string" }, "id": { "type": "string", "nullable": true } }, "required": [ "email", "verified", "type", "id" ] } }, "sharedEmails": { "type": "array", "items": { "type": "object", "properties": { "email": { "type": "string" }, "verified": { "type": "boolean" }, "type": { "type": "string" }, "id": { "type": "string", "nullable": true } }, "required": [ "email", "verified", "type", "id" ] } }, "phones": { "type": "array" }, "sharedPhones": { "type": "array" }, "socials": { "type": "array" }, "sharedSocials": { "type": "array" }, "urls": { "type": "array" }, "locations": { "type": "array" }, "activeUsers": { "type": "array" }, "watchers": { "type": "array" }, "recentLocation": { "type": "object", "properties": { "updatedAt": { "type": "string" } }, "required": [ "updatedAt" ] }, "locale": { "type": "string", "nullable": true }, "timeZone": { "type": "string", "nullable": true }, "birthdayAt": { "type": "string", "nullable": true }, "gender": { "type": "string", "nullable": true }, "presence": { "type": "string" }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "modifiedAt": { "type": "string" }, "lastSeenAt": { "type": "string" }, "lastActivityAt": { "type": "string" }, "lastCustomerActivityAt": { "type": "string" }, "lastMessageIn": { "type": "object", "properties": { "sentAt": { "type": "string" }, "sentiment": { "type": "string", "nullable": true } }, "required": [ "sentAt", "sentiment" ] }, "lastConversation": { "type": "object", "properties": { "id": { "type": "string" }, "sentiment": { "type": "object", "properties": { "confidence": { "type": "number" }, "polarity": { "type": "integer" } }, "required": [ "confidence", "polarity" ] }, "tags": { "type": "array" } }, "required": [ "id", "sentiment", "tags" ] }, "conversationCounts": { "type": "object", "properties": { "all": { "type": "integer" }, "snoozed": { "type": "integer" }, "open": { "type": "integer" }, "done": { "type": "integer" } }, "required": [ "all", "snoozed", "open", "done" ] }, "preview": { "type": "object", "properties": { "previewAt": { "type": "string" }, "type": { "type": "string" }, "text": { "type": "string" }, "subject": { "type": "string" } }, "required": [ "previewAt", "type", "text", "subject" ] }, "tags": { "type": "array" }, "sentiment": { "type": "object", "properties": { "polarity": { "type": "integer" }, "confidence": { "type": "number" } }, "required": [ "polarity", "confidence" ] }, "progressiveStatus": { "type": "string" }, "verified": { "type": "boolean" }, "rev": { "type": "integer" } }, "required": [ "name", "displayName", "displayColor", "displayIcon", "externalId", "externalIds", "sharedExternalIds", "signedUpAt", "avatarUrl", "username", "emails", "sharedEmails", "phones", "sharedPhones", "socials", "sharedSocials", "urls", "locations", "activeUsers", "watchers", "recentLocation", "locale", "timeZone", "birthdayAt", "gender", "presence", "createdAt", "updatedAt", "modifiedAt", "lastSeenAt", "lastActivityAt", "lastCustomerActivityAt", "lastMessageIn", "lastConversation", "conversationCounts", "preview", "tags", "sentiment", "progressiveStatus", "verified", "rev" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "messages": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "links" ] }, "modifiedBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "messages", "modifiedBy" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "customer", "id": "58210c3db0f09110006b7953", "attributes": { "name": "John Smith Jr.", "displayName": "John Smith Jr.", "displayColor": "yellow", "displayIcon": "flower", "externalId": "my-customer-database-id", "externalIds": [ { "externalId": "my-customer-database-id", "verified": true, "id": null } ], "sharedExternalIds": [], "signedUpAt": null, "avatarUrl": null, "username": null, "emails": [ { "email": "abu@kustomer.com", "verified": true, "type": "home", "id": null } ], "sharedEmails": [ { "email": "abu@kustomer.com", "verified": false, "type": "home", "id": null } ], "phones": [], "sharedPhones": [], "socials": [], "sharedSocials": [], "urls": [], "locations": [], "activeUsers": [], "watchers": [], "recentLocation": { "updatedAt": "2016-11-07T23:22:01.746Z" }, "locale": null, "timeZone": null, "birthdayAt": null, "gender": null, "presence": "offline", "createdAt": "2016-11-07T23:20:29.080Z", "updatedAt": "2016-11-09T04:47:07.036Z", "modifiedAt": "2016-11-09T04:47:07.036Z", "lastSeenAt": "2016-11-07T23:23:51.582Z", "lastActivityAt": "2016-11-09T04:47:07.036Z", "lastCustomerActivityAt": "2016-11-07T23:23:51.582Z", "lastMessageIn": { "sentAt": "2016-11-07T23:22:02.281Z", "sentiment": null }, "lastConversation": { "id": "58210c99b0f09110006b7969", "sentiment": { "confidence": 0.649023, "polarity": 1 }, "tags": [] }, "conversationCounts": { "all": 3, "snoozed": 0, "open": 2, "done": 1 }, "preview": { "previewAt": "2016-11-07T23:23:26.039Z", "type": "message_out", "text": "dfsd fsdsfdsfdsf", "subject": "Hi, do you guys have an XXL hoodie" }, "tags": [], "sentiment": { "polarity": 1, "confidence": 0.649023 }, "progressiveStatus": "open", "verified": true, "rev": 37 }, "relationships": { "org": { "links": { "self": "/v1/orgs/57f29863a1dbf61100e6aa92" }, "data": { "type": "org", "id": "57f29863a1dbf61100e6aa92" } }, "messages": { "links": { "self": "/v1/customers/58210c3db0f09110006b7953/messages" } }, "modifiedBy": { "links": { "self": "/v1/users/58190b991f2932100010d683" }, "data": { "type": "user", "id": "58190b991f2932100010d683" } } }, "links": { "self": "/v1/customers/58210c3db0f09110006b7953" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] }, "parameters": [] }, "/customers/externalId={externalId}": { "get": { "security": [ { "httpBearer": [] } ], "tags": [ "Customers" ], "summary": "Get customer by external ID", "description": "Retrieves a customer based on their unique external ID.\n\nThe `externalId` is typically the ID of the customer within your database or an external service.\n\nThis provides a unique way to create and identify users by mapping a unique customer ID in Kustomer to a unique customer ID in an external system.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.customer.read|org.permission.customer.read|", "operationId": "GetCustomerByExternalId", "parameters": [ { "name": "externalId", "in": "path", "description": "External ID of the customer.", "required": true, "style": "simple", "schema": { "type": "string", "example": "my-customer-database-id" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "name": { "type": "string" }, "displayName": { "type": "string" }, "displayColor": { "type": "string" }, "displayIcon": { "type": "string" }, "externalId": { "type": "string" }, "externalIds": { "type": "array", "items": { "type": "object", "properties": { "externalId": { "type": "string" }, "verified": { "type": "boolean" }, "id": { "type": "string", "nullable": true } }, "required": [ "externalId", "verified", "id" ] } }, "sharedExternalIds": { "type": "array" }, "signedUpAt": { "type": "string", "nullable": true }, "avatarUrl": { "type": "string", "nullable": true }, "username": { "type": "string", "nullable": true }, "emails": { "type": "array", "items": { "type": "object", "properties": { "email": { "type": "string" }, "verified": { "type": "boolean" }, "type": { "type": "string" }, "id": { "type": "string", "nullable": true } }, "required": [ "email", "verified", "type", "id" ] } }, "sharedEmails": { "type": "array", "items": { "type": "object", "properties": { "email": { "type": "string" }, "verified": { "type": "boolean" }, "type": { "type": "string" }, "id": { "type": "string", "nullable": true } }, "required": [ "email", "verified", "type", "id" ] } }, "phones": { "type": "array" }, "sharedPhones": { "type": "array" }, "socials": { "type": "array" }, "sharedSocials": { "type": "array" }, "urls": { "type": "array" }, "locations": { "type": "array" }, "activeUsers": { "type": "array" }, "watchers": { "type": "array" }, "recentLocation": { "type": "object", "properties": { "updatedAt": { "type": "string" } }, "required": [ "updatedAt" ] }, "locale": { "type": "string", "nullable": true }, "timeZone": { "type": "string", "nullable": true }, "birthdayAt": { "type": "string", "nullable": true }, "gender": { "type": "string", "nullable": true }, "presence": { "type": "string" }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "modifiedAt": { "type": "string" }, "lastSeenAt": { "type": "string" }, "lastActivityAt": { "type": "string" }, "lastCustomerActivityAt": { "type": "string" }, "lastMessageIn": { "type": "object", "properties": { "sentAt": { "type": "string" }, "sentiment": { "type": "string", "nullable": true } }, "required": [ "sentAt", "sentiment" ] }, "lastConversation": { "type": "object", "properties": { "id": { "type": "string" }, "sentiment": { "type": "object", "properties": { "confidence": { "type": "number" }, "polarity": { "type": "integer" } }, "required": [ "confidence", "polarity" ] }, "tags": { "type": "array" } }, "required": [ "id", "sentiment", "tags" ] }, "conversationCounts": { "type": "object", "properties": { "all": { "type": "integer" }, "snoozed": { "type": "integer" }, "open": { "type": "integer" }, "done": { "type": "integer" } }, "required": [ "all", "snoozed", "open", "done" ] }, "preview": { "type": "object", "properties": { "previewAt": { "type": "string" }, "type": { "type": "string" }, "text": { "type": "string" }, "subject": { "type": "string" } }, "required": [ "previewAt", "type", "text", "subject" ] }, "tags": { "type": "array" }, "sentiment": { "type": "object", "properties": { "polarity": { "type": "integer" }, "confidence": { "type": "number" } }, "required": [ "polarity", "confidence" ] }, "progressiveStatus": { "type": "string" }, "verified": { "type": "boolean" }, "rev": { "type": "integer" } }, "required": [ "name", "displayName", "displayColor", "displayIcon", "externalId", "externalIds", "sharedExternalIds", "signedUpAt", "avatarUrl", "username", "emails", "sharedEmails", "phones", "sharedPhones", "socials", "sharedSocials", "urls", "locations", "activeUsers", "watchers", "recentLocation", "locale", "timeZone", "birthdayAt", "gender", "presence", "createdAt", "updatedAt", "modifiedAt", "lastSeenAt", "lastActivityAt", "lastCustomerActivityAt", "lastMessageIn", "lastConversation", "conversationCounts", "preview", "tags", "sentiment", "progressiveStatus", "verified", "rev" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "messages": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "links" ] }, "modifiedBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "messages", "modifiedBy" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "customer", "id": "58210c3db0f09110006b7953", "attributes": { "name": "John Smith Jr.", "displayName": "John Smith Jr.", "displayColor": "yellow", "displayIcon": "flower", "externalId": "my-customer-database-id", "externalIds": [ { "externalId": "my-customer-database-id", "verified": true, "id": null } ], "sharedExternalIds": [], "signedUpAt": null, "avatarUrl": null, "username": null, "emails": [ { "email": "abu@kustomer.com", "verified": true, "type": "home", "id": null } ], "sharedEmails": [ { "email": "abu@kustomer.com", "verified": false, "type": "home", "id": null } ], "phones": [], "sharedPhones": [], "socials": [], "sharedSocials": [], "urls": [], "locations": [], "activeUsers": [], "watchers": [], "recentLocation": { "updatedAt": "2016-11-07T23:22:01.746Z" }, "locale": null, "timeZone": null, "birthdayAt": null, "gender": null, "presence": "offline", "createdAt": "2016-11-07T23:20:29.080Z", "updatedAt": "2016-11-09T04:47:07.036Z", "modifiedAt": "2016-11-09T04:47:07.036Z", "lastSeenAt": "2016-11-07T23:23:51.582Z", "lastActivityAt": "2016-11-09T04:47:07.036Z", "lastCustomerActivityAt": "2016-11-07T23:23:51.582Z", "lastMessageIn": { "sentAt": "2016-11-07T23:22:02.281Z", "sentiment": null }, "lastConversation": { "id": "58210c99b0f09110006b7969", "sentiment": { "confidence": 0.649023, "polarity": 1 }, "tags": [] }, "conversationCounts": { "all": 3, "snoozed": 0, "open": 2, "done": 1 }, "preview": { "previewAt": "2016-11-07T23:23:26.039Z", "type": "message_out", "text": "dfsd fsdsfdsfdsf", "subject": "Hi, do you guys have an XXL hoodie" }, "tags": [], "sentiment": { "polarity": 1, "confidence": 0.649023 }, "progressiveStatus": "open", "verified": true, "rev": 37 }, "relationships": { "org": { "links": { "self": "/v1/orgs/57f29863a1dbf61100e6aa92" }, "data": { "type": "org", "id": "57f29863a1dbf61100e6aa92" } }, "messages": { "links": { "self": "/v1/customers/58210c3db0f09110006b7953/messages" } }, "modifiedBy": { "links": { "self": "/v1/users/58190b991f2932100010d683" }, "data": { "type": "user", "id": "58190b991f2932100010d683" } } }, "links": { "self": "/v1/customers/58210c3db0f09110006b7953" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] }, "parameters": [] }, "/customers/phone={phone}": { "get": { "security": [ { "httpBearer": [] } ], "tags": [ "Customers" ], "summary": "Get customer by phone number", "description": "Retrieves a customer based on their phone number.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.customer.read|org.permission.customer.read|", "operationId": "GetCustomerByPhone", "parameters": [ { "name": "phone", "in": "path", "description": "Phone number of the customer (E.164 format).", "required": true, "style": "simple", "schema": { "type": "string", "example": "18005551212" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "name": { "type": "string" }, "displayName": { "type": "string" }, "displayColor": { "type": "string" }, "displayIcon": { "type": "string" }, "externalId": { "type": "string" }, "externalIds": { "type": "array", "items": { "type": "object", "properties": { "externalId": { "type": "string" }, "verified": { "type": "boolean" }, "id": { "type": "string", "nullable": true } }, "required": [ "externalId", "verified", "id" ] } }, "sharedExternalIds": { "type": "array" }, "signedUpAt": { "type": "string", "nullable": true }, "avatarUrl": { "type": "string", "nullable": true }, "username": { "type": "string", "nullable": true }, "emails": { "type": "array", "items": { "type": "object", "properties": { "email": { "type": "string" }, "verified": { "type": "boolean" }, "type": { "type": "string" }, "id": { "type": "string", "nullable": true } }, "required": [ "email", "verified", "type", "id" ] } }, "sharedEmails": { "type": "array", "items": { "type": "object", "properties": { "email": { "type": "string" }, "verified": { "type": "boolean" }, "type": { "type": "string" }, "id": { "type": "string", "nullable": true } }, "required": [ "email", "verified", "type", "id" ] } }, "phones": { "type": "array", "items": { "type": "object", "properties": { "phone": { "type": "string" }, "type": { "type": "string" } }, "required": [ "phone", "type" ] } }, "sharedPhones": { "type": "array" }, "socials": { "type": "array" }, "sharedSocials": { "type": "array" }, "urls": { "type": "array" }, "locations": { "type": "array" }, "activeUsers": { "type": "array" }, "watchers": { "type": "array" }, "recentLocation": { "type": "object", "properties": { "updatedAt": { "type": "string" } }, "required": [ "updatedAt" ] }, "locale": { "type": "string", "nullable": true }, "timeZone": { "type": "string", "nullable": true }, "birthdayAt": { "type": "string", "nullable": true }, "gender": { "type": "string", "nullable": true }, "presence": { "type": "string" }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "modifiedAt": { "type": "string" }, "lastSeenAt": { "type": "string" }, "lastActivityAt": { "type": "string" }, "lastCustomerActivityAt": { "type": "string" }, "lastMessageIn": { "type": "object", "properties": { "sentAt": { "type": "string" }, "sentiment": { "type": "string", "nullable": true } }, "required": [ "sentAt", "sentiment" ] }, "lastConversation": { "type": "object", "properties": { "id": { "type": "string" }, "sentiment": { "type": "object", "properties": { "confidence": { "type": "number" }, "polarity": { "type": "integer" } }, "required": [ "confidence", "polarity" ] }, "tags": { "type": "array" } }, "required": [ "id", "sentiment", "tags" ] }, "conversationCounts": { "type": "object", "properties": { "all": { "type": "integer" }, "snoozed": { "type": "integer" }, "open": { "type": "integer" }, "done": { "type": "integer" } }, "required": [ "all", "snoozed", "open", "done" ] }, "preview": { "type": "object", "properties": { "previewAt": { "type": "string" }, "type": { "type": "string" }, "text": { "type": "string" }, "subject": { "type": "string" } }, "required": [ "previewAt", "type", "text", "subject" ] }, "tags": { "type": "array" }, "sentiment": { "type": "object", "properties": { "polarity": { "type": "integer" }, "confidence": { "type": "number" } }, "required": [ "polarity", "confidence" ] }, "progressiveStatus": { "type": "string" }, "verified": { "type": "boolean" }, "rev": { "type": "integer" } }, "required": [ "name", "displayName", "displayColor", "displayIcon", "externalId", "externalIds", "sharedExternalIds", "signedUpAt", "avatarUrl", "username", "emails", "sharedEmails", "phones", "sharedPhones", "socials", "sharedSocials", "urls", "locations", "activeUsers", "watchers", "recentLocation", "locale", "timeZone", "birthdayAt", "gender", "presence", "createdAt", "updatedAt", "modifiedAt", "lastSeenAt", "lastActivityAt", "lastCustomerActivityAt", "lastMessageIn", "lastConversation", "conversationCounts", "preview", "tags", "sentiment", "progressiveStatus", "verified", "rev" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "messages": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "links" ] }, "modifiedBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "messages", "modifiedBy" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "customer", "id": "58210c3db0f09110006b7953", "attributes": { "name": "John Smith Jr.", "displayName": "John Smith Jr.", "displayColor": "yellow", "displayIcon": "flower", "externalId": "my-customer-database-id", "externalIds": [ { "externalId": "my-customer-database-id", "verified": true, "id": null } ], "sharedExternalIds": [], "signedUpAt": null, "avatarUrl": null, "username": null, "emails": [ { "email": "abu@kustomer.com", "verified": true, "type": "home", "id": null } ], "sharedEmails": [ { "email": "abu@kustomer.com", "verified": false, "type": "home", "id": null } ], "phones": [ { "phone": "18005551212", "type": "home" } ], "sharedPhones": [], "socials": [], "sharedSocials": [], "urls": [], "locations": [], "activeUsers": [], "watchers": [], "recentLocation": { "updatedAt": "2016-11-07T23:22:01.746Z" }, "locale": null, "timeZone": null, "birthdayAt": null, "gender": null, "presence": "offline", "createdAt": "2016-11-07T23:20:29.080Z", "updatedAt": "2016-11-09T04:47:07.036Z", "modifiedAt": "2016-11-09T04:47:07.036Z", "lastSeenAt": "2016-11-07T23:23:51.582Z", "lastActivityAt": "2016-11-09T04:47:07.036Z", "lastCustomerActivityAt": "2016-11-07T23:23:51.582Z", "lastMessageIn": { "sentAt": "2016-11-07T23:22:02.281Z", "sentiment": null }, "lastConversation": { "id": "58210c99b0f09110006b7969", "sentiment": { "confidence": 0.649023, "polarity": 1 }, "tags": [] }, "conversationCounts": { "all": 3, "snoozed": 0, "open": 2, "done": 1 }, "preview": { "previewAt": "2016-11-07T23:23:26.039Z", "type": "message_out", "text": "dfsd fsdsfdsfdsf", "subject": "Hi, do you guys have an XXL hoodie" }, "tags": [], "sentiment": { "polarity": 1, "confidence": 0.649023 }, "progressiveStatus": "open", "verified": true, "rev": 37 }, "relationships": { "org": { "links": { "self": "/v1/orgs/57f29863a1dbf61100e6aa92" }, "data": { "type": "org", "id": "57f29863a1dbf61100e6aa92" } }, "messages": { "links": { "self": "/v1/customers/58210c3db0f09110006b7953/messages" } }, "modifiedBy": { "links": { "self": "/v1/users/58190b991f2932100010d683" }, "data": { "type": "user", "id": "58190b991f2932100010d683" } } }, "links": { "self": "/v1/customers/58210c3db0f09110006b7953" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] } }, "/metadata/{resource}": { "get": { "security": [ { "httpBearer": [] } ], "tags": [ "Custom Attributes" ], "summary": "Get custom attribute metadata", "description": "Retrieves the [metadata properties](https://developer.kustomer.com/kustomer-apps-platform/docs/klasses#metadataproperties) for the custom attributes of a specific resource (for example, Company, Conversation, Customer, Message, and KObject (custom Object)).\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.metadata.read|org.permission.metadata.read|\n|org.admin.metadata.read||\n", "operationId": "GetCustomAttributeMetadata", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "properties": { "type": "object", "properties": { "shopifyCustomerIdNum": { "type": "object", "properties": { "type": { "type": "string" }, "displayName": { "type": "string" } }, "required": [ "type", "displayName" ] }, "myCustomStr": { "type": "object", "properties": { "modifiedBy": { "type": "string" }, "modifiedAt": { "type": "string" }, "updatedAt": { "type": "string" }, "type": { "type": "string" }, "enumeration": { "type": "array", "items": { "type": "string" } }, "displayName": { "type": "string" } }, "required": [ "modifiedBy", "modifiedAt", "updatedAt", "type", "enumeration", "displayName" ] }, "ordersId": { "type": "object", "properties": { "modifiedBy": { "type": "string" }, "modifiedAt": { "type": "string" }, "updatedAt": { "type": "string" }, "type": { "type": "string" }, "target": { "type": "string" }, "multi": { "type": "boolean" }, "displayName": { "type": "string" } }, "required": [ "modifiedBy", "modifiedAt", "updatedAt", "type", "target", "multi", "displayName" ] } }, "required": [ "shopifyCustomerIdNum", "myCustomStr", "ordersId" ] } }, "required": [ "properties" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "metadata", "id": "customer", "attributes": { "properties": { "shopifyCustomerIdNum": { "type": "number", "displayName": "Shopify Customer Id" }, "myCustomStr": { "modifiedBy": "57fd2d309d0ef811009cfdd6", "modifiedAt": "2016-11-08T12:53:21.532Z", "updatedAt": "2016-11-08T12:53:21.532Z", "type": "string", "enumeration": [ "option one", "option two", "option three" ], "displayName": "My Custom String!" }, "ordersId": { "modifiedBy": "57fd2d309d0ef811009cfdd6", "modifiedAt": "2016-11-08T12:53:21.532Z", "updatedAt": "2016-11-08T12:53:21.532Z", "type": "string", "target": "kobject.order", "multi": true, "displayName": "Orders" } } }, "relationships": { "org": { "links": { "self": "/v1/orgs/57f29863a1dbf61100e6aa92" }, "data": { "type": "org", "id": "57f29863a1dbf61100e6aa92" } } }, "links": { "self": "/v1/metadata/customer" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] }, "put": { "security": [ { "httpBearer": [] } ], "tags": [ "Custom Attributes" ], "summary": "Update custom attribute metadata", "description": "Sets the [metadata properties](https://developer.kustomer.com/kustomer-apps-platform/docs/klasses#metadataproperties) for custom attributes on any of the available resources (for example, Company, Conversation, Customer, Message, and KObject (custom Object)).\n\nMetadata property options are dependent on the data type as specified by the\nsuffix of the property name. The `displayName` default value is set to the title cased version of the camelCase property name and the type is determined automatically. For example, a property named `totalOrdersNum` will have a default `displayName` value of `Total Orders` (if no alternative `displayName` value is set) and the type is set to `number` based on the `Num` suffix in the property name `totalOrdersNum`.\n\nTo learn more about options for metadata properties, visit [Klasses](https://developer.kustomer.com/kustomer-apps-platform/docs/klasses#metadataproperties).\n\n### Note\n> When you configure metadata property types for custom attributes, you must configure metadata for custom properties ending with `Id` before you can use the attributes. When you update these properties, Kustomer validates these values to ensure that the related object exists and matches the specified target type.\n\n> When configuring attributes as sensitive, note that some attributes will inherit any permissions and metadata from other attributes. These are\n - `customer.externalId` inherits permissions and metadata from `customer.externalIds`\n - `customer.firstName`, `customer.lastName`, and `customer.displayName` inherits permissions and metadata from `customer.name`\n\n### Custom Attributes\n[Custom attributes](https://help.kustomer.com/define-attributes-Skr924HI) are optional and allow you to specify custom key-value pairs.\n\nKustomer uses a naming convention for custom attributes to specify the field data type with a name suffix:\n\n#### Naming Suffix\n\n* `Num` *number* or *null*\n* `At` *date-time* or *null*\n* `Str` *string* or *null*, length: [ 0 .. 1024 ] characters\n* `Txt` *string* or *null*, length: [ 0 .. 1024 ] characters\n* `Bool` *boolean* or *null*\n* `Url` *string* or *null*, format: *uri*\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.admin.metadata.write|org.permission.metadata.update|\n", "operationId": "UpdateCustomAttributeMetadata", "requestBody": { "description": "", "content": { "application/json": { "schema": { "type": "object", "properties": { "standardProperties": { "type": "object" }, "relationships": { "type": "object", "maxProperties": 20, "additionalProperties": false }, "properties": { "type": "object", "maxProperties": 100, "additionalProperties": false }, "validations": { "type": "array", "items": { "type": "string", "format": "object-id" }, "maxItems": 10, "uniqueItems": true } }, "additionalProperties": false } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "properties": { "type": "object", "properties": { "shopifyCustomerIdNum": { "type": "object", "properties": { "type": { "type": "string" }, "displayName": { "type": "string" } }, "required": [ "type", "displayName" ] }, "myCustomStr": { "type": "object", "properties": { "modifiedBy": { "type": "string" }, "modifiedAt": { "type": "string" }, "updatedAt": { "type": "string" }, "type": { "type": "string" }, "enumeration": { "type": "array", "items": { "type": "string" } }, "displayName": { "type": "string" }, "sensitive": { "type": "object", "properties": { "enabled": { "type": "boolean" }, "maskType": { "type": "string" } } } }, "required": [ "modifiedBy", "modifiedAt", "updatedAt", "type", "enumeration", "displayName" ] }, "ordersId": { "type": "object", "properties": { "modifiedBy": { "type": "string" }, "modifiedAt": { "type": "string" }, "updatedAt": { "type": "string" }, "type": { "type": "string" }, "target": { "type": "string" }, "multi": { "type": "boolean" }, "displayName": { "type": "string" } }, "required": [ "modifiedBy", "modifiedAt", "updatedAt", "type", "target", "multi", "displayName" ] } }, "required": [ "shopifyCustomerIdNum", "myCustomStr", "ordersId" ] } }, "required": [ "properties" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "metadata", "id": "customer", "attributes": { "properties": { "shopifyCustomerIdNum": { "type": "number", "displayName": "Shopify Customer Id" }, "myCustomStr": { "modifiedBy": "57fd2d309d0ef811009cfdd6", "modifiedAt": "2016-11-08T12:53:21.532Z", "updatedAt": "2016-11-08T12:53:21.532Z", "type": "string", "enumeration": [ "option one", "option two", "option three", "option four" ], "displayName": "My Custom String Enum!" }, "ordersId": { "modifiedBy": "57fd2d309d0ef811009cfdd6", "modifiedAt": "2016-11-08T12:53:21.532Z", "updatedAt": "2016-11-08T12:53:21.532Z", "type": "string", "target": "kobject.order", "multi": true, "displayName": "Orders" } } }, "relationships": { "org": { "links": { "self": "/v1/orgs/57f29863a1dbf61100e6aa92" }, "data": { "type": "org", "id": "57f29863a1dbf61100e6aa92" } } }, "links": { "self": "/v1/metadata/customer" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] }, "parameters": [ { "schema": { "type": "string", "example": "customer" }, "name": "resource", "in": "path", "required": true, "description": "Resource for custom attribute metadata retrieval. Valid values: `company`, `conversation`, `customer`, `message`, and `kobject.*`." } ] }, "/drafts/{id}/attachments": { "post": { "security": [ { "httpBearer": [] } ], "tags": [ "Drafts (Attachments)" ], "summary": "Create draft attachment", "description": "Creates an attachment on a draft.\n\n## Pre-signed URL\n\nWhen you create an attachment, the response will include a **related** URL in the **links** section. You can use this URL to upload the contents of the attachment. This URL is a Pre-Signed URL from S3 and provides access to upload a file for a limited duration.\n\n### Example command to upload an attachment to the related Pre-Signed URL\n\n```bash\n$ curl --upload-file [full path to file] \"[Pre-Signed URL]\"\n```", "operationId": "CreateDraftAttachment", "parameters": [ { "name": "id", "in": "path", "description": "Unique draft ID.", "required": true, "style": "simple", "schema": { "type": "string", "example": "58c766aadd4b90110053bd81" } } ], "requestBody": { "description": "", "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string" }, "contentType": { "type": "string" }, "contentLength": { "type": "number" } }, "required": [ "name", "contentType", "contentLength" ], "additionalProperties": false } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string" }, "attributes": { "type": "object", "properties": { "name": { "type": "string" }, "contentType": { "type": "string" }, "contentLength": { "type": "integer" } }, "required": [ "name", "contentType", "contentLength" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "draft": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "draft" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" }, "related": { "type": "string" } }, "required": [ "self", "related" ] } }, "required": [ "id", "type", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "id": "58c766aadd4b90110053bd81", "type": "attachment", "attributes": { "name": "kustomer-logo.png", "contentType": "image/png", "contentLength": 8911 }, "relationships": { "org": { "links": { "self": "/v1/orgs/570cfbc7c9f5131100c752d9" }, "data": { "type": "org", "id": "570cfbc7c9f5131100c752d9" } }, "draft": { "links": { "self": "/v1/drafts/57323b90b7579a2a004f1316" }, "data": { "type": "draft", "id": "57323b90b7579a2a004f1316" } } }, "links": { "self": "/v1/drafts/57323b90b7579a2a004f1316/attachments/58c766aadd4b90110053bd81", "related": "https://xyz.amazonaws.com/attachments/570cfbc7c9f5131100c752d9/58c766aadd4b90110053bd81-kustomer-logo.png?..." } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] }, "get": { "security": [ { "httpBearer": [] } ], "tags": [ "Drafts (Attachments)" ], "summary": "Get draft attachments", "description": "Retrieves all draft attachments.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.attachment.read|org.permission.attachment.read|", "operationId": "GetDraftAttachments", "parameters": [ { "name": "id", "in": "path", "description": "Unique draft ID.", "required": true, "style": "simple", "schema": { "type": "string", "example": "57323b90b7579a2a004f1316" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "meta": { "type": "object", "properties": { "pageSize": { "type": "integer" }, "page": { "type": "integer" } }, "required": [ "pageSize", "page" ] }, "data": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string" }, "attributes": { "type": "object", "properties": { "name": { "type": "string" }, "contentType": { "type": "string" }, "contentLength": { "type": "integer" } }, "required": [ "name", "contentType", "contentLength" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "draft": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "draft" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "id", "type", "attributes", "relationships", "links" ] } }, "links": { "type": "object", "properties": { "self": { "type": "string" }, "first": { "type": "string" }, "prev": { "type": "string", "nullable": true }, "next": { "type": "string", "nullable": true } }, "required": [ "self", "first", "prev", "next" ] } }, "required": [ "meta", "data", "links" ] }, "example": { "meta": { "pageSize": 100, "page": 1 }, "data": [ { "id": "58c766aadd4b90110053bd81", "type": "attachment", "attributes": { "name": "kustomer-logo.png", "contentType": "image/png", "contentLength": 8911 }, "relationships": { "org": { "links": { "self": "/v1/orgs/570cfbc7c9f5131100c752d9" }, "data": { "type": "org", "id": "570cfbc7c9f5131100c752d9" } }, "draft": { "links": { "self": "/v1/drafts/57323b90b7579a2a004f1316" }, "data": { "type": "draft", "id": "57323b90b7579a2a004f1316" } } }, "links": { "self": "/v1/drafts/57323b90b7579a2a004f1316/attachments/58c766aadd4b90110053bd81" } } ], "links": { "self": "/v1/drafts/57323b90b7579a2a004f1316/attachments?page=1&pageSize=100", "first": "/v1/drafts/57323b90b7579a2a004f1316/attachments?page=1&pageSize=100", "prev": null, "next": null } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] } }, "/drafts/{id}/attachments/{attachmentId}": { "get": { "security": [ { "httpBearer": [] } ], "tags": [ "Drafts (Attachments)" ], "summary": "Get draft attachment", "description": "Retrieves a draft attachment.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.attachment.read|org.permission.attachment.read|\n\n### Pre-signed URL\n\nWhen you request the resource, the response will include a **related** URL in the **links** section. You can use this URL to download the attachment file. This URL is a Pre-Signed URL from S3 and provides access for a limited duration to download a file.", "operationId": "GetDraftAttachment", "parameters": [ { "name": "id", "in": "path", "description": "Unique draft ID.", "required": true, "style": "simple", "schema": { "type": "string", "example": "57323b90b7579a2a004f1316" } }, { "name": "attachmentId", "in": "path", "description": "Unique attachment ID.", "required": true, "style": "simple", "schema": { "type": "string", "example": "58c766aadd4b90110053bd81" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string" }, "attributes": { "type": "object", "properties": { "name": { "type": "string" }, "contentType": { "type": "string" }, "contentLength": { "type": "integer" } }, "required": [ "name", "contentType", "contentLength" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "draft": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "draft" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" }, "related": { "type": "string" } }, "required": [ "self", "related" ] } }, "required": [ "id", "type", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "id": "58c766aadd4b90110053bd81", "type": "attachment", "attributes": { "name": "kustomer-logo.png", "contentType": "image/png", "contentLength": 8911 }, "relationships": { "org": { "links": { "self": "/v1/orgs/570cfbc7c9f5131100c752d9" }, "data": { "type": "org", "id": "570cfbc7c9f5131100c752d9" } }, "draft": { "links": { "self": "/v1/drafts/57323b90b7579a2a004f1316" }, "data": { "type": "draft", "id": "57323b90b7579a2a004f1316" } } }, "links": { "self": "/v1/drafts/57323b90b7579a2a004f1316/attachments/58c766aadd4b90110053bd81", "related": "https://xyz.amazonaws.com/attachments/570cfbc7c9f5131100c752d9/58c766aadd4b90110053bd81-kustomer-logo.png?..." } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] }, "delete": { "security": [ { "httpBearer": [] } ], "tags": [ "Drafts (Attachments)" ], "summary": "Delete draft attachment", "description": "Deletes a draft attachment resource.", "operationId": "DeleteDraftAttachment", "parameters": [ { "name": "id", "in": "path", "description": "Unique draft ID.", "required": true, "style": "simple", "schema": { "type": "string", "example": "57323b90b7579a2a004f1316" } }, { "name": "attachmentId", "in": "path", "description": "Unique attachment ID.", "required": true, "style": "simple", "schema": { "type": "string", "example": "58c766aadd4b90110053bd81" } } ], "responses": { "204": { "description": "No Content", "content": { "text/plain": { "example": "" } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] } }, "/forwards/{id}": { "get": { "security": [ { "httpBearer": [] } ], "tags": [ "Drafts" ], "summary": "Get draft forward by ID", "description": "Retrieves a draft forward based on the unique forward ID.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.draft.read|org.permission.draft.read|", "operationId": "GetaDraftForwardById", "parameters": [ { "name": "id", "in": "path", "description": "Unique draft forward ID.", "required": true, "style": "simple", "schema": { "type": "string", "example": "5823e4d3bff98a100085320e" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string" }, "attributes": { "type": "object", "properties": { "app": { "type": "string" }, "channel": { "type": "string" }, "body": { "type": "string" }, "status": { "type": "string" }, "from": { "type": "object", "properties": { "name": { "type": "string" }, "email": { "type": "string" } }, "required": [ "name", "email" ] }, "to": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "email": { "type": "string" } }, "required": [ "name", "email" ] } }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "modifiedAt": { "type": "string" } }, "required": [ "app", "channel", "body", "status", "from", "to", "createdAt", "updatedAt", "modifiedAt" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "data", "links" ] }, "customer": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "data", "links" ] }, "createdBy": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "data", "links" ] }, "modifiedBy": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "data", "links" ] }, "attachments": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "data", "links" ] } } }, "required": [ "org", "customer", "createdBy", "modifiedBy" ] } }, "required": [ "id", "type", "attributes", "relationships" ] } }, "required": [ "data" ] }, "example": { "data": { "id": "5823e4d3bff98a100085320e", "type": "forward", "attributes": { "app": "postmark", "channel": "email", "body": "A great response", "status": "draft", "from": { "name": "Support", "email": "support@example.com" }, "to": [ { "name": "Billing", "email": "billing@email.com" } ], "createdAt": "2016-11-10T03:09:07.575Z", "updatedAt": "2016-11-10T03:16:55.464Z", "modifiedAt": "2016-11-10T03:16:55.464Z" }, "relationships": { "org": { "data": { "type": "org", "id": "57f29863a1dbf61100e6aa92" }, "links": { "self": "/v1/orgs/57f29863a1dbf61100e6aa92" } }, "customer": { "data": { "type": "customer", "id": "58210c3db0f09110006b7953" }, "links": { "self": "/v1/customers/58210c3db0f09110006b7953" } }, "createdBy": { "data": { "type": "user", "id": "58190b991f2932100010d683" }, "links": { "self": "/v1/users/58190b991f2932100010d683" } }, "modifiedBy": { "data": { "type": "user", "id": "58190b991f2932100010d683" }, "links": { "self": "/v1/users/58190b991f2932100010d683" } }, "attachments": { "data": [ { "type": "attachment", "id": "58c766aadd4b90110053bd81" } ], "links": [ { "self": "/v1/forwards/5823e4d3bff98a100085320e/attachments" } ] } } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] }, "put": { "security": [ { "httpBearer": [] } ], "tags": [ "Drafts" ], "summary": "Update draft forward", "description": "Updates a draft forward.", "operationId": "UpdateDraftForward", "parameters": [ { "name": "id", "in": "path", "description": "Unique draft forward ID.\n", "required": true, "style": "simple", "schema": { "type": "string", "example": "5823e4d3bff98a100085320e" } } ], "requestBody": { "description": "## Request body details\n\n| Name | Detail |\n| ------------- | ------------- |\n| `body` | The message body included with the forwarded conversation. |\n| `from` | The email address sending the forward. |\n| `lang` | Describes the language of the object's contents |\n| `sendAt` | A date in ISO format. Including this property will schedule the forward to be delivered. |\n| `status` | The status of the forward. A draft status indicates the forward is not scheduled for delivery and still editable. A scheduled status indicates the forward is scheduled for delivery by an email app (postmark or gmail). A draft will be update to a failed or sent status after a delivery attempt. |\n| `subject` | The subject of the forwarded conversation. |\n| `template` | The ID of a template that should be used for the forward. |\n| `to` | The destination email address of the forward. This an array that can accept more than one email recipient. |\n| `attachments` | The attachments to be sent along the forward. They must exist in S3\n\n### `sendAt` property options\n* If you update the `sendAt` property to a valid timestamp, the forward will be scheduled to be sent and updated to a \"scheduled\" status.\n* If you ommit the `sendAt` property, the draft status will remain unchanged.", "content": { "application/json": { "schema": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "draft", "sent", "failed" ] }, "sendAt": { "type": "string", "format": "date-time-math", "description": "A timestamp for a future date/time the drafted message to be sent at." }, "lang": { "type": "string", "maxLength": 100, "nullable": true }, "to": { "type": "array", "items": { "type": "object", "properties": { "email": { "type": "string", "format": "email-relaxed", "minLength": 3, "maxLength": 256 }, "name": { "type": "string", "minLength": 1 } }, "required": [ "email" ], "additionalProperties": false } }, "from": { "type": "object", "properties": { "email": { "type": "string", "format": "email-relaxed", "minLength": 3, "maxLength": 256 }, "name": { "type": "string", "minLength": 1 } }, "required": [ "email" ], "additionalProperties": false }, "body": { "type": "string", "maxLength": 10240 }, "subject": { "type": "string", "minLength": 1 }, "replyTo": { "type": "string", "format": "email-relaxed", "minLength": 3, "maxLength": 256 }, "template": { "type": "string", "format": "object-id", "nullable": true }, "payload": { "type": "object" }, "attachments": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "format": "object-id" }, "name": { "type": "string" }, "contentType": { "type": "string" }, "contentLength": { "type": "number" } }, "required": [ "id", "name", "contentType", "contentLength" ] } } }, "additionalProperties": false } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string" }, "attributes": { "type": "object", "properties": { "app": { "type": "string" }, "channel": { "type": "string" }, "body": { "type": "string" }, "status": { "type": "string" }, "from": { "type": "object", "properties": { "name": { "type": "string" }, "email": { "type": "string" } }, "required": [ "name", "email" ] }, "to": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "email": { "type": "string" } }, "required": [ "name", "email" ] } }, "sendAt": { "type": "string", "description": "A timestamp for a future date/time the drafted message to be sent at." }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "modifiedAt": { "type": "string" } }, "required": [ "app", "channel", "body", "status", "from", "to", "sendAt", "createdAt", "updatedAt", "modifiedAt" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "data", "links" ] }, "customer": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "data", "links" ] }, "createdBy": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "data", "links" ] }, "modifiedBy": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "data", "links" ] }, "attachments": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "data", "links" ] } } }, "required": [ "org", "customer", "createdBy", "modifiedBy" ] } }, "required": [ "id", "type", "attributes", "relationships" ] } }, "required": [ "data" ] }, "example": { "data": { "id": "5823e4d3bff98a100085320e", "type": "forward", "attributes": { "app": "gmail", "channel": "email", "body": "A great response", "status": "scheduled", "from": { "name": "Support", "email": "support@example.com" }, "to": [ { "name": "Billing", "email": "billing@email.com" } ], "sendAt": "2019-11-10T03:09:07.575Z", "createdAt": "2016-11-10T03:09:07.575Z", "updatedAt": "2016-11-10T03:16:55.464Z", "modifiedAt": "2016-11-10T03:16:55.464Z" }, "relationships": { "org": { "data": { "type": "org", "id": "57f29863a1dbf61100e6aa92" }, "links": { "self": "/v1/orgs/57f29863a1dbf61100e6aa92" } }, "customer": { "data": { "type": "customer", "id": "58210c3db0f09110006b7953" }, "links": { "self": "/v1/customers/58210c3db0f09110006b7953" } }, "createdBy": { "data": { "type": "user", "id": "58190b991f2932100010d683" }, "links": { "self": "/v1/users/58190b991f2932100010d683" } }, "modifiedBy": { "data": { "type": "user", "id": "58190b991f2932100010d683" }, "links": { "self": "/v1/users/58190b991f2932100010d683" } }, "attachments": { "data": [ { "type": "attachment", "id": "58c766aadd4b90110053bd81" } ], "links": [ { "self": "/v1/forwards/5823e4d3bff98a100085320e/attachments" } ] } } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] } }, "/forwards/{id}/attachments": { "post": { "security": [ { "httpBearer": [] } ], "tags": [ "Forwards (Attachments)" ], "summary": "Create forward attachment", "description": "Creates an attachment on a forward.\n\n## Pre-signed URL\n\nWhen you create an attachment, the response will include a **related** URL in the **links** section. You ca use this URL to upload the contents of the attachment. This URL is a Pre-Signed URL from S3 and provides access to upload a file for a limited duration.\n\n### Example command to upload an attachment to the related Pre-Signed URL\n\n```bash\n$ curl --upload-file [full path to file] \"[Pre-Signed URL]\"\n```", "operationId": "CreateForwardAttachment", "parameters": [ { "name": "id", "in": "path", "description": "Unique forward ID.", "required": true, "style": "simple", "schema": { "type": "string", "example": "57323b90b7579a2a004f1316" } } ], "requestBody": { "description": "", "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string" }, "contentType": { "type": "string" }, "contentLength": { "type": "number" } }, "required": [ "name", "contentType", "contentLength" ], "additionalProperties": false } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string" }, "attributes": { "type": "object", "properties": { "name": { "type": "string" }, "contentType": { "type": "string" }, "contentLength": { "type": "integer" } }, "required": [ "name", "contentType", "contentLength" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "forward": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "forward" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" }, "related": { "type": "string" } }, "required": [ "self", "related" ] } }, "required": [ "id", "type", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "id": "58c766aadd4b90110053bd81", "type": "attachment", "attributes": { "name": "kustomer-logo.png", "contentType": "image/png", "contentLength": 8911 }, "relationships": { "org": { "links": { "self": "/v1/orgs/570cfbc7c9f5131100c752d9" }, "data": { "type": "org", "id": "570cfbc7c9f5131100c752d9" } }, "forward": { "links": { "self": "/v1/forwards/57323b90b7579a2a004f1316" }, "data": { "type": "forward", "id": "57323b90b7579a2a004f1316" } } }, "links": { "self": "/v1/forwards/57323b90b7579a2a004f1316/attachments/58c766aadd4b90110053bd81", "related": "https://xyz.amazonaws.com/attachments/570cfbc7c9f5131100c752d9/58c766aadd4b90110053bd81-kustomer-logo.png?..." } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] }, "get": { "security": [ { "httpBearer": [] } ], "tags": [ "Forwards (Attachments)" ], "summary": "Get forward attachments", "description": "Retrieves all forward attachments.", "operationId": "GetForwardAttachments", "parameters": [ { "name": "id", "in": "path", "description": "Unique forward ID.", "required": true, "style": "simple", "schema": { "type": "string", "example": "57323b90b7579a2a004f1316" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "meta": { "type": "object", "properties": { "pageSize": { "type": "integer" }, "page": { "type": "integer" } }, "required": [ "pageSize", "page" ] }, "data": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string" }, "attributes": { "type": "object", "properties": { "name": { "type": "string" }, "contentType": { "type": "string" }, "contentLength": { "type": "integer" } }, "required": [ "name", "contentType", "contentLength" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "forward": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "forward" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "id", "type", "attributes", "relationships", "links" ] } }, "links": { "type": "object", "properties": { "self": { "type": "string" }, "first": { "type": "string" }, "prev": { "type": "string", "nullable": true }, "next": { "type": "string", "nullable": true } }, "required": [ "self", "first", "prev", "next" ] } }, "required": [ "meta", "data", "links" ] }, "example": { "meta": { "pageSize": 100, "page": 1 }, "data": [ { "id": "58c766aadd4b90110053bd81", "type": "attachment", "attributes": { "name": "kustomer-logo.png", "contentType": "image/png", "contentLength": 8911 }, "relationships": { "org": { "links": { "self": "/v1/orgs/570cfbc7c9f5131100c752d9" }, "data": { "type": "org", "id": "570cfbc7c9f5131100c752d9" } }, "forward": { "links": { "self": "/v1/forwards/57323b90b7579a2a004f1316" }, "data": { "type": "forward", "id": "57323b90b7579a2a004f1316" } } }, "links": { "self": "/v1/forwards/57323b90b7579a2a004f1316/attachments/58c766aadd4b90110053bd81" } } ], "links": { "self": "/v1/forwards/57323b90b7579a2a004f1316/attachments?page=1&pageSize=100", "first": "/v1/forwards/57323b90b7579a2a004f1316/attachments?page=1&pageSize=100", "prev": null, "next": null } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] } }, "/forwards/{id}/attachments/{attachmentId}": { "get": { "security": [ { "httpBearer": [] } ], "tags": [ "Forwards (Attachments)" ], "summary": "Get forward attachment", "description": "Retrieves a forward attachment.\n\n### Pre-signed URL\n\nWhen you request the resource, the response will include a **related** URL in the **links** section. You can use this URL to download the attachment file. This URL is a Pre-Signed URL from S3 and provides access for a limited duration to download a file.", "operationId": "GetForwardAttachment", "parameters": [ { "name": "id", "in": "path", "description": "Unique forward ID.", "required": true, "style": "simple", "schema": { "type": "string", "example": "57323b90b7579a2a004f1316" } }, { "name": "attachmentId", "in": "path", "description": "Unique attachment ID.", "required": true, "style": "simple", "schema": { "type": "string", "example": "58c766aadd4b90110053bd81" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string" }, "attributes": { "type": "object", "properties": { "name": { "type": "string" }, "contentType": { "type": "string" }, "contentLength": { "type": "integer" } }, "required": [ "name", "contentType", "contentLength" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "forward": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "forward" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" }, "related": { "type": "string" } }, "required": [ "self", "related" ] } }, "required": [ "id", "type", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "id": "58c766aadd4b90110053bd81", "type": "attachment", "attributes": { "name": "kustomer-logo.png", "contentType": "image/png", "contentLength": 8911 }, "relationships": { "org": { "links": { "self": "/v1/orgs/570cfbc7c9f5131100c752d9" }, "data": { "type": "org", "id": "570cfbc7c9f5131100c752d9" } }, "forward": { "links": { "self": "/v1/forwards/57323b90b7579a2a004f1316" }, "data": { "type": "forward", "id": "57323b90b7579a2a004f1316" } } }, "links": { "self": "/v1/forwards/57323b90b7579a2a004f1316/attachments/58c766aadd4b90110053bd81", "related": "https://xyz.amazonaws.com/attachments/570cfbc7c9f5131100c752d9/58c766aadd4b90110053bd81-kustomer-logo.png?..." } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] }, "delete": { "security": [ { "httpBearer": [] } ], "tags": [ "Forwards (Attachments)" ], "summary": "Delete Forward Attachment", "description": "Deletes a forward attachment resource.", "operationId": "DeleteForwardAttachment", "parameters": [ { "name": "id", "in": "path", "description": "Unique attachment ID.", "required": true, "style": "simple", "schema": { "type": "string", "example": "57323b90b7579a2a004f1316" } }, { "name": "attachmentId", "in": "path", "description": "Unique attachment ID.", "required": true, "style": "simple", "schema": { "type": "string", "example": "58c766aadd4b90110053bd81" } } ], "responses": { "204": { "description": "No Content", "content": { "text/plain": { "example": "" } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] } }, "/outboundAccounts": { "get": { "security": [ { "httpBearer": [] } ], "tags": [ "Drafts" ], "summary": "Get outbound accounts", "description": "Retrieves all outbound accounts.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.apps.read|org.permission.apps.read|", "operationId": "GetOutboundAccounts", "parameters": [ { "name": "pageSize", "in": "query", "required": false, "schema": { "type": "number", "default": 100, "example": 100 }, "description": "Number of results to return per page. Default value: 100." }, { "name": "page", "in": "query", "schema": { "type": "number", "default": 1, "example": 1 }, "description": "Number of pages to return for results. Default value: 1." } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "meta": { "type": "object" }, "data": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string" }, "attributes": { "type": "object", "properties": { "channel": { "type": "string" }, "name": { "type": "string" }, "account": { "type": "string" } }, "required": [ "channel", "name", "account" ] } }, "required": [ "type", "attributes" ] } }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "meta", "data", "links" ] }, "example": { "meta": {}, "data": [ { "type": "outbound_account", "attributes": { "channel": "email", "name": "kusty-swag support", "account": "support@..." } }, { "type": "outbound_account", "attributes": { "channel": "email", "name": "Party", "account": "party@..." } }, { "type": "outbound_account", "attributes": { "channel": "sms", "name": "(800) 555-1212", "account": "+18005551212" } } ], "links": { "self": "/v1/outboundAccounts" } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] } }, "/drafts/{id}": { "put": { "security": [ { "httpBearer": [] } ], "tags": [ "Drafts" ], "summary": "Update draft", "description": "Updates a draft.\n\nYou can use this endpoint to update any available properties for a channel.\n\n## `sendAt` property options\n\n* If the `sendAt` property is set to a valid timestamp, the draft will be scheduled to be sent.\n* If the `sendAt` property is empty, the draft will be unscheduled.\n* If the `sendAt` property is omitted, the draft status won't change.", "operationId": "UpdateDraft", "requestBody": { "description": "", "content": { "application/json": { "schema": { "oneOf": [ { "type": "object", "properties": { "channel": { "type": "string", "enum": [ "email" ] }, "conversation": { "type": "string", "format": "object-id" }, "app": { "type": "string", "enum": [ "gmail", "postmark" ] }, "customer": { "type": "string", "format": "object-id" }, "auto": { "type": "boolean" }, "scheduled": { "type": "boolean" }, "sendAt": { "type": "string", "format": "date-time-math", "nullable": true }, "source": { "type": "string", "enum": [ "bulk", "satisfaction", "biz-rules" ] }, "lang": { "type": "string", "maxLength": 100, "nullable": true }, "shortcuts": { "type": "array", "items": { "type": "string", "format": "object-id" } }, "kbArticles": { "type": "array", "items": { "type": "string", "format": "object-id" } }, "to": { "oneOf": [ { "type": "array", "items": { "type": "object", "properties": { "email": { "type": "string", "format": "email-relaxed", "minLength": 3, "maxLength": 256 }, "name": { "type": "string", "minLength": 1 } }, "required": [ "email" ], "additionalProperties": false } }, { "type": "object", "properties": { "email": { "type": "string", "format": "email-relaxed", "minLength": 3, "maxLength": 256 }, "name": { "type": "string", "minLength": 1 } }, "required": [ "email" ], "additionalProperties": false } ] }, "from": { "type": "object", "properties": { "email": { "type": "string", "format": "email-relaxed", "minLength": 3, "maxLength": 256 }, "name": { "type": "string", "minLength": 1 } }, "required": [ "email" ], "additionalProperties": false }, "body": { "type": "string", "maxLength": 10240 }, "htmlBody": { "type": "string", "maxLength": 10240 }, "cc": { "type": "array", "items": { "type": "object", "properties": { "email": { "type": "string", "format": "email-relaxed", "minLength": 3, "maxLength": 256 }, "name": { "type": "string", "minLength": 1 } }, "required": [ "email" ], "additionalProperties": false } }, "bcc": { "type": "array", "items": { "type": "object", "properties": { "email": { "type": "string", "format": "email-relaxed", "minLength": 3, "maxLength": 256 }, "name": { "type": "string", "minLength": 1 } }, "required": [ "email" ], "additionalProperties": false } }, "subject": { "type": "string", "minLength": 1 }, "replyTo": { "type": "string", "format": "email-relaxed", "minLength": 3, "maxLength": 256 }, "headers": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1 }, "value": { "type": "string", "minLength": 1 } }, "required": [ "name" ], "additionalProperties": false } }, "templateType": { "type": "string", "enum": [ "email-reply", "email-autoresponse", "email-satisfaction" ], "nullable": true }, "template": { "type": "string", "format": "object-id", "nullable": true }, "payload": { "type": "object" } }, "required": [ "channel" ], "additionalProperties": false }, { "type": "object", "properties": { "channel": { "type": "string", "enum": [ "sms" ] }, "app": { "type": "string", "enum": [ "twilio", "zipwhip", "messagebird" ] }, "conversation": { "type": "string", "format": "object-id" }, "customer": { "type": "string", "format": "object-id" }, "auto": { "type": "boolean" }, "scheduled": { "type": "boolean" }, "sendAt": { "type": "string", "format": "date-time-math", "nullable": true }, "source": { "type": "string", "enum": [ "bulk", "satisfaction", "biz-rules" ] }, "lang": { "type": "string", "maxLength": 100, "nullable": true }, "shortcuts": { "type": "array", "items": { "type": "string", "format": "object-id" } }, "kbArticles": { "type": "array", "items": { "type": "string", "format": "object-id" } }, "to": { "type": "string", "format": "phone-number" }, "from": { "type": "string", "maxLength": 32 }, "body": { "type": "string", "maxLength": 1600 }, "payload": { "type": "object" } }, "required": [ "channel" ], "additionalProperties": false }, { "type": "object", "properties": { "channel": { "type": "string", "enum": [ "whatsapp" ] }, "app": { "type": "string", "enum": [ "twilio_whatsapp", "messagebird", "whatsapp" ] }, "conversation": { "type": "string", "format": "object-id" }, "customer": { "type": "string", "format": "object-id" }, "auto": { "type": "boolean" }, "scheduled": { "type": "boolean" }, "sendAt": { "type": "string", "format": "date-time-math", "nullable": true }, "source": { "type": "string", "enum": [ "bulk", "satisfaction", "biz-rules" ] }, "lang": { "type": "string", "maxLength": 100, "nullable": true }, "shortcuts": { "type": "array", "items": { "type": "string", "format": "object-id" } }, "kbArticles": { "type": "array", "items": { "type": "string", "format": "object-id" } }, "to": { "type": "string", "format": "whatsapp-number" }, "from": { "type": "string", "format": "whatsapp-number" }, "body": { "type": "string", "maxLength": 1600 }, "payload": { "type": "object" } }, "required": [ "channel", "app" ], "additionalProperties": false }, { "type": "object", "properties": { "channel": { "type": "string", "enum": [ "chat" ] }, "app": { "type": "string", "enum": [ "chat", "smooch" ] }, "conversation": { "type": "string", "format": "object-id" }, "customer": { "type": "string", "format": "object-id" }, "auto": { "type": "boolean" }, "scheduled": { "type": "boolean" }, "sendAt": { "type": "string", "format": "date-time-math", "nullable": true }, "source": { "type": "string", "enum": [ "bulk", "satisfaction", "biz-rules" ] }, "lang": { "type": "string", "maxLength": 100, "nullable": true }, "shortcuts": { "type": "array", "items": { "type": "string", "format": "object-id" } }, "kbArticles": { "type": "array", "items": { "type": "string", "format": "object-id" } }, "to": { "type": "string" }, "from": { "type": "string" }, "body": { "type": "string", "maxLength": 1024 }, "payload": { "type": "object" }, "responseButtons": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string", "minLength": 1, "maxLength": 256 }, "value": { "type": "string", "minLength": 1 } }, "required": [ "label", "value" ], "additionalProperties": false } }, "messageTemplate": { "oneOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "templateType": { "type": "string", "enum": [ "text" ] }, "body": { "type": "string", "minLength": 1 } }, "required": [ "templateType", "body" ], "additionalProperties": false }, { "type": "object", "properties": { "id": { "type": "string" }, "templateType": { "type": "string", "enum": [ "quick_replies" ] }, "body": { "type": "string" }, "actions": { "type": "array", "items": { "type": "object", "properties": { "displayText": { "type": "string" }, "valueType": { "type": "string", "enum": [ "url", "text" ] }, "value": { "type": "string" } }, "required": [ "displayText", "valueType", "value" ], "additionalProperties": false } } }, "required": [ "templateType", "actions" ], "additionalProperties": false }, { "type": "object", "properties": { "id": { "type": "string" }, "templateType": { "type": "string", "enum": [ "deflection" ] }, "body": { "type": "string" }, "actions": { "type": "array", "items": { "type": "object", "properties": { "displayText": { "type": "string" }, "valueType": { "type": "string", "enum": [ "url", "text" ] }, "value": { "type": "string" } }, "required": [ "displayText", "valueType", "value" ], "additionalProperties": false } }, "articles": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "format": "object-id" }, "type": { "type": "string" }, "attributes": { "type": "object" } }, "required": [ "id" ], "additionalProperties": false } }, "followupText": { "type": "string" } }, "required": [ "templateType", "actions", "articles" ], "additionalProperties": false }, { "type": "object", "properties": { "id": { "type": "string" }, "templateType": { "type": "string", "enum": [ "mll" ] }, "body": { "type": "string" }, "actions": { "type": "object", "properties": { "tree": { "type": "object" } }, "required": [ "tree" ], "additionalProperties": false } }, "required": [ "templateType", "actions" ], "additionalProperties": false } ] }, "attachments": { "type": "array", "items": { "type": "string", "format": "object-id" } } }, "required": [ "channel" ], "additionalProperties": false }, { "type": "object", "properties": { "channel": { "type": "string", "enum": [ "facebook" ] }, "conversation": { "type": "string", "format": "object-id" }, "customer": { "type": "string", "format": "object-id" }, "auto": { "type": "boolean" }, "scheduled": { "type": "boolean" }, "sendAt": { "type": "string", "format": "date-time-math", "nullable": true }, "source": { "type": "string", "enum": [ "bulk", "satisfaction", "biz-rules" ] }, "lang": { "type": "string", "maxLength": 100, "nullable": true }, "shortcuts": { "type": "array", "items": { "type": "string", "format": "object-id" } }, "kbArticles": { "type": "array", "items": { "type": "string", "format": "object-id" } }, "to": { "type": "string" }, "from": { "type": "string" }, "body": { "type": "string", "maxLength": 2000 }, "payload": { "type": "object" } }, "required": [ "channel" ], "additionalProperties": false }, { "type": "object", "properties": { "channel": { "type": "string", "enum": [ "twitter-tweet" ] }, "conversation": { "type": "string", "format": "object-id" }, "customer": { "type": "string", "format": "object-id" }, "auto": { "type": "boolean" }, "scheduled": { "type": "boolean" }, "sendAt": { "type": "string", "format": "send-at" }, "source": { "type": "string", "enum": [ "bulk", "satisfaction", "biz-rules" ] }, "lang": { "type": "string", "maxLength": 100, "nullable": true }, "shortcuts": { "type": "array", "items": { "type": "string", "format": "object-id" } }, "kbArticles": { "type": "array", "items": { "type": "string", "format": "object-id" } }, "to": { "type": "string" }, "from": { "type": "string" }, "body": { "type": "string", "maxLength": 280 }, "payload": { "type": "object" } }, "required": [ "channel" ], "additionalProperties": false }, { "type": "object", "properties": { "channel": { "type": "string", "enum": [ "twitter-dm" ] }, "conversation": { "type": "string", "format": "object-id" }, "customer": { "type": "string", "format": "object-id" }, "auto": { "type": "boolean" }, "scheduled": { "type": "boolean" }, "sendAt": { "type": "string", "format": "send-at" }, "source": { "type": "string", "enum": [ "bulk", "satisfaction", "biz-rules" ] }, "lang": { "type": "string", "maxLength": 100, "nullable": true }, "shortcuts": { "type": "array", "items": { "type": "string", "format": "object-id" } }, "kbArticles": { "type": "array", "items": { "type": "string", "format": "object-id" } }, "to": { "type": "string" }, "from": { "type": "string" }, "body": { "type": "string", "maxLength": 10000 }, "payload": { "type": "object" } }, "required": [ "channel" ], "additionalProperties": false }, { "type": "object", "properties": { "channel": { "type": "string", "enum": [ "note" ] }, "conversation": { "type": "string", "format": "object-id" }, "customer": { "type": "string", "format": "object-id" }, "scheduled": { "type": "boolean" }, "sendAt": { "type": "string", "format": "date-time-math", "nullable": true }, "source": { "type": "string", "enum": [ "bulk", "biz-rules" ] }, "lang": { "type": "string", "maxLength": 100, "nullable": true }, "shortcuts": { "type": "array", "items": { "type": "string", "format": "object-id" } }, "kbArticles": { "type": "array", "items": { "type": "string", "format": "object-id" } }, "body": { "type": "string", "maxLength": 10240 }, "payload": { "type": "object" }, "userMentions": { "type": "array", "maxItems": 20, "items": { "type": "object", "properties": { "user": { "type": "string" }, "team": { "type": "string" } } } } }, "required": [ "channel" ], "additionalProperties": false }, { "type": "object", "properties": { "channel": { "type": "string", "enum": [ "instagram" ] }, "conversation": { "type": "string", "format": "object-id" }, "customer": { "type": "string", "format": "object-id" }, "auto": { "type": "boolean" }, "scheduled": { "type": "boolean" }, "sendAt": { "type": "string", "format": "date-time-math", "nullable": true }, "source": { "type": "string", "enum": [ "bulk", "satisfaction", "biz-rules" ] }, "lang": { "type": "string", "maxLength": 100, "nullable": true }, "shortcuts": { "type": "array", "items": { "type": "string", "format": "object-id" } }, "kbArticles": { "type": "array", "items": { "type": "string", "format": "object-id" } }, "to": { "type": "string" }, "from": { "type": "string" }, "body": { "type": "string", "maxLength": 1000 }, "payload": { "type": "object" } }, "required": [ "channel" ], "additionalProperties": false } ] } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string" }, "attributes": { "type": "object", "properties": { "channel": { "type": "string" }, "body": { "type": "string" }, "status": { "type": "string" }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "modifiedAt": { "type": "string" } }, "required": [ "channel", "body", "status", "createdAt", "updatedAt", "modifiedAt" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "data", "links" ] }, "customer": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "data", "links" ] }, "createdBy": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "data", "links" ] }, "modifiedBy": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "data", "links" ] } }, "required": [ "org", "customer", "createdBy", "modifiedBy" ] } }, "required": [ "id", "type", "attributes", "relationships" ] } }, "required": [ "data" ] }, "example": { "data": { "id": "5823e4d3bff98a100085320e", "type": "draft", "attributes": { "channel": "email", "body": "A great response", "status": "draft", "createdAt": "2016-11-10T03:09:07.575Z", "updatedAt": "2016-11-10T03:16:55.464Z", "modifiedAt": "2016-11-10T03:16:55.464Z" }, "relationships": { "org": { "data": { "type": "org", "id": "57f29863a1dbf61100e6aa92" }, "links": { "self": "/v1/orgs/57f29863a1dbf61100e6aa92" } }, "customer": { "data": { "type": "customer", "id": "58210c3db0f09110006b7953" }, "links": { "self": "/v1/customers/58210c3db0f09110006b7953" } }, "createdBy": { "data": { "type": "user", "id": "58190b991f2932100010d683" }, "links": { "self": "/v1/users/58190b991f2932100010d683" } }, "modifiedBy": { "data": { "type": "user", "id": "58190b991f2932100010d683" }, "links": { "self": "/v1/users/58190b991f2932100010d683" } } } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] }, "delete": { "security": [ { "httpBearer": [] } ], "tags": [ "Drafts" ], "summary": "Delete draft", "description": "Deletes a draft.", "operationId": "DeleteDraft", "responses": { "204": { "description": "No Content", "content": { "text/plain": { "example": "" } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] }, "parameters": [ { "schema": { "type": "string", "example": "5823e4d3bff98a100085320e" }, "name": "id", "in": "path", "required": true, "description": "Unique draft ID." } ] }, "/klasses/{name}/bulk": { "post": { "security": [ { "httpBearer": [] } ], "tags": [ "KObjects (Custom Objects) (Bulk)" ], "summary": "Bulk create KObjects (custom objects)", "description": "Creates KObjects (custom objects) in bulk.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.kobject.write|org.permission.kobject.create|\n||org.permission.kobject.kobject_*.create|", "operationId": "BulkCreateKObjects", "parameters": [ { "name": "name", "in": "path", "description": "Klass name of KObjects (custom objects).", "required": true, "style": "simple", "schema": { "type": "string", "example": "orders" } } ], "requestBody": { "description": "", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "properties": { "customer": { "type": "string" }, "company": { "type": "string" }, "externalId": { "type": "string", "minLength": 1, "maxLength": 256 }, "title": { "type": "string", "minLength": 1, "maxLength": 256 }, "description": { "type": "string", "maxLength": 10240 }, "images": { "type": "array", "items": { "type": "string", "format": "url" }, "maxItems": 20, "uniqueItems": true }, "icon": { "type": "string", "maxLength": 64 }, "data": { "type": "object" }, "custom": { "type": "object", "maxProperties": 100, "additionalProperties": false }, "tags": { "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 64, "pattern": "^[0-9a-zA-ZÀ-ÿ_/<>\\-.]{1}[0-9a-zA-ZÀ-ÿ _/<>\\-.]{0,63}$" }, "maxItems": 20, "uniqueItems": true }, "createdAt": { "type": "string", "format": "date-time" }, "importedAt": { "type": "string", "format": "date-time" } }, "required": [ "title" ], "additionalProperties": false }, "maxItems": 100 } } } }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "ids": { "type": "array" }, "context": { "type": "string" }, "status": { "type": "string" }, "v2": { "type": "boolean" }, "payload": { "type": "object", "properties": { "api": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "title": { "type": "string" }, "customer": { "type": "string" }, "externalId": { "type": "string" }, "description": { "type": "string" } }, "required": [ "title", "customer", "externalId", "description" ] } }, "path": { "type": "string" }, "user": { "type": "object", "properties": { "id": { "type": "string" }, "userType": { "type": "string" }, "roles": { "type": "array", "items": { "type": "string" } }, "orgName": { "type": "string" }, "subject": { "type": "string" }, "org": { "type": "string" } }, "required": [ "id", "userType", "roles", "orgName", "subject", "org" ] }, "requestId": { "type": "string" }, "service": { "type": "string" }, "method": { "type": "string" } }, "required": [ "data", "path", "user", "requestId", "service", "method" ] } }, "required": [ "api" ] }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "completed": { "type": "boolean" } }, "required": [ "ids", "context", "status", "v2", "payload", "createdAt", "updatedAt", "completed" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "createdBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "createdBy" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "bulk", "id": "5b3bddb67f8469003df370a4", "attributes": { "ids": [], "context": "api.sobjects.kobjects.bulk-create", "status": "complete", "v2": true, "payload": { "api": { "data": [ { "title": "Order 1", "customer": "5a96dac46dd73800112fab20", "externalId": "my-order-id-order-1", "description": "Cool products for order 1" }, { "title": "Order 2", "customer": "5a96dac46dd73800112fab20", "externalId": "my-order-id-order-2", "description": "Cool products for order 2" } ], "path": "/v1/companies", "user": { "id": "5a96dac46dd73800112fab30", "userType": "user", "roles": [ "org" ], "orgName": "mycompany", "subject": "5a96dac46dd73800112fab30", "org": "5a96dac36dd73800112fab2e" }, "requestId": "5b3bddb6b6e494001779fa38", "service": "sobjects", "method": "POST" } }, "createdAt": "2018-07-03T20:33:58.486Z", "updatedAt": "2018-07-03T20:34:03.873Z", "completed": true }, "relationships": { "org": { "links": { "self": "/v1/orgs/5a96dac36dd73800112fab2e" }, "data": { "type": "org", "id": "5a96dac36dd73800112fab2e" } }, "createdBy": { "links": { "self": "/v1/users/5a96dac46dd73800112fab30" }, "data": { "type": "user", "id": "5a96dac46dd73800112fab30" } } }, "links": { "self": "/v1/bulk/5b3bddb67f8469003df370a4" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] }, "put": { "security": [ { "httpBearer": [] } ], "tags": [ "KObjects (Custom Objects) (Bulk)" ], "summary": "Bulk batch update KObjects (custom objects)", "description": "Updates a bulk batch of multiple KObjects (custom objects).\n\nUse the `ids` query param to update multiple KObjects in bulk with the same data.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.kobject.write|org.permission.kobject.update|\n||org.permission.kobject.kobject_*.update|", "operationId": "BulkBatchUpdateKObjects", "parameters": [ { "name": "name", "in": "path", "description": "Klass name of KObjects (custom objects).", "required": true, "style": "simple", "schema": { "type": "string", "example": "orders" } }, { "schema": { "type": "string", "example": "id1,id2" }, "in": "query", "description": "Comma-separated list of unique KObject IDs.", "name": "ids" } ], "requestBody": { "description": "", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "externalId": { "type": "string", "minLength": 1, "maxLength": 256 }, "title": { "type": "string", "maxLength": 256 }, "description": { "type": "string", "maxLength": 10240 }, "images": { "type": "array", "items": { "type": "string", "format": "url" }, "maxItems": 20, "uniqueItems": true }, "icon": { "type": "string", "maxLength": 64 }, "data": { "type": "object" }, "custom": { "type": "object", "maxProperties": 100, "additionalProperties": false }, "tags": { "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 64, "pattern": "^[0-9a-zA-ZÀ-ÿ_/<>\\-.]{1}[0-9a-zA-ZÀ-ÿ _/<>\\-.]{0,63}$" }, "maxItems": 20, "uniqueItems": true }, "createdAt": { "type": "string", "format": "date-time" }, "importedAt": { "type": "string", "format": "date-time" }, "rev": { "type": "number" } }, "required": [ "id" ] }, "maxItems": 100 } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "ids": { "type": "array" }, "context": { "type": "string" }, "status": { "type": "string" }, "v2": { "type": "boolean" }, "payload": { "type": "object", "properties": { "api": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "custom": { "type": "object", "properties": { "shippingStatusStr": { "type": "string" } }, "required": [ "shippingStatusStr" ] } }, "required": [ "id", "custom" ] } }, "path": { "type": "string" }, "user": { "type": "object", "properties": { "id": { "type": "string" }, "userType": { "type": "string" }, "roles": { "type": "array", "items": { "type": "string" } }, "orgName": { "type": "string" }, "subject": { "type": "string" }, "org": { "type": "string" } }, "required": [ "id", "userType", "roles", "orgName", "subject", "org" ] }, "requestId": { "type": "string" }, "service": { "type": "string" }, "method": { "type": "string" } }, "required": [ "data", "path", "user", "requestId", "service", "method" ] } }, "required": [ "api" ] }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "completed": { "type": "boolean" } }, "required": [ "ids", "context", "status", "v2", "payload", "createdAt", "updatedAt", "completed" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "createdBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "createdBy" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "bulk", "id": "5b3bddb67f8469003df370a4", "attributes": { "ids": [], "context": "api.sobjects.kobjects.bulk-create", "status": "complete", "v2": true, "payload": { "api": { "data": [ { "id": "5a96dac46dd73800112faa20", "custom": { "shippingStatusStr": "shipped" } }, { "id": "5a96dac46dd73800112faa21", "custom": { "shippingStatusStr": "shipped" } } ], "path": "/v1/klasses/orders", "user": { "id": "5a96dac46dd73800112fab30", "userType": "user", "roles": [ "org" ], "orgName": "mycompany", "subject": "5a96dac46dd73800112fab30", "org": "5a96dac36dd73800112fab2e" }, "requestId": "5b3bddb6b6e494001779fa38", "service": "sobjects", "method": "POST" } }, "createdAt": "2018-07-03T20:33:58.486Z", "updatedAt": "2018-07-03T20:34:03.873Z", "completed": true }, "relationships": { "org": { "links": { "self": "/v1/orgs/5a96dac36dd73800112fab2e" }, "data": { "type": "org", "id": "5a96dac36dd73800112fab2e" } }, "createdBy": { "links": { "self": "/v1/users/5a96dac46dd73800112fab30" }, "data": { "type": "user", "id": "5a96dac46dd73800112fab30" } } }, "links": { "self": "/v1/bulk/5b3bddb67f8469003df370a4" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] }, "delete": { "security": [ { "httpBearer": [] } ], "tags": [ "KObjects (Custom Objects) (Bulk)" ], "summary": "Bulk delete KObjects (custom objects)", "description": "Deletes multiple KObjects in bulk.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.kobject.delete|org.permission.kobject.delete|\n||org.permission.kobject.kobject_*.delete|", "operationId": "BulkDeleteKObjects", "parameters": [ { "name": "name", "in": "path", "description": "Klass name of KObjects (custom objects).", "required": true, "style": "simple", "schema": { "type": "string", "example": "orders" } }, { "schema": { "type": "string", "example": "id1,id2" }, "in": "query", "name": "ids", "description": "Comma-separated list of unique KObject IDs.", "required": true } ], "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "ids": { "type": "array", "items": { "type": "string" } }, "context": { "type": "string" }, "status": { "type": "string" }, "v2": { "type": "boolean" }, "payload": { "type": "object", "properties": { "api": { "type": "object", "properties": { "data": { "type": "object" }, "path": { "type": "string" }, "user": { "type": "object", "properties": { "id": { "type": "string" }, "userType": { "type": "string" }, "roles": { "type": "array", "items": { "type": "string" } }, "orgName": { "type": "string" }, "subject": { "type": "string" }, "org": { "type": "string" } }, "required": [ "id", "userType", "roles", "orgName", "subject", "org" ] }, "requestId": { "type": "string" }, "service": { "type": "string" }, "method": { "type": "string" } }, "required": [ "data", "path", "user", "requestId", "service", "method" ] } }, "required": [ "api" ] }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "completed": { "type": "boolean" } }, "required": [ "ids", "context", "status", "v2", "payload", "createdAt", "updatedAt", "completed" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "createdBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "createdBy" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "bulk", "id": "5b3bddb67f8469003df370a4", "attributes": { "ids": [ "id1", "id2" ], "context": "api.sobjects.kobjects.bulk-delete", "status": "complete", "v2": true, "payload": { "api": { "data": {}, "path": "/v1/klasses/orders", "user": { "id": "5a96dac46dd73800112fab30", "userType": "user", "roles": [ "org" ], "orgName": "mycompany", "subject": "5a96dac46dd73800112fab30", "org": "5a96dac36dd73800112fab2e" }, "requestId": "5b3bddb6b6e494001779fa38", "service": "sobjects", "method": "POST" } }, "createdAt": "2018-07-03T20:33:58.486Z", "updatedAt": "2018-07-03T20:34:03.873Z", "completed": true }, "relationships": { "org": { "links": { "self": "/v1/orgs/5a96dac36dd73800112fab2e" }, "data": { "type": "org", "id": "5a96dac36dd73800112fab2e" } }, "createdBy": { "links": { "self": "/v1/users/5a96dac46dd73800112fab30" }, "data": { "type": "user", "id": "5a96dac46dd73800112fab30" } } }, "links": { "self": "/v1/bulk/5b3bddb67f8469003df370a4" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] } }, "/klasses/{name}": { "get": { "security": [ { "httpBearer": [] } ], "tags": [ "KObjects (Custom Objects)" ], "summary": "Get KObjects (custom objects)", "description": "Retrieves a KObject (custom object) based on the Klass name.\n\nTo learn more, see [Data Model Overview](https://support.kustomer.com/data-model-overview-SyIS1S3zM).\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.klass.read|org.permission.klass.read|\n|org.admin.klass.read||", "operationId": "GetKObjects", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "meta": { "type": "object", "required": [ "pageSize", "page" ], "properties": { "pageSize": { "type": "integer" }, "page": { "type": "integer" } } }, "data": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "required": [ "title", "icon", "images", "custom", "tags", "updatedAt", "createdAt", "rev" ], "properties": { "title": { "type": "string" }, "icon": { "type": "string" }, "images": { "type": "array", "items": { "type": "string" } }, "s3DataUrl": { "type": "string" }, "custom": { "type": "object" }, "tags": { "type": "array", "items": {} }, "updatedAt": { "type": "string" }, "createdAt": { "type": "string" }, "rev": { "type": "integer" }, "klassDisplayName": { "type": "string" }, "klassMixins": { "type": "array", "items": { "type": "string", "enum": [ "assignable" ] } }, "firstDone": { "type": "object", "properties": { "time": { "type": "integer", "example": 27122 }, "businessTime": { "type": "integer", "example": 27122 }, "createdAt": { "type": "string", "format": "date-time", "example": "2021-06-01T12:00:00Z" }, "createdBy": { "type": "string", "format": "object-id", "example": "60b6b1b3b3b3b3b3b3b3b3b3" }, "createdByTeam": { "type": "string", "format": "object-id", "example": "60b6b1b3b3b3b3b3b3b3b3b3" }, "assignedTeam": { "type": "string", "format": "object-id", "example": "60b6b1b3b3b3b3b3b3b3b3" }, "assignedUser": { "type": "string", "format": "object-id", "example": "60b6b1b3b3b3b3b3b3b3b3" }, "commentCount": { "type": "integer", "example": 1 } } }, "lastDone": { "type": "object", "properties": { "time": { "type": "integer", "example": 27122 }, "businessTime": { "type": "integer", "example": 27122 }, "createdAt": { "type": "string", "format": "date-time", "example": "2021-06-01T12:00:00Z" }, "createdBy": { "type": "string", "format": "object-id", "example": "60b6b1b3b3b3b3b3b3b3b3b3" }, "createdByTeam": { "type": "string", "format": "object-id", "example": "60b6b1b3b3b3b3b3b3b3b3b3" }, "assignedTeam": { "type": "string", "format": "object-id", "example": "60b6b1b3b3b3b3b3b3b3b3" }, "assignedUser": { "type": "string", "format": "object-id", "example": "60b6b1b3b3b3b3b3b3b3b3" }, "commentCount": { "type": "integer", "example": 1 } } }, "doneCount": { "type": "integer", "example": 0 }, "reopenCount": { "type": "integer", "example": 0 }, "reopenFromDoneCount": { "type": "integer", "example": 0 }, "queue": { "type": "string", "format": "object-id", "example": "60b6b1b3b3b3b3b3b3b3b3b3" }, "assignedUser": { "type": "string", "format": "object-id", "example": "60b6b1b3b3b3b3b3b3b3b3" }, "status": { "type": "string", "enum": [ "open", "done" ], "example": "open" } } }, "relationships": { "type": "object", "required": [ "org", "klass" ], "properties": { "org": { "type": "object", "required": [ "links", "data" ], "properties": { "links": { "type": "object", "required": [ "self" ], "properties": { "self": { "type": "string" } } }, "data": { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "type": "string" }, "id": { "type": "string" } } } } }, "queue": { "type": "object", "required": [ "links", "data" ], "properties": { "links": { "type": "object", "required": [ "self" ], "properties": { "self": { "type": "string" } } }, "data": { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "type": "string" }, "id": { "type": "string" } } } } }, "klass": { "type": "object", "required": [ "link", "data" ], "properties": { "link": { "type": "object", "required": [ "self" ], "properties": { "self": { "type": "string" } } }, "data": { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "type": "string" }, "id": { "type": "string" } } } } } } }, "links": { "type": "object", "required": [ "self" ], "properties": { "self": { "type": "string" } } } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "links": { "type": "object", "required": [ "self", "first", "prev", "next" ], "properties": { "self": { "type": "string" }, "first": { "type": "string" }, "prev": { "type": "string", "nullable": true }, "next": { "type": "string", "nullable": true } } } }, "required": [ "meta", "data", "links" ] }, "example": { "meta": { "pageSize": 100, "page": 1 }, "data": [ { "type": "kobject.order", "id": "5826ab180fcc2514008b2a94", "attributes": { "title": "Order #1059 (3 items ordered for $64.67)", "icon": "truck-delivery", "images": [ "https://cdn.shopify.com/s/files/1/1489/4596/products/hoodie-2_1.jpg", "https://kustomer-integrations.s3.amazonaws.com/kusty-swag/img/koffee.png", "https://cdn.shopify.com/s/files/1/1489/4596/products/shirt-3_large.jpg?v=1473819771" ], "custom": { "orderStatusStr": "fulfilled", "shippingStatusStr": "fulfilled", "billingStatusStr": "authorized", "specialInstructionsStr": "The tshirt is a gift, can you include a gift bag?", "orderNumberNum": 1059, "orderDescriptionStr": "3 items ordered for $64.67", "totalPriceNum": 64.67, "orderUpdatedAt": "2016-11-06T13:54:29-05:00" }, "tags": [], "updatedAt": "2016-11-12T05:39:36.976Z", "createdAt": "2016-11-12T05:39:36.976Z", "rev": 0, "firstDone": { "time": { "type": "integer", "example": 27122 }, "businessTime": { "type": "integer", "example": 27122 }, "createdAt": { "type": "string", "format": "date-time", "example": "2021-06-01T12:00:00Z" }, "createdBy": { "type": "string", "format": "object-id", "example": "60b6b1b3b3b3b3b3b3b3b3b3" }, "createdByTeam": { "type": "string", "format": "object-id", "example": "60b6b1b3b3b3b3b3b3b3b3b3" }, "assignedTeam": { "type": "string", "format": "object-id", "example": "60b6b1b3b3b3b3b3b3b3b3" }, "assignedUser": { "type": "string", "format": "object-id", "example": "60b6b1b3b3b3b3b3b3b3b3" }, "commentCount": { "type": "integer", "example": 1 } }, "lastDone": { "time": { "type": "integer", "example": 27122 }, "businessTime": { "type": "integer", "example": 27122 }, "createdAt": { "type": "string", "format": "date-time", "example": "2021-06-01T12:00:00Z" }, "createdBy": { "type": "string", "format": "object-id", "example": "60b6b1b3b3b3b3b3b3b3b3b3" }, "createdByTeam": { "type": "string", "format": "object-id", "example": "60b6b1b3b3b3b3b3b3b3b3b3" }, "assignedTeam": { "type": "string", "format": "object-id", "example": "60b6b1b3b3b3b3b3b3b3b3" }, "assignedUser": { "type": "string", "format": "object-id", "example": "60b6b1b3b3b3b3b3b3b3b3" }, "commentCount": { "type": "integer", "example": 1 } }, "doneCount": { "type": "integer", "example": 1 }, "reopenCount": { "type": "integer", "example": 1 }, "reopenDoneCount": { "type": "integer", "example": 1 }, "queue": { "type": "string", "format": "object-id", "example": "60b6b1b3b3b3b3b3b3b3b3" }, "assignedUser": { "type": "string", "format": "object-id", "example": "60b6b1b3b3b3b3b3b3b3b3" }, "status": { "type": "string", "example": "open" } }, "relationships": { "org": { "links": { "self": "/v1/orgs/57bb5d2e32e83a130052e94e" }, "data": { "type": "org", "id": "57bb5d2e32e83a130052e94e" } }, "klass": { "link": { "self": "/v1/klasses/order" }, "data": { "type": "klass", "id": "order" } }, "queue": { "link": { "self": "/v1/queues/60b6b1b3b3b3b3b3b3b3b3" }, "data": { "type": "queue", "id": "60b6b1b3b3b3b3b3b3b3b3" } } }, "links": { "self": "/v1/klasses/orders/5826ab180fcc2514008b2a94" } } ], "links": { "self": "/v1/klasses/orders?page=1&pageSize=100", "first": "/v1/klasses/orders?page=1&pageSize=100", "prev": null, "next": null } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ], "parameters": [ { "name": "fromDate", "in": "query", "required": false, "schema": { "type": "string", "format": "date-time", "example": "2016-11-09T00:00:00.000Z" }, "description": "`date-time` string in Internet Date/Time format ([ISO 8601](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6))." } ] }, "post": { "security": [ { "httpBearer": [] } ], "tags": [ "KObjects (Custom Objects)" ], "summary": "Create KObject", "description": "Creates a new KObject (custom object).\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.kobject.write|org.permission.kobject.create|\n||org.permission.kobject.kobject_*.create|\n\n### Custom Attributes\n[Custom attributes](https://help.kustomer.com/define-attributes-Skr924HI) are optional and allow you to specify custom key-value pairs.\n\nKustomer uses a naming convention for custom attributes to specify the field data type with a name suffix:\n\n#### Naming Suffix\n\n* `Num` *number* or *null*\n* `At` *date-time* or *null*\n* `Str` *string* or *null*, length: [ 0 .. 1024 ] characters\n* `Txt` *string* or *null*, length: [ 0 .. 1024 ] characters\n* `Bool` *boolean* or *null*\n* `Url` *string* or *null*, format: *uri*\n\n### Rate Limit\nCustom objects are subject to a rate limit. A single client can create up to 120 custom objects per minute per customer.\n\n#### Notes\n* Custom objects with `importedAt` in the body will not be subject to the rate limit.\n* A `429 Too Many Requests` response will be returned if the rate limit has been reached for a customer.", "operationId": "CreateKObject", "requestBody": { "description": "", "content": { "application/json": { "schema": { "type": "object", "properties": { "customer": { "type": "string" }, "company": { "type": "string" }, "externalId": { "type": "string", "minLength": 1, "maxLength": 256 }, "title": { "type": "string", "minLength": 1, "maxLength": 256 }, "description": { "type": "string", "maxLength": 10240 }, "images": { "type": "array", "items": { "type": "string", "format": "url" }, "maxItems": 20, "uniqueItems": true }, "icon": { "type": "string", "maxLength": 64 }, "data": { "type": "object" }, "custom": { "type": "object", "maxProperties": 100, "additionalProperties": false }, "tags": { "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 64, "pattern": "^[0-9a-zA-ZÀ-ÿ_/<>\\-.]{1}[0-9a-zA-ZÀ-ÿ _/<>\\-.]{0,63}$" }, "maxItems": 20, "uniqueItems": true }, "createdAt": { "type": "string", "format": "date-time" }, "importedAt": { "type": "string", "format": "date-time" } }, "required": [ "title" ], "additionalProperties": false } } } }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "title": { "type": "string" }, "icon": { "type": "string" }, "images": { "type": "array", "items": { "type": "string" } }, "custom": { "type": "object", "properties": { "orderStatusStr": { "type": "string" }, "shippingStatusStr": { "type": "string" }, "billingStatusStr": { "type": "string" }, "specialInstructionsStr": { "type": "string" }, "orderNumberNum": { "type": "integer" }, "orderDescriptionStr": { "type": "string" }, "totalPriceNum": { "type": "number" }, "orderUpdatedAt": { "type": "string" } }, "required": [ "orderStatusStr", "shippingStatusStr", "billingStatusStr", "specialInstructionsStr", "orderNumberNum", "orderDescriptionStr", "totalPriceNum", "orderUpdatedAt" ] }, "tags": { "type": "array" }, "updatedAt": { "type": "string" }, "createdAt": { "type": "string" }, "rev": { "type": "integer" } }, "required": [ "title", "icon", "images", "custom", "tags", "updatedAt", "createdAt", "rev" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "klass": { "type": "object", "properties": { "link": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "link", "data" ] } }, "required": [ "org", "klass" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "kobject.order", "id": "5826ab180fcc2514008b2a94", "attributes": { "title": "Order #1059 (3 items ordered for $64.67)", "icon": "truck-delivery", "images": [ "https://cdn.shopify.com/s/files/1/1489/4596/products/hoodie-2_1.jpg", "https://kustomer-integrations.s3.amazonaws.com/kusty-swag/img/koffee.png", "https://cdn.shopify.com/s/files/1/1489/4596/products/shirt-3_large.jpg?v=1473819771" ], "custom": { "orderStatusStr": "fulfilled", "shippingStatusStr": "fulfilled", "billingStatusStr": "authorized", "specialInstructionsStr": "The tshirt is a gift, can you include a gift bag?", "orderNumberNum": 1059, "orderDescriptionStr": "3 items ordered for $64.67", "totalPriceNum": 64.67, "orderUpdatedAt": "2016-11-06T13:54:29-05:00" }, "tags": [], "updatedAt": "2016-11-12T05:39:36.976Z", "createdAt": "2016-11-12T05:39:36.976Z", "rev": 0 }, "relationships": { "org": { "links": { "self": "/v1/orgs/57bb5d2e32e83a130052e94e" }, "data": { "type": "org", "id": "57bb5d2e32e83a130052e94e" } }, "klass": { "link": { "self": "/v1/klasses/order" }, "data": { "type": "klass", "id": "order" } } }, "links": { "self": "/v1/klasses/orders/5826ab180fcc2514008b2a94" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] }, "parameters": [ { "schema": { "type": "string", "example": "orders" }, "name": "name", "in": "path", "required": true, "description": "Klass name of the KObjects (custom objects)." } ] }, "/klasses/{name}/{id}": { "get": { "security": [ { "httpBearer": [] } ], "tags": [ "KObjects (Custom Objects)" ], "summary": "Get KObject (custom object) by ID", "description": "Retrieves a KObject (custom object) based on the unique KObject ID.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.kobject.read|org.permission.kobject.read|\n||org.permission.kobject.kobject_*.read|", "operationId": "GetKObject", "parameters": [ { "name": "name", "in": "path", "description": "Klass name of the KObject.", "required": true, "style": "simple", "schema": { "type": "string", "example": "orders" } }, { "name": "id", "in": "path", "description": "Unique ID of the KObject.", "required": true, "style": "simple", "schema": { "type": "string", "example": "5826ab180fcc2514008b2a94" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "title": { "type": "string" }, "icon": { "type": "string" }, "images": { "type": "array", "items": { "type": "string" } }, "custom": { "type": "object", "properties": { "orderStatusStr": { "type": "string" }, "shippingStatusStr": { "type": "string" }, "billingStatusStr": { "type": "string" }, "specialInstructionsStr": { "type": "string" }, "orderNumberNum": { "type": "integer" }, "orderDescriptionStr": { "type": "string" }, "totalPriceNum": { "type": "number" }, "orderUpdatedAt": { "type": "string" } }, "required": [ "orderStatusStr", "shippingStatusStr", "billingStatusStr", "specialInstructionsStr", "orderNumberNum", "orderDescriptionStr", "totalPriceNum", "orderUpdatedAt" ] }, "tags": { "type": "array" }, "updatedAt": { "type": "string" }, "createdAt": { "type": "string" }, "rev": { "type": "integer" }, "firstDone": { "type": "object", "properties": { "time": { "type": "integer", "example": 27122 }, "businessTime": { "type": "integer", "example": 27122 }, "createdAt": { "type": "string", "format": "date-time", "example": "2021-06-01T12:00:00Z" }, "createdBy": { "type": "string", "format": "object-id", "example": "60b6b1b3b3b3b3b3b3b3b3b3" }, "createdByTeam": { "type": "string", "format": "object-id", "example": "60b6b1b3b3b3b3b3b3b3b3b3" }, "assignedTeam": { "type": "string", "format": "object-id", "example": "60b6b1b3b3b3b3b3b3b3b3" }, "assignedUser": { "type": "string", "format": "object-id", "example": "60b6b1b3b3b3b3b3b3b3b3" }, "commentCount": { "type": "integer", "example": 1 } } }, "lastDone": { "type": "object", "properties": { "time": { "type": "integer", "example": 27122 }, "businessTime": { "type": "integer", "example": 27122 }, "createdAt": { "type": "string", "format": "date-time", "example": "2021-06-01T12:00:00Z" }, "createdBy": { "type": "string", "format": "object-id", "example": "60b6b1b3b3b3b3b3b3b3b3b3" }, "createdByTeam": { "type": "string", "format": "object-id", "example": "60b6b1b3b3b3b3b3b3b3b3b3" }, "assignedTeam": { "type": "string", "format": "object-id", "example": "60b6b1b3b3b3b3b3b3b3b3" }, "assignedUser": { "type": "string", "format": "object-id", "example": "60b6b1b3b3b3b3b3b3b3b3" }, "commentCount": { "type": "integer", "example": 1 } } }, "doneCount": { "type": "integer", "example": 0 }, "reopenCount": { "type": "integer", "example": 0 }, "reopenFromDoneCount": { "type": "integer", "example": 0 }, "queue": { "type": "string", "format": "object-id", "example": "60b6b1b3b3b3b3b3b3b3b3b3" }, "assignedUser": { "type": "string", "format": "object-id", "example": "60b6b1b3b3b3b3b3b3b3b3" }, "status": { "type": "string", "enum": [ "open", "done" ], "example": "open" } }, "required": [ "title", "icon", "images", "custom", "tags", "updatedAt", "createdAt", "rev" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "klass": { "type": "object", "properties": { "link": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "link", "data" ] } }, "required": [ "org", "klass" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "kobject.order", "id": "5826ab180fcc2514008b2a94", "attributes": { "title": "Order #1059 (3 items ordered for $64.67)", "icon": "truck-delivery", "images": [ "https://cdn.shopify.com/s/files/1/1489/4596/products/hoodie-2_1.jpg", "https://kustomer-integrations.s3.amazonaws.com/kusty-swag/img/koffee.png", "https://cdn.shopify.com/s/files/1/1489/4596/products/shirt-3_large.jpg?v=1473819771" ], "custom": { "orderStatusStr": "fulfilled", "shippingStatusStr": "fulfilled", "billingStatusStr": "authorized", "specialInstructionsStr": "The tshirt is a gift, can you include a gift bag?", "orderNumberNum": 1059, "orderDescriptionStr": "3 items ordered for $64.67", "totalPriceNum": 64.67, "orderUpdatedAt": "2016-11-06T13:54:29-05:00" }, "tags": [], "updatedAt": "2016-11-12T05:39:36.976Z", "createdAt": "2016-11-12T05:39:36.976Z", "rev": 0, "doneCount": 1, "reopenCount": 1, "reopenDoneCount": 1, "queue": { "type": "string", "format": "object-id", "example": "60b6b1b3b3b3b3b3b3b3b3" }, "assignedUser": { "type": "string", "format": "object-id", "example": "60b6b1b3b3b3b3b3b3b3b3" }, "status": { "type": "string", "example": "open" }, "firstDone": { "time": { "type": "integer", "example": 27122 }, "businessTime": { "type": "integer", "example": 27122 }, "createdAt": { "type": "string", "format": "date-time", "example": "2021-06-01T12:00:00Z" }, "createdBy": { "type": "string", "format": "object-id", "example": "60b6b1b3b3b3b3b3b3b3b3" }, "createdByTeam": { "type": "string", "format": "object-id", "example": "60b6b1b3b3b3b3b3b3b3b3b3" }, "assignedTeam": { "type": "string", "format": "object-id", "example": "60b6b1b3b3b3b3b3b3b3b3" }, "assignedUser": { "type": "string", "format": "object-id", "example": "60b6b1b3b3b3b3b3b3b3b3" }, "commentCount": { "type": "integer", "example": 1 } }, "lastDone": { "time": { "type": "integer", "example": 27122 }, "businessTime": { "type": "integer", "example": 27122 }, "createdAt": { "type": "string", "format": "date-time", "example": "2021-06-01T12:00:00Z" }, "createdBy": { "type": "string", "format": "object-id", "example": "60b6b1b3b3b3b3b3b3b3b3" }, "createdByTeam": { "type": "string", "format": "object-id", "example": "60b6b1b3b3b3b3b3b3b3b3b3" }, "assignedTeam": { "type": "string", "format": "object-id", "example": "60b6b1b3b3b3b3b3b3b3b3" }, "assignedUser": { "type": "string", "format": "object-id", "example": "60b6b1b3b3b3b3b3b3b3b3" }, "commentCount": { "type": "integer", "example": 1 } } }, "relationships": { "org": { "links": { "self": "/v1/orgs/57bb5d2e32e83a130052e94e" }, "data": { "type": "org", "id": "57bb5d2e32e83a130052e94e" } }, "klass": { "link": { "self": "/v1/klasses/order" }, "data": { "type": "klass", "id": "order" } }, "queue": { "link": { "self": "/v1/queues/60b6b1b3b3b3b3b3b3b3b3" }, "data": { "type": "queue", "id": "60b6b1b3b3b3b3b3b3b3b3" } } }, "links": { "self": "/v1/klasses/orders/5826ab180fcc2514008b2a94" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] }, "put": { "security": [ { "httpBearer": [] } ], "tags": [ "KObjects (Custom Objects)" ], "summary": "Update KObject (custom object) by ID", "description": "Updates an existing KObject (custom object) based on the unique ID.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.kobject.write|org.permission.kobject.update|\n||org.permission.kobject.kobject_*.update|\n\n### Note\n> This endpoint is subject to \"Object Rate Limiting\", meaning that a single user is limited in how many updates they can make to a single KObject. To learn more, see [Rate limiting](https://developer.kustomer.com/kustomer-api-docs/reference/rate-limiting).\n\n### Custom Attributes\n[Custom attributes](https://help.kustomer.com/define-attributes-Skr924HI) are optional and allow you to specify custom key-value pairs.\n\nKustomer uses a naming convention for custom attributes to specify the field data type with a name suffix:\n\n#### Naming Suffix\n\n* `Num` *number* or *null*\n* `At` *date-time* or *null*\n* `Str` *string* or *null*, length: [ 0 .. 1024 ] characters\n* `Txt` *string* or *null*, length: [ 0 .. 1024 ] characters\n* `Bool` *boolean* or *null*\n* `Url` *string* or *null*, format: *uri*", "operationId": "UpdateKObject", "parameters": [ { "name": "name", "in": "path", "description": "Klass name of the KObject.", "required": true, "style": "simple", "schema": { "type": "string", "example": "orders" } }, { "name": "id", "in": "path", "description": "Unique ID of the KObject.", "required": true, "style": "simple", "schema": { "type": "string", "example": "5826ab180fcc2514008b2a94" } } ], "requestBody": { "description": "", "content": { "application/json": { "schema": { "type": "object", "properties": { "externalId": { "type": "string", "minLength": 1, "maxLength": 256 }, "title": { "type": "string", "minLength": 1, "maxLength": 256 }, "description": { "type": "string", "maxLength": 10240 }, "images": { "type": "array", "items": { "type": "string", "format": "url" }, "maxItems": 20, "uniqueItems": true }, "icon": { "type": "string", "maxLength": 64 }, "data": { "type": "object" }, "custom": { "type": "object", "maxProperties": 100, "additionalProperties": false }, "tags": { "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 64, "pattern": "^[0-9a-zA-ZÀ-ÿ_/<>\\-.]{1}[0-9a-zA-ZÀ-ÿ _/<>\\-.]{0,63}$" }, "maxItems": 20, "uniqueItems": true }, "createdAt": { "type": "string", "format": "date-time" }, "importedAt": { "type": "string", "format": "date-time" }, "rev": { "type": "number" } }, "additionalProperties": false } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "title": { "type": "string" }, "description": { "type": "string", "nullable": true }, "icon": { "type": "string" }, "images": { "type": "array", "items": { "type": "string" } }, "custom": { "type": "object", "properties": { "orderUpdatedAt": { "type": "string" }, "totalPriceNum": { "type": "number" }, "orderDescriptionStr": { "type": "string" }, "orderNumberNum": { "type": "integer" }, "specialInstructionsStr": { "type": "string" }, "billingStatusStr": { "type": "string" }, "shippingStatusStr": { "type": "string" }, "orderStatusStr": { "type": "string" }, "refundedBool": { "type": "boolean" } }, "required": [ "orderUpdatedAt", "totalPriceNum", "orderDescriptionStr", "orderNumberNum", "specialInstructionsStr", "billingStatusStr", "shippingStatusStr", "orderStatusStr", "refundedBool" ] }, "tags": { "type": "array" }, "updatedAt": { "type": "string" }, "createdAt": { "type": "string" }, "rev": { "type": "integer" }, "firstDone": { "type": "object", "properties": { "time": { "type": "integer", "example": 27122 }, "businessTime": { "type": "integer", "example": 27122 }, "createdAt": { "type": "string", "format": "date-time", "example": "2021-06-01T12:00:00Z" }, "createdBy": { "type": "string", "format": "object-id", "example": "60b6b1b3b3b3b3b3b3b3b3b3" }, "createdByTeam": { "type": "string", "format": "object-id", "example": "60b6b1b3b3b3b3b3b3b3b3b3" }, "assignedTeam": { "type": "string", "format": "object-id", "example": "60b6b1b3b3b3b3b3b3b3b3" }, "assignedUser": { "type": "string", "format": "object-id", "example": "60b6b1b3b3b3b3b3b3b3b3" }, "commentCount": { "type": "integer", "example": 1 } } }, "lastDone": { "type": "object", "properties": { "time": { "type": "integer", "example": 27122 }, "businessTime": { "type": "integer", "example": 27122 }, "createdAt": { "type": "string", "format": "date-time", "example": "2021-06-01T12:00:00Z" }, "createdBy": { "type": "string", "format": "object-id", "example": "60b6b1b3b3b3b3b3b3b3b3b3" }, "createdByTeam": { "type": "string", "format": "object-id", "example": "60b6b1b3b3b3b3b3b3b3b3b3" }, "assignedTeam": { "type": "string", "format": "object-id", "example": "60b6b1b3b3b3b3b3b3b3b3" }, "assignedUser": { "type": "string", "format": "object-id", "example": "60b6b1b3b3b3b3b3b3b3b3" }, "commentCount": { "type": "integer", "example": 1 } } }, "doneCount": { "type": "integer", "example": 0 }, "reopenCount": { "type": "integer", "example": 0 }, "reopenFromDoneCount": { "type": "integer", "example": 0 }, "queue": { "type": "string", "format": "object-id", "example": "60b6b1b3b3b3b3b3b3b3b3b3" }, "assignedUser": { "type": "string", "format": "object-id", "example": "60b6b1b3b3b3b3b3b3b3b3" }, "status": { "type": "string", "enum": [ "open", "done" ], "example": "open" } }, "required": [ "title", "description", "icon", "images", "custom", "tags", "updatedAt", "createdAt", "rev" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "klass": { "type": "object", "properties": { "link": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "link", "data" ] } }, "required": [ "org", "klass" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "kobject.order", "id": "5826ab180fcc2514008b2a94", "attributes": { "title": "Order #1059 (3 items ordered for $64.67)", "description": null, "icon": "truck-delivery", "images": [ "https://cdn.shopify.com/s/files/1/1489/4596/products/hoodie-2_1.jpg", "https://kustomer-integrations.s3.amazonaws.com/kusty-swag/img/koffee.png", "https://cdn.shopify.com/s/files/1/1489/4596/products/shirt-3_large.jpg?v=1473819771" ], "custom": { "orderUpdatedAt": "2016-11-06T13:54:29-05:00", "totalPriceNum": 64.67, "orderDescriptionStr": "3 items ordered for $64.67", "orderNumberNum": 1059, "specialInstructionsStr": "The tshirt is a gift, can you include a gift bag?", "billingStatusStr": "authorized", "shippingStatusStr": "fulfilled", "orderStatusStr": "fulfilled", "refundedBool": false }, "tags": [], "updatedAt": "2016-11-12T05:58:31.434Z", "createdAt": "2016-11-12T05:39:36.976Z", "rev": 3, "firstDone": { "time": { "type": "integer", "example": 27122 }, "businessTime": { "type": "integer", "example": 27122 }, "createdAt": { "type": "string", "format": "date-time", "example": "2021-06-01T12:00:00Z" }, "createdBy": { "type": "string", "format": "object-id", "example": "60b6b1b3b3b3b3b3b3b3b3b3" }, "createdByTeam": { "type": "string", "format": "object-id", "example": "60b6b1b3b3b3b3b3b3b3b3b3" }, "assignedTeam": { "type": "string", "format": "object-id", "example": "60b6b1b3b3b3b3b3b3b3b3" }, "assignedUser": { "type": "string", "format": "object-id", "example": "60b6b1b3b3b3b3b3b3b3b3" }, "commentCount": { "type": "integer", "example": 1 } }, "lastDone": { "time": { "type": "integer", "example": 27122 }, "businessTime": { "type": "integer", "example": 27122 }, "createdAt": { "type": "string", "format": "date-time", "example": "2021-06-01T12:00:00Z" }, "createdBy": { "type": "string", "format": "object-id", "example": "60b6b1b3b3b3b3b3b3b3b3b3" }, "createdByTeam": { "type": "string", "format": "object-id", "example": "60b6b1b3b3b3b3b3b3b3b3b3" }, "assignedTeam": { "type": "string", "format": "object-id", "example": "60b6b1b3b3b3b3b3b3b3b3" }, "assignedUser": { "type": "string", "format": "object-id", "example": "60b6b1b3b3b3b3b3b3b3b3" }, "commentCount": { "type": "integer", "example": 1 } }, "doneCount": { "type": "integer", "example": 1 }, "reopenCount": { "type": "integer", "example": 1 }, "reopenDoneCount": { "type": "integer", "example": 1 }, "queue": { "type": "string", "format": "object-id", "example": "60b6b1b3b3b3b3b3b3b3b3" }, "assignedUser": { "type": "string", "format": "object-id", "example": "60b6b1b3b3b3b3b3b3b3b3" }, "status": { "type": "string", "example": "open" } }, "relationships": { "org": { "links": { "self": "/v1/orgs/57bb5d2e32e83a130052e94e" }, "data": { "type": "org", "id": "57bb5d2e32e83a130052e94e" } }, "queue": { "link": { "self": "/v1/queues/60b6b1b3b3b3b3b3b3b3b3" }, "data": { "type": "queue", "id": "60b6b1b3b3b3b3b3b3b3b3" } }, "klass": { "link": { "self": "/v1/klasses/order" }, "data": { "type": "klass", "id": "order" } } }, "links": { "self": "/v1/klasses/orders/5826ab180fcc2514008b2a94" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] }, "delete": { "security": [ { "httpBearer": [] } ], "tags": [ "KObjects (Custom Objects)" ], "summary": "Delete KObject (custom object) by ID", "description": "Deletes a KObject (custom object) based on the unique KObject ID.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.kobject.delete|org.permission.kobject.delete|\n||org.permission.kobject.kobject_*.delete|", "operationId": "DeleteKObject", "parameters": [ { "name": "name", "in": "path", "description": "Klass name of the KObject.", "required": true, "style": "simple", "schema": { "type": "string", "example": "orders" } }, { "name": "id", "in": "path", "description": "Unique ID of the KObject.", "required": true, "style": "simple", "schema": { "type": "string", "example": "5826ab180fcc2514008b2a94" } } ], "responses": { "204": { "description": "No Content", "content": { "text/plain": { "example": "" } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] } }, "/klasses": { "post": { "security": [ { "httpBearer": [] } ], "tags": [ "Klasses" ], "summary": "Create Klass", "description": "Creates a new [Klass](https://help.kustomer.com/define-attributes-Skr924HI#Attributes) model for your Kustomer organization.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.admin.klass.write|org.permission.klass.create|", "operationId": "CreateKlass", "parameters": [], "requestBody": { "description": "", "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string", "pattern": "^[0-9a-zA-Z_-]+$", "maxLength": 255 }, "displayName": { "type": "string", "maxLength": 255 }, "icon": { "type": "string", "maxLength": 64 }, "color": { "type": "string", "maxLength": 64 }, "jsonSchema": {}, "klassSchema": { "enum": [ "task" ] }, "mixins": { "type": "array", "items": { "type": "string", "enum": [ "commentable", "assignable", "editable", "creatable" ] } }, "status": { "enum": [ "enabled", "disabled" ] } }, "required": [ "name" ], "additionalProperties": false } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "required": [ "type", "id", "attributes", "relationships", "links" ], "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "required": [ "name", "status", "updatedAt", "createdAt" ], "properties": { "name": { "type": "string" }, "status": { "type": "string" }, "updatedAt": { "type": "string" }, "createdAt": { "type": "string" } } }, "relationships": { "type": "object", "required": [ "org", "kobjects" ], "properties": { "org": { "type": "object", "required": [ "links", "data" ], "properties": { "links": { "type": "object", "required": [ "self" ], "properties": { "self": { "type": "string" } } }, "data": { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "type": "string" }, "id": { "type": "string" } } } } }, "kobjects": { "type": "object", "required": [ "links" ], "properties": { "links": { "type": "object", "required": [ "self" ], "properties": { "self": { "type": "string" } } } } } } }, "links": { "type": "object", "required": [ "self" ], "properties": { "self": { "type": "string" } } } } } }, "required": [ "data" ] }, "example": { "data": { "type": "klass", "id": "5826a39b0fcc2514008b2a92", "attributes": { "name": "order", "status": "enabled", "updatedAt": "2016-11-12T05:07:39.754Z", "createdAt": "2016-11-12T05:07:39.754Z" }, "relationships": { "org": { "links": { "self": "/v1/orgs/57bb5d2e32e83a130052e94e" }, "data": { "type": "org", "id": "57bb5d2e32e83a130052e94e" } }, "kobjects": { "links": { "self": "/v1/klasses/purchases" } } }, "links": { "self": "/v1/klasses/5826a39b0fcc2514008b2a92" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] }, "get": { "security": [ { "httpBearer": [] } ], "tags": [ "Klasses" ], "summary": "Get Klasses", "description": "Retrieves all [Klasses](https://help.kustomer.com/define-attributes-Skr924HI#Attributes).\n\n## Filter by `status`\n\nYou can filter results based on the `status` of the Klass. Valid values are `enabled`, `existing_only`, and `disabled`. The default value is `enabled`.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.klass.read|org.permission.klass.read|\n|org.admin.klass.read||", "operationId": "GetKlasses", "parameters": [ { "name": "pageSize", "in": "query", "required": false, "schema": { "type": "number", "default": 100, "example": 100 }, "description": "Number of results to return per page. Default value: 100." }, { "name": "page", "in": "query", "schema": { "type": "number", "default": 1, "example": 1 }, "description": "Number of pages to return for results. Default value: 1." }, { "schema": { "type": "string", "default": "enabled", "enum": [ "enabled", "disabled", "existing_only" ], "example": "enabled" }, "in": "query", "name": "status", "description": "Option to filter Klass based on the status. Default value: `enabled`. " } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "meta": { "type": "object", "required": [ "pageSize", "page" ], "properties": { "pageSize": { "type": "integer" }, "page": { "type": "integer" } } }, "data": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "required": [ "name", "displayName", "status", "updatedAt", "createdAt" ], "properties": { "name": { "type": "string" }, "displayName": { "type": "string" }, "icon": { "type": "string" }, "color": { "type": "string" }, "klassSchema": { "type": "string" }, "appVersion": { "type": "string" }, "appDisabled": { "type": "boolean" }, "status": { "type": "string" }, "mixins": { "type": "array", "items": { "type": "string", "enum": [ "commentable", "assignable", "editable", "creatable" ] } }, "updatedAt": { "type": "string" }, "createdAt": { "type": "string" }, "s3DataUrl": { "type": "string" } } }, "relationships": { "type": "object", "required": [ "org", "kobjects" ], "properties": { "org": { "type": "object", "required": [ "links", "data" ], "properties": { "links": { "type": "object", "required": [ "self" ], "properties": { "self": { "type": "string" } } }, "data": { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "type": "string" }, "id": { "type": "string" } } } } }, "kobjects": { "type": "object", "required": [ "links" ], "properties": { "links": { "type": "object", "required": [ "self" ], "properties": { "self": { "type": "string" } } } } } } }, "links": { "type": "object", "required": [ "self" ], "properties": { "self": { "type": "string" } } } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "links": { "type": "object", "required": [ "self", "first", "prev", "next" ], "properties": { "self": { "type": "string" }, "first": { "type": "string" }, "prev": { "type": "string", "nullable": true }, "next": { "type": "string", "nullable": true } } } }, "required": [ "meta", "data", "links" ] }, "example": { "meta": { "pageSize": 100, "page": 1 }, "data": [ { "type": "klass", "id": "5815644fbae7a53e0180e80a", "attributes": { "name": "call_back_request", "displayname": "Call Back Request", "icon": "foobar", "color": "", "appDisabled": false, "status": "enabled", "mixins": [ "assignable" ], "updatedAt": "2016-11-12T05:15:09.250Z", "createdAt": "2016-10-30T03:09:03.258Z" }, "relationships": { "org": { "links": { "self": "/v1/orgs/57bb5d2e32e83a130052e94e" }, "data": { "type": "org", "id": "57bb5d2e32e83a130052e94e" } }, "kobjects": { "links": { "self": "/v1/klasses/orders" } } }, "links": { "self": "/v1/klasses/5815644fbae7a53e0180e80a" } }, { "type": "klass", "id": "5826a39b0fcc2514008b2a92", "attributes": { "name": "purchase", "displayName": "Purchase", "status": "enabled", "updatedAt": "2016-11-12T05:07:39.754Z", "createdAt": "2016-11-12T05:07:39.754Z" }, "relationships": { "org": { "links": { "self": "/v1/orgs/57bb5d2e32e83a130052e94e" }, "data": { "type": "org", "id": "57bb5d2e32e83a130052e94e" } }, "kobjects": { "links": { "self": "/v1/klasses/purchases" } } }, "links": { "self": "/v1/klasses/5826a39b0fcc2514008b2a92" } } ], "links": { "self": "/v1/klasses?page=1&pageSize=100", "first": "/v1/klasses?page=1&pageSize=100", "prev": null, "next": null } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] } }, "/klasses/{id}": { "get": { "security": [ { "httpBearer": [] } ], "tags": [ "Klasses" ], "summary": "Get Klass by ID", "description": "Retrieves a Klass based on the unique Klass ID.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.klass.read|org.permission.klass.read|\n|org.admin.klass.read||", "operationId": "GetKlass", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "name": { "type": "string" }, "displayName": { "type": "string" }, "icon": { "type": "string" }, "color": { "type": "string" }, "appDisabled": { "type": "boolean" }, "status": { "type": "string" }, "mixins": { "type": "array", "items": { "type": "string", "enum": [ "commentable", "assignable", "editable", "creatable" ] } }, "updatedAt": { "type": "string" }, "createdAt": { "type": "string" } }, "required": [ "name", "icon", "status", "updatedAt", "createdAt" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "kobjects": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "links" ] } }, "required": [ "org", "kobjects" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "klass", "id": "5826a39b0fcc2514008b2a92", "attributes": { "name": "order", "displayName": "Order", "icon": "foobar", "status": "enabled", "mixins": [ "assignable" ], "updatedAt": "2016-11-12T05:07:39.754Z", "createdAt": "2016-11-12T05:07:39.754Z" }, "relationships": { "org": { "links": { "self": "/v1/orgs/57bb5d2e32e83a130052e94e" }, "data": { "type": "org", "id": "57bb5d2e32e83a130052e94e" } }, "kobjects": { "links": { "self": "/v1/klasses/purchases" } } }, "links": { "self": "/v1/klasses/5826a39b0fcc2514008b2a92" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] }, "put": { "security": [ { "httpBearer": [] } ], "tags": [ "Klasses" ], "summary": "Update Klass by ID", "description": "Updates Klass attributes based on the unique Klass ID.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.admin.klass.write|org.permission.klass.update|", "operationId": "UpdateKlass", "requestBody": { "description": "", "content": { "application/json": { "schema": { "type": "object", "properties": { "displayName": { "type": "string", "maxLength": 255 }, "icon": { "type": "string", "maxLength": 64 }, "color": { "type": "string", "maxLength": 64 }, "jsonSchema": {}, "klassSchema": { "enum": [ "task" ] }, "mixins": { "type": "array", "items": { "type": "string", "enum": [ "commentable", "assignable", "editable", "creatable" ] } }, "status": { "enum": [ "enabled", "disabled" ] } }, "additionalProperties": false } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "name": { "type": "string" }, "displayName": { "type": "string" }, "appDisabled": { "type": "boolean" }, "mixins": { "type": "array", "items": { "type": "string", "enum": [ "commentable", "assignable", "editable", "creatable" ] } }, "icon": { "type": "string" }, "status": { "type": "string" }, "updatedAt": { "type": "string" }, "createdAt": { "type": "string" } }, "required": [ "name", "icon", "status", "updatedAt", "createdAt" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "kobjects": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "links" ] } }, "required": [ "org", "kobjects" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "klass", "id": "5826a39b0fcc2514008b2a92", "attributes": { "name": "order", "displayName": "Order", "appDisabled": false, "icon": "foobar", "status": "enabled", "mixins": [ "assignable" ], "updatedAt": "2016-11-12T05:07:39.754Z", "createdAt": "2016-11-12T05:07:39.754Z" }, "relationships": { "org": { "links": { "self": "/v1/orgs/57bb5d2e32e83a130052e94e" }, "data": { "type": "org", "id": "57bb5d2e32e83a130052e94e" } }, "kobjects": { "links": { "self": "/v1/klasses/purchases" } } }, "links": { "self": "/v1/klasses/5826a39b0fcc2514008b2a92" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] }, "delete": { "security": [ { "httpBearer": [] } ], "tags": [ "Klasses" ], "summary": "Delete Klass", "description": "Deletes a Klass based on the unique Klass ID.\n\n### Note\n> You cannot delete a Klass if KObjects (custom objects) exist for the Klass in your Kustomer organization.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.admin.klass.write|org.permission.klass.delete|", "operationId": "DeleteKlass", "responses": { "204": { "description": "No Content", "content": { "text/plain": { "example": "" } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] }, "parameters": [ { "schema": { "type": "string", "example": "5826a39b0fcc2514008b2a92" }, "name": "id", "in": "path", "required": true, "description": "Unique Klass ID." } ] }, "/media": { "post": { "security": [ { "httpBearer": [] } ], "tags": [ "Media" ], "summary": "Create media", "description": "Creates a new media upload document. This includes a temporary upload policy to allow a file upload through a `POST` request.\n\n## Media uploads\n\nMedia uploads require a mutli-part `POST` request to the URL in the `meta.upload.url` property in the response object:\n* The request must include as standard form keys the key-value pairs located in the `meta.upload.fields` property.\n* The request must include the file as the last key under the name `file`.\n\n## Blocked extensions\n\nThe following file name extensions are blocked and **cannot** be used as attachments:\n\n- .bin\n- .bat\n- .chm\n- .com\n- .cpl\n- .crt\n- .exe\n- .hlp\n- .hta\n- .inf\n- .ins\n- .isp\n- .jse\n- .lnk\n- .mdb\n- .msc\n- .msi\n- .msp\n- .mst\n- .pcd\n- .pif\n- .ps1\n- .reg\n- .scr\n- .sct\n- .shs\n- .vbe\n- .vba\n- .vbs\n- .wsf\n- .wsh\n- .wsl", "operationId": "CreateMedia", "parameters": [], "requestBody": { "description": "", "content": { "application/json": { "schema": { "type": "object", "title": "Media Create", "description": "Schema for media create operations", "properties": { "name": { "type": "string" }, "contentType": { "type": "string" }, "contentLength": { "type": "number", "maximum": 10048576 } }, "required": [ "name", "contentType", "contentLength" ], "additionalProperties": false } } } }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string" }, "attributes": { "type": "object", "properties": { "name": { "type": "string" }, "contentType": { "type": "string" }, "contentLength": { "type": "integer" }, "redacted": { "type": "boolean" }, "uploaded": { "type": "boolean" }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "context": { "type": "string" } }, "required": [ "name", "contentType", "contentLength", "redacted", "uploaded", "createdAt", "updatedAt", "context" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string" } }, "required": [ "id", "type" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "data", "links" ] } }, "required": [ "org" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "id", "type", "attributes", "relationships", "links" ] }, "meta": { "type": "object", "properties": { "provider": { "type": "string" }, "upload": { "type": "object", "properties": { "url": { "type": "string" }, "fields": { "type": "object", "properties": { "key": { "type": "string" }, "acl": { "type": "string" }, "Content-Type": { "type": "string" }, "X-Amz-Meta-Attachment-Id": { "type": "string" }, "bucket": { "type": "string" }, "X-Amz-Algorithm": { "type": "string" }, "X-Amz-Credential": { "type": "string" }, "X-Amz-Date": { "type": "string" }, "Policy": { "type": "string" }, "X-Amz-Signature": { "type": "string" } }, "required": [ "key", "acl", "Content-Type", "X-Amz-Meta-Attachment-Id", "bucket", "X-Amz-Algorithm", "X-Amz-Credential", "X-Amz-Date", "Policy", "X-Amz-Signature" ] } }, "required": [ "url", "fields" ] } }, "required": [ "provider", "upload" ] } }, "required": [ "data", "meta" ] }, "example": { "data": { "id": "5da062fb90897d01573e121f", "type": "attachment", "attributes": { "name": "attachment.jpg", "contentType": "image/jpeg", "contentLength": 512, "redacted": false, "uploaded": false, "createdAt": "2019-10-11T11:09:47.898Z", "updatedAt": "2019-10-11T11:09:47.898Z", "context": "attachment" }, "relationships": { "org": { "data": { "id": "59c406630f79b70034579acd", "type": "org" }, "links": { "self": "/v1/orgs/59c406630f79b70034579acd" } } }, "links": { "self": "/v1/attachments/5da062fb90897d01573e121f" } }, "meta": { "provider": "s3", "upload": { "url": "https://s3.amazonaws.com/kustomer-staging-user-content", "fields": { "key": "attachments/59c406630f79b70034579acd/5da062fb90897d01573e121f-attachment.jpg", "acl": "private", "Content-Type": "image/jpeg", "X-Amz-Meta-Attachment-Id": "5da062fb90897d01573e121f", "bucket": "aws-bucket", "X-Amz-Algorithm": "aws-algorithm", "X-Amz-Credential": "aws-temp-key", "X-Amz-Date": "20180103T180146Z", "Policy": "aws-temp-policy-jwt", "X-Amz-Signature": "aws-temp-signature-value" } } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] } }, "/media/{id}": { "get": { "security": [ { "httpBearer": [] } ], "tags": [ "Media" ], "summary": "Get media by ID", "description": "Retrieves a media object that matches the unique ID or an array of media objects (if multiple IDs are given).\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.media.read|org.permission.kb.read|\n|org.user.setting.read||\n|org.user.content.kb.read||\n|org.user.kb.read||\n|org.admin.content.kb.read||\n|org.admin.kb.read||", "operationId": "GetMediabyId", "parameters": [ { "name": "id", "in": "path", "description": "Unique media object ID. Provide a comma-separated list of `id`s to retrieve an array of media objects instead.", "required": true, "style": "simple", "schema": { "type": "string", "example": "5da062fb90897d01573e121f" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string" }, "attributes": { "type": "object", "properties": { "name": { "type": "string" }, "contentType": { "type": "string" }, "contentLength": { "type": "integer" }, "redacted": { "type": "boolean" }, "uploaded": { "type": "boolean" }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "context": { "type": "string" } }, "required": [ "name", "contentType", "contentLength", "redacted", "uploaded", "createdAt", "updatedAt", "context" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string" } }, "required": [ "id", "type" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "data", "links" ] } }, "required": [ "org" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "id", "type", "attributes", "relationships", "links" ] }, "meta": { "type": "object", "properties": { "provider": { "type": "string" }, "upload": { "type": "object", "properties": { "url": { "type": "string" }, "fields": { "type": "object", "properties": { "key": { "type": "string" }, "acl": { "type": "string" }, "Content-Type": { "type": "string" }, "X-Amz-Meta-Attachment-Id": { "type": "string" }, "bucket": { "type": "string" }, "X-Amz-Algorithm": { "type": "string" }, "X-Amz-Credential": { "type": "string" }, "X-Amz-Date": { "type": "string" }, "Policy": { "type": "string" }, "X-Amz-Signature": { "type": "string" } }, "required": [ "key", "acl", "Content-Type", "X-Amz-Meta-Attachment-Id", "bucket", "X-Amz-Algorithm", "X-Amz-Credential", "X-Amz-Date", "Policy", "X-Amz-Signature" ] } }, "required": [ "url", "fields" ] } }, "required": [ "provider", "upload" ] } }, "required": [ "data", "meta" ] }, "example": { "data": { "id": "5da062fb90897d01573e121f", "type": "attachment", "attributes": { "name": "attachment.jpg", "contentType": "image/jpeg", "contentLength": 512, "redacted": false, "uploaded": false, "createdAt": "2019-10-11T11:09:47.898Z", "updatedAt": "2019-10-11T11:09:47.898Z", "context": "attachment" }, "relationships": { "org": { "data": { "id": "59c406630f79b70034579acd", "type": "org" }, "links": { "self": "/v1/orgs/59c406630f79b70034579acd" } } }, "links": { "self": "/v1/attachments/5da062fb90897d01573e121f" } }, "meta": { "provider": "s3", "upload": { "url": "https://s3.amazonaws.com/kustomer-staging-user-content", "fields": { "key": "attachments/59c406630f79b70034579acd/5da062fb90897d01573e121f-attachment.jpg", "acl": "private", "Content-Type": "image/jpeg", "X-Amz-Meta-Attachment-Id": "5da062fb90897d01573e121f", "bucket": "aws-bucket", "X-Amz-Algorithm": "aws-algorithm", "X-Amz-Credential": "aws-temp-key", "X-Amz-Date": "20180103T180146Z", "Policy": "aws-temp-policy-jwt", "X-Amz-Signature": "aws-temp-signature-value" } } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] }, "put": { "security": [ { "httpBearer": [] } ], "tags": [ "Media" ], "summary": "Update media by ID", "description": "Updates a media object based on the unique media ID.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.media.write|org.permission.kb.update|", "operationId": "UpdateMedia", "parameters": [ { "name": "id", "in": "path", "description": "Unique media object ID.", "required": true, "style": "simple", "schema": { "type": "string", "example": "5da062fb90897d01573e121f" } } ], "requestBody": { "description": "", "content": { "application/json": { "schema": { "type": "object", "title": "Media Update", "description": "Schema for media update operations", "properties": { "name": { "type": "string" }, "redacted": { "type": "boolean" } }, "additionalProperties": false } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string" }, "attributes": { "type": "object", "properties": { "name": { "type": "string" }, "contentType": { "type": "string" }, "contentLength": { "type": "integer" }, "redacted": { "type": "boolean" }, "uploaded": { "type": "boolean" }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "context": { "type": "string" } }, "required": [ "name", "contentType", "contentLength", "redacted", "uploaded", "createdAt", "updatedAt", "context" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string" } }, "required": [ "id", "type" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "data", "links" ] } }, "required": [ "org" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "id", "type", "attributes", "relationships", "links" ] }, "meta": { "type": "object", "properties": { "provider": { "type": "string" }, "upload": { "type": "object", "properties": { "url": { "type": "string" }, "fields": { "type": "object", "properties": { "key": { "type": "string" }, "acl": { "type": "string" }, "Content-Type": { "type": "string" }, "X-Amz-Meta-Attachment-Id": { "type": "string" }, "bucket": { "type": "string" }, "X-Amz-Algorithm": { "type": "string" }, "X-Amz-Credential": { "type": "string" }, "X-Amz-Date": { "type": "string" }, "Policy": { "type": "string" }, "X-Amz-Signature": { "type": "string" } }, "required": [ "key", "acl", "Content-Type", "X-Amz-Meta-Attachment-Id", "bucket", "X-Amz-Algorithm", "X-Amz-Credential", "X-Amz-Date", "Policy", "X-Amz-Signature" ] } }, "required": [ "url", "fields" ] } }, "required": [ "provider", "upload" ] } }, "required": [ "data", "meta" ] }, "example": { "data": { "id": "5da062fb90897d01573e121f", "type": "attachment", "attributes": { "name": "myattachment.jpg", "contentType": "image/jpeg", "contentLength": 512, "redacted": false, "uploaded": false, "createdAt": "2019-10-11T11:09:47.898Z", "updatedAt": "2019-10-11T11:09:47.898Z", "context": "attachment" }, "relationships": { "org": { "data": { "id": "59c406630f79b70034579acd", "type": "org" }, "links": { "self": "/v1/orgs/59c406630f79b70034579acd" } } }, "links": { "self": "/v1/attachments/5da062fb90897d01573e121f" } }, "meta": { "provider": "s3", "upload": { "url": "https://s3.amazonaws.com/kustomer-staging-user-content", "fields": { "key": "attachments/59c406630f79b70034579acd/5da062fb90897d01573e121f-attachment.jpg", "acl": "private", "Content-Type": "image/jpeg", "X-Amz-Meta-Attachment-Id": "5da062fb90897d01573e121f", "bucket": "aws-bucket", "X-Amz-Algorithm": "aws-algorithm", "X-Amz-Credential": "aws-temp-key", "X-Amz-Date": "20180103T180146Z", "Policy": "aws-temp-policy-jwt", "X-Amz-Signature": "aws-temp-signature-value" } } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] } }, "/messages/bulk": { "post": { "security": [ { "httpBearer": [] } ], "tags": [ "Messages (Bulk)" ], "summary": "Bulk create messages", "description": "Creates a bulk batch of messages.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.message.write|org.permission.message.create|", "operationId": "BulkCreateMessages", "parameters": [], "requestBody": { "description": "", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "format": "object-id" }, "externalId": { "type": "string", "maxLength": 256 }, "customer": { "type": "string", "format": "object-id" }, "conversation": { "type": "string", "format": "object-id" }, "reference": { "type": "object", "properties": { "message": { "type": "string", "format": "object-id" }, "type": { "type": "string", "enum": [ "reply", "replyAll", "forward" ] } }, "required": [ "message", "type" ], "additionalProperties": false }, "channel": { "type": "string", "enum": [ "email", "sms", "chat", "facebook", "twitter-dm", "twitter-tweet", "voice", "instagram", "whatsapp" ] }, "preview": { "type": "string", "maxLength": 10240 }, "subject": { "type": "string", "maxLength": 256 }, "direction": { "type": "string", "enum": [ "in", "out" ] }, "app": { "type": "string" }, "size": { "type": "number" }, "related": { "type": "string" }, "status": { "type": "string", "enum": [ "sent", "received", "error" ] }, "error": { "type": "object", "properties": { "status": { "type": "number" }, "code": { "type": "string" }, "title": { "type": "string" }, "detail": { "type": "string" }, "source": { "type": "object" }, "meta": { "type": "object" }, "links": { "type": "object" } }, "additionalProperties": false }, "errorAt": { "type": "string", "format": "date-time" }, "auto": { "type": "boolean", "description": "If true, message was automatically generated from a Kustomer workflow or auto-response feature. If set to true, this message will be excluded from reporting metrics. If false, message was created by a manual method." }, "sentAt": { "type": "string", "format": "date-time" }, "source": { "type": "string", "enum": [ "bulk", "satisfaction" ] }, "shortcuts": { "type": "array", "items": { "type": "string", "format": "object-id" } }, "kbArticles": { "type": "array", "items": { "type": "string", "format": "object-id" } }, "attachments": { "anyOf": [ { "type": "array", "items": { "type": "object", "properties": { "_id": { "type": "string", "format": "object-id" }, "name": { "type": "string" }, "contentType": { "type": "string" }, "contentLength": { "type": "number" }, "sourceId": { "type": "string", "format": "object-id" } }, "required": [ "_id", "name", "contentType", "contentLength" ], "additionalProperties": false }, "uniqueItems": true }, { "type": "array", "items": { "type": "string", "format": "object-id" }, "uniqueItems": true } ] }, "location": { "type": "object", "properties": { "name": { "type": "string" }, "address": { "type": "string", "maxLength": 256 }, "address2": { "type": "string", "maxLength": 256 }, "address3": { "type": "string", "maxLength": 256 }, "latitude": { "type": "number" }, "longitude": { "type": "number" }, "countryCode": { "type": "string", "minLength": 2, "maxLength": 2 }, "countryName": { "type": "string", "maxLength": 64 }, "regionCode": { "type": "string", "maxLength": 2 }, "regionName": { "type": "string", "maxLength": 128 }, "cityName": { "type": "string", "maxLength": 128 }, "zipCode": { "type": "string", "maxLength": 30 }, "areaCode": { "type": "string", "maxLength": 30 } } }, "meta": { "type": "object", "maxProperties": 100 }, "custom": { "type": "object", "maxProperties": 100, "additionalProperties": false }, "sentiment": { "type": "object", "properties": { "polarity": { "type": "number", "enum": [ -1, 0, 1 ] }, "confidence": { "type": "number", "minimum": -1, "maximum": 1 } }, "required": [ "polarity", "confidence" ], "additionalProperties": false }, "createdAt": { "type": "string", "format": "date-time" }, "modifiedAt": { "type": "string", "format": "date-time" }, "createdBy": { "type": "string", "format": "object-id" }, "modifiedBy": { "type": "string", "format": "object-id" }, "importedAt": { "type": "string", "format": "date-time" }, "lang": { "type": "string", "maxLength": 100, "nullable": true }, "queue": { "type": "object", "properties": { "id": { "type": "string", "format": "object-id" }, "external": { "type": "string", "enum": [ "amazon-connect" ] } }, "anyOf": [ { "required": [ "id" ] }, { "required": [ "external" ] } ], "additionalProperties": false } }, "required": [ "channel", "app" ], "additionalProperties": false }, "maxItems": 100 } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "ids": { "type": "array" }, "context": { "type": "string" }, "status": { "type": "string" }, "v2": { "type": "boolean" }, "payload": { "type": "object", "properties": { "api": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "app": { "type": "string" }, "channel": { "type": "string" }, "preview": { "type": "string" }, "subject": { "type": "string" }, "size": { "type": "integer" }, "createdAt": { "type": "string" } }, "required": [ "id", "app", "channel", "preview", "subject", "size", "createdAt" ] } }, "path": { "type": "string" }, "user": { "type": "object", "properties": { "id": { "type": "string" }, "userType": { "type": "string" }, "roles": { "type": "array", "items": { "type": "string" } }, "orgName": { "type": "string" }, "subject": { "type": "string" }, "org": { "type": "string" } }, "required": [ "id", "userType", "roles", "orgName", "subject", "org" ] }, "requestId": { "type": "string" }, "service": { "type": "string" }, "method": { "type": "string" } }, "required": [ "data", "path", "user", "requestId", "service", "method" ] } }, "required": [ "api" ] }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "completed": { "type": "boolean" } }, "required": [ "ids", "context", "status", "v2", "payload", "createdAt", "updatedAt", "completed" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "createdBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "createdBy" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "bulk", "id": "5b3bddb67f8469003df370a4", "attributes": { "ids": [], "context": "api.sobjects.messages.bulk-create", "status": "complete", "v2": true, "payload": { "api": { "data": [ { "id": "57a6082ae92c9510005e35ea", "app": "postmark", "channel": "email", "preview": "Hello, I have a question. Can you help me?", "subject": "Question", "size": 1, "createdAt": "2016-05-22T22:42:44.723Z" } ], "path": "/v1/messages", "user": { "id": "5a96dac46dd73800112fab30", "userType": "user", "roles": [ "org" ], "orgName": "mycompany", "subject": "5a96dac46dd73800112fab30", "org": "5a96dac36dd73800112fab2e" }, "requestId": "5b3bddb6b6e494001779fa38", "service": "sobjects", "method": "POST" } }, "createdAt": "2018-07-03T20:33:58.486Z", "updatedAt": "2018-07-03T20:34:03.873Z", "completed": true }, "relationships": { "org": { "links": { "self": "/v1/orgs/5a96dac36dd73800112fab2e" }, "data": { "type": "org", "id": "5a96dac36dd73800112fab2e" } }, "createdBy": { "links": { "self": "/v1/users/5a96dac46dd73800112fab30" }, "data": { "type": "user", "id": "5a96dac46dd73800112fab30" } } }, "links": { "self": "/v1/bulk/5b3bddb67f8469003df370a4" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] }, "put": { "security": [ { "httpBearer": [] } ], "tags": [ "Messages (Bulk)" ], "summary": "Bulk batch update messages", "description": "Updates a bulk batch of messages.\n\nUse the `ids` query param to update multiple messages in bulk with the same data.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.message.write|org.permission.message.update|", "operationId": "BulkBatchUpdateMessages", "parameters": [ { "schema": { "type": "string", "example": "id1,id2" }, "in": "query", "name": "ids", "description": "Comma-separated list of unique message IDs." } ], "requestBody": { "description": "", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "conversation": { "type": "string" }, "externalId": { "type": "string", "maxLength": 256, "nullable": true }, "preview": { "type": "string", "maxLength": 10240, "nullable": true }, "subject": { "type": "string", "maxLength": 256, "nullable": true }, "status": { "type": "string", "enum": [ "sent", "received", "error" ] }, "error": { "type": "object", "properties": { "status": { "type": "number" }, "code": { "type": "string" }, "title": { "type": "string" }, "detail": { "type": "string" }, "source": { "type": "object" }, "meta": { "type": "object" }, "links": { "type": "object" } }, "additionalProperties": false }, "errorAt": { "type": "string", "format": "date-time" }, "sentAt": { "type": "string", "format": "date-time", "nullable": true }, "size": { "type": "number" }, "attachments": { "type": "array", "items": { "type": "object", "properties": { "_id": { "type": "string", "format": "object-id" }, "name": { "type": "string" }, "contentType": { "type": "string" }, "contentLength": { "type": "number" }, "sourceId": { "type": "string", "format": "object-id" } }, "required": [ "_id", "name", "contentType", "contentLength" ], "additionalProperties": false }, "uniqueItems": true }, "meta": { "type": "object", "maxProperties": 100 }, "custom": { "type": "object", "maxProperties": 100, "additionalProperties": false }, "related": { "type": "string" }, "sentiment": { "type": "object", "properties": { "polarity": { "type": "number", "enum": [ -1, 0, 1 ] }, "confidence": { "type": "number", "minimum": -1, "maximum": 1 } }, "required": [ "polarity", "confidence" ], "additionalProperties": false }, "createdAt": { "type": "string", "format": "date-time" }, "modifiedAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "createdBy": { "type": "string", "format": "object-id" }, "modifiedBy": { "type": "string", "format": "object-id", "nullable": true }, "lang": { "type": "string", "maxLength": 100, "nullable": true } }, "required": [ "id" ] }, "maxItems": 100 } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "ids": { "type": "array" }, "context": { "type": "string" }, "status": { "type": "string" }, "v2": { "type": "boolean" }, "payload": { "type": "object", "properties": { "api": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "custom": { "type": "object", "properties": { "foobar": { "type": "boolean" } }, "required": [ "foobar" ] } }, "required": [ "id", "custom" ] } }, "path": { "type": "string" }, "user": { "type": "object", "properties": { "id": { "type": "string" }, "userType": { "type": "string" }, "roles": { "type": "array", "items": { "type": "string" } }, "orgName": { "type": "string" }, "subject": { "type": "string" }, "org": { "type": "string" } }, "required": [ "id", "userType", "roles", "orgName", "subject", "org" ] }, "requestId": { "type": "string" }, "service": { "type": "string" }, "method": { "type": "string" } }, "required": [ "data", "path", "user", "requestId", "service", "method" ] } }, "required": [ "api" ] }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "completed": { "type": "boolean" } }, "required": [ "ids", "context", "status", "v2", "payload", "createdAt", "updatedAt", "completed" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "createdBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "createdBy" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "bulk", "id": "5b3bddb67f8469003df370a4", "attributes": { "ids": [], "context": "api.sobjects.messages.bulk-create", "status": "complete", "v2": true, "payload": { "api": { "data": [ { "id": "string", "custom": { "foobar": true } } ], "path": "/v1/messages", "user": { "id": "5a96dac46dd73800112fab30", "userType": "user", "roles": [ "org" ], "orgName": "mycompany", "subject": "5a96dac46dd73800112fab30", "org": "5a96dac36dd73800112fab2e" }, "requestId": "5b3bddb6b6e494001779fa38", "service": "sobjects", "method": "PUT" } }, "createdAt": "2018-07-03T20:33:58.486Z", "updatedAt": "2018-07-03T20:34:03.873Z", "completed": true }, "relationships": { "org": { "links": { "self": "/v1/orgs/5a96dac36dd73800112fab2e" }, "data": { "type": "org", "id": "5a96dac36dd73800112fab2e" } }, "createdBy": { "links": { "self": "/v1/users/5a96dac46dd73800112fab30" }, "data": { "type": "user", "id": "5a96dac46dd73800112fab30" } } }, "links": { "self": "/v1/bulk/5b3bddb67f8469003df370a4" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] } }, "/messages/{id}/redactions": { "post": { "security": [ { "httpBearer": [] } ], "tags": [ "Messages" ], "summary": "Redact a message", "description": "Redacts a message.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.admin.message.write|org.permission.message_redaction.create|", "operationId": "RedactMessage", "parameters": [ { "name": "id", "in": "path", "description": "Unique message object ID.", "required": true, "style": "simple", "schema": { "type": "string", "example": "5da062fb90897d01573e121f" } } ], "requestBody": { "description": "", "content": { "application/json": { "schema": { "anyOf": [ { "properties": { "preview": { "type": "string", "maxLength": 10240 } } }, { "properties": { "attachments": { "type": "array", "items": { "type": "string", "format": "object-id" }, "maxItems": 10 } } }, { "properties": { "meta": { "type": "object", "maxProperties": 100 } } } ], "additionalProperties": false, "type": "object" } } } }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string" }, "attributes": { "type": "object", "properties": { "preview": { "type": "string" }, "meta": { "type": "string" } }, "required": [ "preview" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string" } }, "required": [ "id", "type" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "data", "links" ] }, "createdBy": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string" } }, "required": [ "id", "type" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "data", "links" ] }, "message": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string" } }, "required": [ "id", "type" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "data", "links" ] }, "conversation": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string" } }, "required": [ "id", "type" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "data", "links" ] }, "customer": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string" } }, "required": [ "id", "type" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "data", "links" ] }, "attachments": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string" } }, "required": [ "id", "type" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } } }, "required": [ "data", "links" ] } }, "required": [ "org" ] } }, "required": [ "id", "type", "attributes", "relationships" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "", "id": "", "attributes": { "preview": "", "meta": "" }, "relationships": { "org": { "links": { "self": "" }, "data": { "type": "", "id": "" } }, "createdBy": { "links": { "self": "" }, "data": { "type": "", "id": "" } }, "customer": { "links": { "self": "" }, "data": { "type": "", "id": "" } }, "conversation": { "links": { "self": "" }, "data": { "type": "", "id": "" } } }, "links": { "self": "" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] } }, "/messages": { "post": { "security": [ { "httpBearer": [] } ], "tags": [ "Messages" ], "summary": "Create message", "description": "Adds an instance of a message to an existing conversation timeline with a customer. Interactions with a customer that occured via email, SMS, web or mobile chat, Facebook direct messages or comments, Twitter direct messages or Tweets, voice, Instagram direct messages or WhatsApp messages can be added to the conversation timeline.\n\nDoes not sent a message to a customer, only to be used to record the instance of a message. To send a message, first see the [Create a draft by customer endpoint](https://developer.kustomer.com/kustomer-api-docs/reference/createadraftbycustomer).\n\n### Prerequisites\n\nAn existing conversation must be created to add the message. See the [Create conversation](https://developer.kustomer.com/kustomer-api-docs/reference/createaconversation) or [Bulk create conversations](https://developer.kustomer.com/kustomer-api-docs/reference/bulkcreateconversationshttps://developer.kustomer.com/kustomer-api-docs/reference/bulkcreateconversations) or [Create conversation for customer](https://developer.kustomer.com/kustomer-api-docs/reference/createaconversationforacustomer) endpoints.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.message.write|org.permission.message.create|\n\n### Rate limit\nMessages are subject to a rate limit. A single client can create up to 120 messages per minute per customer.\n\nMessages with `importedAt` in their body will not be subject to the rate limit.\n\nA `429 Too Many Requests` response will be returned if the rate limit has been reached for a customer.", "operationId": "CreateMessage", "parameters": [], "requestBody": { "description": "", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string", "format": "object-id" }, "externalId": { "type": "string", "maxLength": 256, "description": "The unique identifier from the channel the message. For example, a message ID from Instagram for a specific DM." }, "customer": { "type": "string", "format": "object-id", "description": "The customer's name" }, "conversation": { "type": "string", "format": "object-id", "description": "The conversation ID of the conversation message is to be added to." }, "reference": { "type": "object", "properties": { "message": { "type": "string", "format": "object-id", "description": "For email channel only. The unique message ID for an email that is a reply, reply-all, or forward." }, "type": { "type": "string", "description": "Indicate if the message is a reply, reply-all, or forward.", "enum": [ "reply", "replyAll", "forward" ] } }, "required": [ "message", "type" ], "additionalProperties": false }, "channel": { "description": "The communication channel of the message: email, SMS, chat, facebook, twitter-dm, twitter-tweet, voice, instagram, whatsapp", "type": "string", "enum": [ "email", "sms", "chat", "facebook", "twitter-dm", "twitter-tweet", "voice", "instagram", "whatsapp" ] }, "preview": { "type": "string", "maxLength": 10240 }, "subject": { "type": "string", "maxLength": 256 }, "direction": { "description": "Indicates if the message is coming in from a customer or sent out by an agent.", "type": "string", "enum": [ "in", "out" ] }, "app": { "type": "string" }, "size": { "type": "number" }, "related": { "type": "string" }, "status": { "type": "string", "enum": [ "sent", "received", "error" ] }, "error": { "type": "object", "properties": { "status": { "type": "number" }, "code": { "type": "string" }, "title": { "type": "string" }, "detail": { "type": "string" }, "source": { "type": "object" }, "meta": { "type": "object" }, "links": { "type": "object" } }, "additionalProperties": false }, "errorAt": { "description": "The timestamp for when the message errored out.", "type": "string", "format": "date-time" }, "auto": { "description": "If true, message was automatically generated from a Kustomer workflow or auto-response feature. If set to true, this message will be excluded from reporting metrics. If false, message was created by a manual method.", "type": "boolean" }, "sentAt": { "type": "string", "format": "date-time", "description": "The timestamp for when the message was sent." }, "source": { "description": "Indicate if the message is part of a bulk message (bulk) or CSAT (Customer Satisfaction Survey) (satisfaction) message.", "type": "string", "enum": [ "bulk", "satisfaction" ] }, "shortcuts": { "type": "array", "items": { "type": "string", "format": "object-id" } }, "kbArticles": { "type": "array", "items": { "type": "string", "format": "object-id" } }, "attachments": { "anyOf": [ { "type": "array", "items": { "type": "object", "properties": { "_id": { "type": "string", "format": "object-id" }, "name": { "type": "string" }, "contentType": { "type": "string" }, "contentLength": { "type": "number" }, "sourceId": { "type": "string", "format": "object-id" } }, "required": [ "_id", "name", "contentType", "contentLength" ], "additionalProperties": false }, "uniqueItems": true }, { "type": "array", "items": { "type": "string", "format": "object-id" }, "uniqueItems": true } ] }, "location": { "type": "object", "properties": { "name": { "type": "string" }, "address": { "type": "string", "maxLength": 256 }, "address2": { "type": "string", "maxLength": 256 }, "address3": { "type": "string", "maxLength": 256 }, "latitude": { "type": "number" }, "longitude": { "type": "number" }, "countryCode": { "type": "string", "minLength": 2, "maxLength": 2 }, "countryName": { "type": "string", "maxLength": 64 }, "regionCode": { "type": "string", "maxLength": 2 }, "regionName": { "type": "string", "maxLength": 128 }, "cityName": { "type": "string", "maxLength": 128 }, "zipCode": { "type": "string", "maxLength": 30 }, "areaCode": { "type": "string", "maxLength": 30 } } }, "meta": { "type": "object", "maxProperties": 100 }, "custom": { "type": "object", "maxProperties": 100, "additionalProperties": false }, "sentiment": { "type": "object", "properties": { "polarity": { "type": "number", "enum": [ -1, 0, 1 ] }, "confidence": { "type": "number", "minimum": -1, "maximum": 1 } }, "required": [ "polarity", "confidence" ], "additionalProperties": false }, "createdAt": { "type": "string", "format": "date-time" }, "modifiedAt": { "type": "string", "format": "date-time" }, "createdBy": { "type": "string", "format": "object-id" }, "modifiedBy": { "type": "string", "format": "object-id" }, "importedAt": { "type": "string", "format": "date-time" }, "lang": { "type": "string", "maxLength": 100, "nullable": true, "description": "The language the message is in." }, "queue": { "type": "object", "properties": { "id": { "type": "string", "format": "object-id" }, "external": { "type": "string", "enum": [ "amazon-connect" ] } }, "anyOf": [ { "required": [ "id" ] }, { "required": [ "external" ] } ], "additionalProperties": false } }, "required": [ "channel", "app", "direction" ], "additionalProperties": false } } } }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "channel": { "type": "string" }, "app": { "type": "string" }, "size": { "type": "string" }, "direction": { "type": "string" }, "preview": { "type": "string" }, "subject": { "type": "string" }, "meta": { "type": "string" }, "status": { "type": "string" }, "sentAt": { "type": "string" }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "modifiedAt": { "type": "string" }, "lang": { "type": "string" } }, "required": [ "channel", "app", "size", "direction", "preview", "subject", "meta", "status", "sentAt", "createdAt", "updatedAt", "modifiedAt", "lang" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "createdBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "modifiedBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "customer": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "conversation": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "createdBy", "modifiedBy", "customer", "conversation" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "", "id": "", "attributes": { "channel": "", "app": "", "size": "", "direction": "", "preview": "", "subject": "", "meta": "", "status": "", "sentAt": "", "createdAt": "", "updatedAt": "", "modifiedAt": "", "lang": "" }, "relationships": { "org": { "links": { "self": "" }, "data": { "type": "", "id": "" } }, "createdBy": { "links": { "self": "" }, "data": { "type": "", "id": "" } }, "modifiedBy": { "links": { "self": "" }, "data": { "type": "", "id": "" } }, "customer": { "links": { "self": "" }, "data": { "type": "", "id": "" } }, "conversation": { "links": { "self": "" }, "data": { "type": "", "id": "" } } }, "links": { "self": "" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] }, "get": { "security": [ { "httpBearer": [] } ], "tags": [ "Messages" ], "summary": "Get messages", "description": "Retrieves [messages](https://help.kustomer.com/message-options-H1tSk3QOI) for your Kustomer organization.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.message.read|org.permission.message.read|", "operationId": "GetMessages", "parameters": [ { "name": "page", "in": "query", "schema": { "type": "number", "default": 1, "example": 1 }, "description": "Number of pages to return for results. Default value: 1." }, { "name": "pageSize", "in": "query", "required": false, "schema": { "type": "number", "default": 100, "example": 100 }, "description": "Number of results to return per page. Default value: 100." }, { "name": "include", "in": "query", "required": false, "schema": { "type": "string", "example": "attachments" }, "description": "List of resources to include in this response. Use a comma to separate resources. Supports the `attachments` resource. " }, { "schema": { "type": "string", "example": "desc" }, "in": "query", "name": "sort", "description": "Option to sort results in descending order." } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "meta": { "type": "object", "properties": { "pageSize": { "type": "integer" }, "page": { "type": "integer" } }, "required": [ "pageSize", "page" ] }, "data": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "externalId": { "type": "string" }, "channel": { "type": "string" }, "app": { "type": "string" }, "size": { "type": "integer" }, "direction": { "type": "string" }, "preview": { "type": "string" }, "sentiment": { "type": "object" }, "meta": { "type": "object", "properties": { "inReplyTo": { "type": "string" }, "recipient": { "type": "object", "properties": { "mailboxHash": { "type": "string" }, "email": { "type": "string" } }, "required": [ "mailboxHash", "email" ] }, "cc": { "type": "array" }, "to": { "type": "array", "items": { "type": "object", "properties": { "email": { "type": "string" } }, "required": [ "email" ] } }, "from": { "type": "string" }, "subject": { "type": "string" } }, "required": [ "inReplyTo", "recipient", "cc", "to", "from", "subject" ] }, "status": { "type": "string" }, "sentAt": { "type": "string" }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" } }, "required": [ "externalId", "channel", "app", "size", "direction", "preview", "sentiment", "meta", "status", "sentAt", "createdAt", "updatedAt" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "customer": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "conversation": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "customer", "conversation" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" }, "related": { "type": "string" } }, "required": [ "self", "related" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "links": { "type": "object", "properties": { "self": { "type": "string" }, "first": { "type": "string" }, "prev": { "type": "string", "nullable": true }, "next": { "type": "string", "nullable": true } }, "required": [ "self", "first", "prev", "next" ] } }, "required": [ "meta", "data", "links" ] }, "example": { "meta": { "pageSize": 100, "page": 1 }, "data": [ { "type": "message", "id": "57c8d2b01a57ed1400392073", "attributes": { "externalId": "", "channel": "email", "app": "postmark", "size": 0, "direction": "in", "preview": "Can you please help me?", "sentiment": {}, "meta": { "inReplyTo": "", "recipient": { "mailboxHash": "", "email": "support@kustomer.com" }, "cc": [], "to": [ { "email": "support@kustomer.com" } ], "from": "jeremy@kustomer.com", "subject": "Re: hey" }, "status": "received", "sentAt": "2016-09-02T01:15:14.000Z", "createdAt": "2016-09-02T01:15:31.140Z", "updatedAt": "2016-09-02T01:15:31.140Z" }, "relationships": { "org": { "links": { "self": "/v1/orgs/57bb5d2e32e83a130052e94e" }, "data": { "type": "org", "id": "57bb5d2e32e83a130052e94e" } }, "customer": { "links": { "self": "/v1/customers/57c08ccde595371400462df2" }, "data": { "type": "customers", "id": "57c08ccde595371400462df2" } }, "conversation": { "links": { "self": "/v1/conversations/57c8d2b365f7cc14004e674f" }, "data": { "type": "conversation", "id": "57c8d2b365f7cc14004e674f" } } }, "links": { "self": "/v1/messages/57c8d2b01a57ed1400392073", "related": "/v1/postmark/messages/57c8d2b01a57ed1400392073" } } ], "links": { "self": "/v1/messages?page=1&pageSize=100", "first": "/v1/messages?page=1&pageSize=100", "prev": null, "next": null } } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "properties": { "status": { "type": "string" }, "code": { "type": "string" }, "title": { "type": "string" }, "source": { "type": "object", "properties": { "parameters": { "type": "string" } }, "required": [ "parameters" ] } }, "required": [ "status", "code", "title", "source" ] } } }, "required": [ "errors" ] }, "example": { "errors": [ { "status": "", "code": "", "title": "", "source": { "parameters": "" } }, { "status": "", "code": "", "title": "", "source": { "parameters": "" } } ] } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] } }, "/messages/{id}": { "get": { "security": [ { "httpBearer": [] } ], "tags": [ "Messages" ], "summary": "Get message by ID", "description": "Retrieves a single message based on the unique message ID.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.message.read|org.permission.message.read|", "operationId": "GetMessage", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "externalId": { "type": "string" }, "channel": { "type": "string" }, "app": { "type": "string" }, "size": { "type": "integer" }, "direction": { "type": "string" }, "preview": { "type": "string" }, "sentiment": { "type": "object", "properties": { "confidence": { "type": "integer" }, "polarity": { "type": "integer" } }, "required": [ "confidence", "polarity" ] }, "meta": { "type": "object", "properties": { "subject": { "type": "string" }, "from": { "type": "string" }, "to": { "type": "array", "items": { "type": "object", "properties": { "email": { "type": "string" } }, "required": [ "email" ] } }, "cc": { "type": "array" }, "recipient": { "type": "object", "properties": { "email": { "type": "string" }, "mailboxHash": { "type": "string" } }, "required": [ "email", "mailboxHash" ] }, "inReplyTo": { "type": "string" } }, "required": [ "subject", "from", "to", "cc", "recipient", "inReplyTo" ] }, "status": { "type": "string" }, "lang": { "type": "string" }, "sentAt": { "type": "string" }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "modifiedAt": { "type": "string" } }, "required": [ "externalId", "channel", "app", "size", "direction", "preview", "sentiment", "meta", "status", "lang", "sentAt", "createdAt", "updatedAt", "modifiedAt" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "modifiedBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "customer": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "conversation": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "modifiedBy", "customer", "conversation" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" }, "related": { "type": "string" } }, "required": [ "self", "related" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "message", "id": "57c8d2b01a57ed1400392073", "attributes": { "externalId": "", "channel": "email", "app": "postmark", "size": 0, "direction": "in", "preview": "Can you please help me?", "sentiment": { "confidence": 1, "polarity": 1 }, "meta": { "subject": "Re: hey", "from": "jeremy@kustomer.com", "to": [ { "email": "support@kustomer.com" } ], "cc": [], "recipient": { "email": "support@kustomer.com", "mailboxHash": "" }, "inReplyTo": "" }, "status": "received", "lang": "zh_cn", "sentAt": "2016-09-02T01:15:14.000Z", "createdAt": "2016-09-02T01:15:31.140Z", "updatedAt": "2016-11-13T16:34:12.214Z", "modifiedAt": "2016-11-13T16:34:12.214Z" }, "relationships": { "org": { "links": { "self": "/v1/orgs/57bb5d2e32e83a130052e94e" }, "data": { "type": "org", "id": "57bb5d2e32e83a130052e94e" } }, "modifiedBy": { "links": { "self": "/v1/users/57bb5d2e32e83a130052e94f" }, "data": { "type": "user", "id": "57bb5d2e32e83a130052e94f" } }, "customer": { "links": { "self": "/v1/customers/57c08ccde595371400462df2" }, "data": { "type": "customers", "id": "57c08ccde595371400462df2" } }, "conversation": { "links": { "self": "/v1/conversations/57c8d2b365f7cc14004e674f" }, "data": { "type": "conversation", "id": "57c8d2b365f7cc14004e674f" } } }, "links": { "self": "/v1/messages/57c8d2b01a57ed1400392073", "related": "/v1/postmark/messages/57c8d2b01a57ed1400392073" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] }, "put": { "security": [ { "httpBearer": [] } ], "tags": [ "Messages" ], "summary": "Update message by ID", "description": "Updates a message based on the unique message ID.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.message.write|org.permission.message.update|\n\n### Note\n> This endpoint is subject to Object Rate Limiting, which limits how many updates single user can make to a single message. To learn more, see [Rate limiting](https://developer.kustomer.com/kustomer-api-docs/reference/rate-limiting).\n\n### Authorization\n> The `org.admin` role is required for setting `createdAt`, `createdBy`, `modifiedAt`, and `modifiedBy`. Otherwise, these attributes are automatically set by the token.\n\n### Custom Attributes\n\n[Custom attributes](https://help.kustomer.com/define-attributes-Skr924HI) are optional and allow you to specify custom key-value pairs.\n\nKustomer uses a naming convention for custom attributes to specify the field data type with a name suffix:\n\n#### Naming Suffix\n\n* `Num` *number* or *null*\n* `At` *date-time* or *null*\n* `Str` *string* or *null*, length: [ 0 .. 1024 ] characters\n* `Txt` *string* or *null*, length: [ 0 .. 1024 ] characters\n* `Bool` *boolean* or *null*\n* `Url` *string* or *null*, format: *uri*", "operationId": "UpdateMessage", "requestBody": { "description": "", "content": { "application/json": { "schema": { "type": "object", "properties": { "conversation": { "type": "string" }, "externalId": { "type": "string", "maxLength": 256, "nullable": true }, "preview": { "type": "string", "maxLength": 10240, "nullable": true }, "subject": { "type": "string", "maxLength": 256, "nullable": true }, "status": { "type": "string", "enum": [ "sent", "received", "error" ] }, "error": { "type": "object", "properties": { "status": { "type": "number" }, "code": { "type": "string" }, "title": { "type": "string" }, "detail": { "type": "string" }, "source": { "type": "object" }, "meta": { "type": "object" }, "links": { "type": "object" } }, "additionalProperties": false }, "errorAt": { "type": "string", "format": "date-time" }, "sentAt": { "type": "string", "format": "date-time", "nullable": true }, "size": { "type": "number" }, "attachments": { "type": "array", "items": { "type": "object", "properties": { "_id": { "type": "string", "format": "object-id" }, "name": { "type": "string" }, "contentType": { "type": "string" }, "contentLength": { "type": "number" }, "sourceId": { "type": "string", "format": "object-id" } }, "required": [ "_id", "name", "contentType", "contentLength" ], "additionalProperties": false }, "uniqueItems": true }, "meta": { "type": "object", "maxProperties": 100 }, "custom": { "type": "object", "maxProperties": 100, "additionalProperties": false }, "related": { "type": "string" }, "sentiment": { "type": "object", "properties": { "polarity": { "type": "number", "enum": [ -1, 0, 1 ] }, "confidence": { "type": "number", "minimum": -1, "maximum": 1 } }, "required": [ "polarity", "confidence" ], "additionalProperties": false }, "createdAt": { "type": "string", "format": "date-time" }, "modifiedAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "createdBy": { "type": "string", "format": "object-id" }, "spam": { "type": "boolean" }, "modifiedBy": { "type": "string", "format": "object-id", "nullable": true }, "lang": { "type": "string", "maxLength": 100, "nullable": true }, "reactions": { "type": "array", "items": { "type": "object", "properties": { "subjectId": { "type": "string", "format": "object-id" }, "subjectType": { "type": "string", "enum": [ "customer", "user" ] }, "name": { "type": "string", "enum": [ "love" ] }, "createdAt": { "type": "string", "format": "date-time" } }, "required": [ "subjectId", "subjectType", "name" ], "additionalProperties": false }, "maxItems": 100, "uniqueItems": true } }, "additionalProperties": false } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "externalId": { "type": "string" }, "channel": { "type": "string" }, "app": { "type": "string" }, "size": { "type": "integer" }, "direction": { "type": "string" }, "preview": { "type": "string" }, "sentiment": { "type": "object", "properties": { "confidence": { "type": "integer" }, "polarity": { "type": "integer" } }, "required": [ "confidence", "polarity" ] }, "meta": { "type": "object", "properties": { "subject": { "type": "string" }, "from": { "type": "string" }, "to": { "type": "array", "items": { "type": "object", "properties": { "email": { "type": "string" } }, "required": [ "email" ] } }, "cc": { "type": "array" }, "recipient": { "type": "object", "properties": { "email": { "type": "string" }, "mailboxHash": { "type": "string" } }, "required": [ "email", "mailboxHash" ] }, "inReplyTo": { "type": "string" } }, "required": [ "subject", "from", "to", "cc", "recipient", "inReplyTo" ] }, "status": { "type": "string" }, "lang": { "type": "string" }, "sentAt": { "type": "string" }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "modifiedAt": { "type": "string" } }, "required": [ "externalId", "channel", "app", "size", "direction", "preview", "sentiment", "meta", "status", "lang", "sentAt", "createdAt", "updatedAt", "modifiedAt" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "modifiedBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "customer": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "conversation": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "modifiedBy", "customer", "conversation" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" }, "related": { "type": "string" } }, "required": [ "self", "related" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "message", "id": "57c8d2b01a57ed1400392073", "attributes": { "externalId": "", "channel": "email", "app": "postmark", "size": 0, "direction": "in", "preview": "Can you please help me?", "sentiment": { "confidence": 1, "polarity": 1 }, "meta": { "subject": "Re: hey", "from": "jeremy@kustomer.com", "to": [ { "email": "support@kustomer.com" } ], "cc": [], "recipient": { "email": "support@kustomer.com", "mailboxHash": "" }, "inReplyTo": "" }, "status": "received", "lang": "en_us", "sentAt": "2016-09-02T01:15:14.000Z", "createdAt": "2016-09-02T01:15:31.140Z", "updatedAt": "2016-11-13T16:34:12.214Z", "modifiedAt": "2016-11-13T16:34:12.214Z" }, "relationships": { "org": { "links": { "self": "/v1/orgs/57bb5d2e32e83a130052e94e" }, "data": { "type": "org", "id": "57bb5d2e32e83a130052e94e" } }, "modifiedBy": { "links": { "self": "/v1/users/57bb5d2e32e83a130052e94f" }, "data": { "type": "user", "id": "57bb5d2e32e83a130052e94f" } }, "customer": { "links": { "self": "/v1/customers/57c08ccde595371400462df2" }, "data": { "type": "customers", "id": "57c08ccde595371400462df2" } }, "conversation": { "links": { "self": "/v1/conversations/57c8d2b365f7cc14004e674f" }, "data": { "type": "conversation", "id": "57c8d2b365f7cc14004e674f" } } }, "links": { "self": "/v1/messages/57c8d2b01a57ed1400392073", "related": "/v1/postmark/messages/57c8d2b01a57ed1400392073" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ], "parameters": [ { "name": "replace", "in": "query", "required": false, "schema": { "type": "boolean", "example": true, "default": false }, "description": "Set to `true` to update the document. Otherwise, performs the same update as a PATCH request. Default value: `false`." } ] }, "patch": { "security": [ { "httpBearer": [] } ], "tags": [ "Messages" ], "summary": "Update message attributes by ID", "description": "Updates attributes for a message based on the unique message ID.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.message.write|org.permission.message.update|\n\n### Note\n> This endpoint is subject to Object Rate Limiting, which limits how many updates single user can make to a single message. To learn more, see [Rate limiting](https://developer.kustomer.com/kustomer-api-docs/reference/rate-limiting).\n\n### Authorization\n> The `org.admin` role is required for setting `createdAt`, `createdBy`, `modifiedAt`, and `modifiedBy`. Otherwise, these attributes are automatically set by the token.\n\n### Custom Attributes\n\n[Custom attributes](https://help.kustomer.com/define-attributes-Skr924HI) are optional and allow you to specify custom key-value pairs.\n\nKustomer uses a naming convention for custom attributes to specify the field data type with a name suffix:\n\n#### Naming Suffix\n\n* `Num` *number* or *null*\n* `At` *date-time* or *null*\n* `Str` *string* or *null*, length: [ 0 .. 1024 ] characters\n* `Txt` *string* or *null*, length: [ 0 .. 1024 ] characters\n* `Bool` *boolean* or *null*\n* `Url` *string* or *null*, format: *uri*", "operationId": "UpdateMessageAttributes", "requestBody": { "description": "", "content": { "application/json": { "schema": { "type": "object", "properties": { "conversation": { "type": "string" }, "externalId": { "type": "string", "maxLength": 256, "nullable": true }, "preview": { "type": "string", "maxLength": 10240, "nullable": true }, "subject": { "type": "string", "maxLength": 256, "nullable": true }, "status": { "type": "string", "enum": [ "sent", "received", "error" ] }, "error": { "type": "object", "properties": { "status": { "type": "number" }, "code": { "type": "string" }, "title": { "type": "string" }, "detail": { "type": "string" }, "source": { "type": "object" }, "meta": { "type": "object" }, "links": { "type": "object" } }, "additionalProperties": false }, "errorAt": { "type": "string", "format": "date-time" }, "sentAt": { "type": "string", "format": "date-time", "nullable": true }, "size": { "type": "number" }, "attachments": { "type": "array", "items": { "type": "object", "properties": { "_id": { "type": "string", "format": "object-id" }, "name": { "type": "string" }, "contentType": { "type": "string" }, "contentLength": { "type": "number" }, "sourceId": { "type": "string", "format": "object-id" } }, "required": [ "_id", "name", "contentType", "contentLength" ], "additionalProperties": false }, "uniqueItems": true }, "meta": { "type": "object", "maxProperties": 100 }, "custom": { "type": "object", "maxProperties": 100, "additionalProperties": false }, "related": { "type": "string" }, "sentiment": { "type": "object", "properties": { "polarity": { "type": "number", "enum": [ -1, 0, 1 ] }, "confidence": { "type": "number", "minimum": -1, "maximum": 1 } }, "required": [ "polarity", "confidence" ], "additionalProperties": false }, "createdAt": { "type": "string", "format": "date-time" }, "modifiedAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "createdBy": { "type": "string", "format": "object-id" }, "modifiedBy": { "type": "string", "format": "object-id", "nullable": true }, "lang": { "type": "string", "maxLength": 100, "nullable": true } }, "additionalProperties": false } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "externalId": { "type": "string" }, "channel": { "type": "string" }, "app": { "type": "string" }, "size": { "type": "integer" }, "direction": { "type": "string" }, "preview": { "type": "string" }, "sentiment": { "type": "object", "properties": { "confidence": { "type": "integer" }, "polarity": { "type": "integer" } }, "required": [ "confidence", "polarity" ] }, "meta": { "type": "object", "properties": { "subject": { "type": "string" }, "from": { "type": "string" }, "to": { "type": "array", "items": { "type": "object", "properties": { "email": { "type": "string" } }, "required": [ "email" ] } }, "cc": { "type": "array" }, "recipient": { "type": "object", "properties": { "email": { "type": "string" }, "mailboxHash": { "type": "string" } }, "required": [ "email", "mailboxHash" ] }, "inReplyTo": { "type": "string" } }, "required": [ "subject", "from", "to", "cc", "recipient", "inReplyTo" ] }, "status": { "type": "string" }, "lang": { "type": "string", "nullable": true }, "sentAt": { "type": "string" }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "modifiedAt": { "type": "string" } }, "required": [ "externalId", "channel", "app", "size", "direction", "preview", "sentiment", "meta", "status", "lang", "sentAt", "createdAt", "updatedAt", "modifiedAt" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "modifiedBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "customer": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "conversation": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "modifiedBy", "customer", "conversation" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" }, "related": { "type": "string" } }, "required": [ "self", "related" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "message", "id": "57c8d2b01a57ed1400392073", "attributes": { "externalId": "", "channel": "email", "app": "postmark", "size": 0, "direction": "in", "preview": "Can you please help me?", "sentiment": { "confidence": 1, "polarity": 1 }, "meta": { "subject": "Re: hey", "from": "jeremy@kustomer.com", "to": [ { "email": "support@kustomer.com" } ], "cc": [], "recipient": { "email": "support@kustomer.com", "mailboxHash": "" }, "inReplyTo": "" }, "status": "received", "lang": null, "sentAt": "2016-09-02T01:15:14.000Z", "createdAt": "2016-09-02T01:15:31.140Z", "updatedAt": "2016-11-13T16:34:12.214Z", "modifiedAt": "2016-11-13T16:34:12.214Z" }, "relationships": { "org": { "links": { "self": "/v1/orgs/57bb5d2e32e83a130052e94e" }, "data": { "type": "org", "id": "57bb5d2e32e83a130052e94e" } }, "modifiedBy": { "links": { "self": "/v1/users/57bb5d2e32e83a130052e94f" }, "data": { "type": "user", "id": "57bb5d2e32e83a130052e94f" } }, "customer": { "links": { "self": "/v1/customers/57c08ccde595371400462df2" }, "data": { "type": "customers", "id": "57c08ccde595371400462df2" } }, "conversation": { "links": { "self": "/v1/conversations/57c8d2b365f7cc14004e674f" }, "data": { "type": "conversation", "id": "57c8d2b365f7cc14004e674f" } } }, "links": { "self": "/v1/messages/57c8d2b01a57ed1400392073", "related": "/v1/postmark/messages/57c8d2b01a57ed1400392073" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] }, "parameters": [ { "schema": { "type": "string", "example": "57c8d2b01a57ed1400392073" }, "name": "id", "in": "path", "required": true, "description": "Unique message ID." } ] }, "/messages/externalid=:externalId": { "get": { "security": [ { "httpBearer": [] } ], "tags": [ "Messages" ], "summary": "Get a Message by External ID", "description": "Retrieves a single message using its unique external message ID.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.message.read|org.permission.message.read|\n\n| Key\t\t| Value\t\t| Description\t\t|\n|-|-|-|\n| externalID\t| string\t| Unique external ID of the message.\t|", "operationId": "GetMessageByExternalID", "parameters": [], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "externalId": { "type": "string" }, "channel": { "type": "string" }, "app": { "type": "string" }, "size": { "type": "integer" }, "direction": { "type": "string" }, "preview": { "type": "string" }, "sentiment": { "type": "object", "properties": { "confidence": { "type": "integer" }, "polarity": { "type": "integer" } }, "required": [ "confidence", "polarity" ] }, "meta": { "type": "object", "properties": { "subject": { "type": "string" }, "from": { "type": "string" }, "to": { "type": "array", "items": { "type": "object", "properties": { "email": { "type": "string" } }, "required": [ "email" ] } }, "cc": { "type": "array" }, "recipient": { "type": "object", "properties": { "email": { "type": "string" }, "mailboxHash": { "type": "string" } }, "required": [ "email", "mailboxHash" ] }, "inReplyTo": { "type": "string" } }, "required": [ "subject", "from", "to", "cc", "recipient", "inReplyTo" ] }, "status": { "type": "string" }, "sentAt": { "type": "string" }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "modifiedAt": { "type": "string" } }, "required": [ "externalId", "channel", "app", "size", "direction", "preview", "sentiment", "meta", "status", "sentAt", "createdAt", "updatedAt", "modifiedAt" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "modifiedBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "customer": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "conversation": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "modifiedBy", "customer", "conversation" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" }, "related": { "type": "string" } }, "required": [ "self", "related" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "message", "id": "57c8d2b01a57ed1400392073", "attributes": { "externalId": "", "channel": "email", "app": "postmark", "size": 0, "direction": "in", "preview": "Can you please help me?", "sentiment": { "confidence": 1, "polarity": 1 }, "meta": { "subject": "Re: hey", "from": "jeremy@kustomer.com", "to": [ { "email": "support@kustomer.com" } ], "cc": [], "recipient": { "email": "support@kustomer.com", "mailboxHash": "" }, "inReplyTo": "" }, "status": "received", "sentAt": "2016-09-02T01:15:14.000Z", "createdAt": "2016-09-02T01:15:31.140Z", "updatedAt": "2016-11-13T16:34:12.214Z", "modifiedAt": "2016-11-13T16:34:12.214Z" }, "relationships": { "org": { "links": { "self": "/v1/orgs/57bb5d2e32e83a130052e94e" }, "data": { "type": "org", "id": "57bb5d2e32e83a130052e94e" } }, "modifiedBy": { "links": { "self": "/v1/users/57bb5d2e32e83a130052e94f" }, "data": { "type": "user", "id": "57bb5d2e32e83a130052e94f" } }, "customer": { "links": { "self": "/v1/customers/57c08ccde595371400462df2" }, "data": { "type": "customers", "id": "57c08ccde595371400462df2" } }, "conversation": { "links": { "self": "/v1/conversations/57c8d2b365f7cc14004e674f" }, "data": { "type": "conversation", "id": "57c8d2b365f7cc14004e674f" } } }, "links": { "self": "/v1/messages/57c8d2b01a57ed1400392073", "related": "/v1/postmark/messages/57c8d2b01a57ed1400392073" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] } }, "/notes/bulk": { "post": { "security": [ { "httpBearer": [] } ], "tags": [ "Notes (Bulk)" ], "summary": "Bulk create notes", "description": "Creates a bulk batch of notes.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.note.write|org.permission.note.create|", "operationId": "BulkCreateNotes", "parameters": [], "requestBody": { "description": "", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "conversation": { "type": "string" }, "externalId": { "type": "string", "maxLength": 256 }, "body": { "type": "string", "minLength": 1, "maxLength": 10240 }, "userMentions": { "type": "array", "maxItems": 20, "items": { "type": "object", "properties": { "user": { "type": "string" }, "team": { "type": "string" } } } }, "attachments": { "type": "array", "items": { "type": "object", "properties": { "_id": { "type": "string", "format": "object-id" }, "name": { "type": "string" }, "contentType": { "type": "string" }, "contentLength": { "type": "number" }, "sourceId": { "type": "string", "format": "object-id" } }, "required": [ "_id", "name", "contentType", "contentLength" ], "additionalProperties": false }, "uniqueItems": true }, "createdAt": { "type": "string", "format": "date-time" }, "modifiedAt": { "type": "string", "format": "date-time" }, "createdBy": { "type": "string", "format": "object-id" }, "modifiedBy": { "type": "string", "format": "object-id" }, "importedAt": { "type": "string", "format": "date-time" }, "lang": { "type": "string", "maxLength": 100, "nullable": true } }, "required": [ "conversation", "body" ], "additionalProperties": false }, "maxItems": 100 } } } }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "ids": { "type": "array" }, "context": { "type": "string" }, "status": { "type": "string" }, "v2": { "type": "boolean" }, "payload": { "type": "object", "properties": { "api": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "conversation": { "type": "string" }, "body": { "type": "string" }, "userMentions": { "type": "array", "items": { "type": "object", "properties": { "user": { "type": "string" }, "team": { "type": "string" } } } } }, "required": [ "conversation", "body", "userMentions" ] } }, "path": { "type": "string" }, "user": { "type": "object", "properties": { "id": { "type": "string" }, "userType": { "type": "string" }, "roles": { "type": "array", "items": { "type": "string" } }, "orgName": { "type": "string" }, "subject": { "type": "string" }, "org": { "type": "string" } }, "required": [ "id", "userType", "roles", "orgName", "subject", "org" ] }, "requestId": { "type": "string" }, "service": { "type": "string" }, "method": { "type": "string" } }, "required": [ "data", "path", "user", "requestId", "service", "method" ] } }, "required": [ "api" ] }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "completed": { "type": "boolean" } }, "required": [ "ids", "context", "status", "v2", "payload", "createdAt", "updatedAt", "completed" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "createdBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "createdBy" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "bulk", "id": "5b3bddb67f8469003df370a4", "attributes": { "ids": [], "context": "api.sobjects.notes.bulk-create", "status": "complete", "v2": true, "payload": { "api": { "data": [ { "conversation": "57c8ccd7b417854d0003246a", "body": "Hey __Agent Smith__, do you know the answer to this problem?", "userMentions": [ { "user": "57c8ccd7b417854d0003246b" }, { "team": "57c8ccd7b417854d0003246c" } ] } ], "path": "/v1/notes", "user": { "id": "5a96dac46dd73800112fab30", "userType": "user", "roles": [ "org" ], "orgName": "mycompany", "subject": "5a96dac46dd73800112fab30", "org": "5a96dac36dd73800112fab2e" }, "requestId": "5b3bddb6b6e494001779fa38", "service": "sobjects", "method": "POST" } }, "createdAt": "2018-07-03T20:33:58.486Z", "updatedAt": "2018-07-03T20:34:03.873Z", "completed": true }, "relationships": { "org": { "links": { "self": "/v1/orgs/5a96dac36dd73800112fab2e" }, "data": { "type": "org", "id": "5a96dac36dd73800112fab2e" } }, "createdBy": { "links": { "self": "/v1/users/5a96dac46dd73800112fab30" }, "data": { "type": "user", "id": "5a96dac46dd73800112fab30" } } }, "links": { "self": "/v1/bulk/5b3bddb67f8469003df370a4" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] }, "put": { "security": [ { "httpBearer": [] } ], "tags": [ "Notes (Bulk)" ], "summary": "Bulk batch update notes", "description": "Updates a bulk batch of notes.\n\nUse the `ids` query param to update multiple notes in bulk with the same data.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.note.write|org.permission.note.update|", "operationId": "BulkBatchUpdateNotes", "parameters": [ { "schema": { "type": "string", "example": "id1,id2" }, "in": "query", "name": "ids", "description": "Comma-separated list of unique note IDs." } ], "requestBody": { "description": "", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "conversation": { "type": "string" }, "externalId": { "type": "string", "maxLength": 256, "nullable": true }, "body": { "type": "string", "minLength": 1, "maxLength": 10240 }, "userMentions": { "type": "array", "items": { "type": "object", "properties": { "user": { "type": "string" }, "team": { "type": "string" } } } }, "deleted": { "type": "boolean", "nullable": true }, "attachments": { "type": "array", "items": { "type": "object", "properties": { "_id": { "type": "string", "format": "object-id" }, "name": { "type": "string" }, "contentType": { "type": "string" }, "contentLength": { "type": "number" }, "sourceId": { "type": "string", "format": "object-id" } }, "required": [ "_id", "name", "contentType", "contentLength" ], "additionalProperties": false }, "uniqueItems": true }, "createdAt": { "type": "string", "format": "date-time" }, "modifiedAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "createdBy": { "type": "string", "format": "object-id" }, "modifiedBy": { "type": "string", "format": "object-id", "nullable": true }, "lang": { "type": "string", "maxLength": 100, "nullable": true } }, "required": [ "id" ] }, "maxItems": 100 } } } }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "ids": { "type": "array" }, "context": { "type": "string" }, "status": { "type": "string" }, "v2": { "type": "boolean" }, "payload": { "type": "object", "properties": { "api": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } } }, "required": [ "id", "tags" ] } }, "path": { "type": "string" }, "user": { "type": "object", "properties": { "id": { "type": "string" }, "userType": { "type": "string" }, "roles": { "type": "array", "items": { "type": "string" } }, "orgName": { "type": "string" }, "subject": { "type": "string" }, "org": { "type": "string" } }, "required": [ "id", "userType", "roles", "orgName", "subject", "org" ] }, "requestId": { "type": "string" }, "service": { "type": "string" }, "method": { "type": "string" } }, "required": [ "data", "path", "user", "requestId", "service", "method" ] } }, "required": [ "api" ] }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "completed": { "type": "boolean" } }, "required": [ "ids", "context", "status", "v2", "payload", "createdAt", "updatedAt", "completed" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "createdBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "createdBy" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "bulk", "id": "5b3bddb67f8469003df370a4", "attributes": { "ids": [], "context": "api.sobjects.notes.bulk-create", "status": "complete", "v2": true, "payload": { "api": { "data": [ { "id": "5b3bddb67f8469003df370a1", "tags": [ "5b3bddb67f8469003df370a5" ] }, { "id": "5b3bddb67f8469003df370a2", "tags": [ "5b3bddb67f8469003df370a5" ] } ], "path": "/v1/notes", "user": { "id": "5a96dac46dd73800112fab30", "userType": "user", "roles": [ "org" ], "orgName": "mycompany", "subject": "5a96dac46dd73800112fab30", "org": "5a96dac36dd73800112fab2e" }, "requestId": "5b3bddb6b6e494001779fa38", "service": "sobjects", "method": "POST" } }, "createdAt": "2018-07-03T20:33:58.486Z", "updatedAt": "2018-07-03T20:34:03.873Z", "completed": true }, "relationships": { "org": { "links": { "self": "/v1/orgs/5a96dac36dd73800112fab2e" }, "data": { "type": "org", "id": "5a96dac36dd73800112fab2e" } }, "createdBy": { "links": { "self": "/v1/users/5a96dac46dd73800112fab30" }, "data": { "type": "user", "id": "5a96dac46dd73800112fab30" } } }, "links": { "self": "/v1/bulk/5b3bddb67f8469003df370a4" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] } }, "/notes": { "post": { "security": [ { "httpBearer": [] } ], "tags": [ "Notes" ], "summary": "Create note", "description": "Creates a note.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.note.write|org.permission.note.create|\n\n### Rate limit\nNotes are subject to a rate limit. A single client can create up to 120 notes per minute per customer.", "operationId": "CreateNote", "parameters": [], "requestBody": { "description": "", "content": { "application/json": { "schema": { "type": "object", "additionalProperties": false, "title": "CreateaNoteRequest", "properties": { "id": { "type": "string" }, "externalId": { "type": "string", "maxLength": 256 }, "body": { "type": "string", "minLength": 1, "maxLength": 10240 }, "userMentions": { "type": "array", "maxItems": 20, "items": { "type": "object", "properties": { "user": { "type": "string" }, "team": { "type": "string" } } } }, "createdAt": { "type": "string", "format": "date-time" }, "modifiedAt": { "type": "string", "format": "date-time" }, "createdBy": { "type": "string", "format": "object-id" }, "modifiedBy": { "type": "string", "format": "object-id" }, "lang": { "type": "string", "maxLength": 100, "nullable": true } }, "required": [ "body" ] } } } }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "required": [ "type", "id", "attributes", "relationships", "links" ], "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "required": [ "body", "externalId", "createdAt" ], "properties": { "body": { "type": "string" }, "externalId": { "type": "string" }, "createdAt": { "type": "string" } } }, "relationships": { "type": "object", "required": [ "org", "customer", "createdBy", "conversation", "userMentions" ], "properties": { "org": { "type": "object", "required": [ "links", "data" ], "properties": { "links": { "type": "object", "required": [ "self" ], "properties": { "self": { "type": "string" } } }, "data": { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "type": "string" }, "id": { "type": "string" } } } } }, "customer": { "type": "object", "required": [ "links", "data" ], "properties": { "links": { "type": "object", "required": [ "self" ], "properties": { "self": { "type": "string" } } }, "data": { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "type": "string" }, "id": { "type": "string" } } } } }, "createdBy": { "type": "object", "required": [ "links", "data" ], "properties": { "links": { "type": "object", "required": [ "self" ], "properties": { "self": { "type": "string" } } }, "data": { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "type": "string" }, "id": { "type": "string" } } } } }, "conversation": { "type": "object", "required": [ "links", "data" ], "properties": { "links": { "type": "object", "required": [ "self" ], "properties": { "self": { "type": "string" } } }, "data": { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "type": "string" }, "id": { "type": "string" } } } } }, "userMentions": { "type": "object", "required": [ "data" ], "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } } } } } }, "links": { "type": "object", "required": [ "self" ], "properties": { "self": { "type": "string" } } } } } }, "required": [ "data" ] }, "example": { "data": { "type": "note", "id": "5828a3be7c7f551a00b5b720", "attributes": { "body": "Hey __Agent Smith__, do you know the answer to this problem?", "externalId": "", "createdAt": "2021-11-13T17:32:46.480Z" }, "relationships": { "org": { "links": { "self": "/v1/orgs/57bb5d2e32e83a130052e94e" }, "data": { "type": "org", "id": "57bb5d2e32e83a130052e94e" } }, "customer": { "links": { "self": "/v1/customers/57c08ccde595371400462df2" }, "data": { "type": "customer", "id": "57c08ccde595371400462df2" } }, "createdBy": { "links": { "self": "/v1/users/57bb5d2e32e83a130052e94f" }, "data": { "type": "user", "id": "57bb5d2e32e83a130052e94f" } }, "conversation": { "links": { "self": "/v1/conversations/57c8d2b365f7cc14004e674f" }, "data": { "type": "conversation", "id": "57c8d2b365f7cc14004e674f" } }, "userMentions": { "data": [ { "type": "user", "id": "57c8ccd7b417854d0003246b" } ] } }, "links": { "self": "/v1/notes/5828a3be7c7f551a00b5b720" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] }, "get": { "security": [ { "httpBearer": [] } ], "tags": [ "Notes" ], "summary": "Get notes", "description": "Retrieves all [notes](https://help.kustomer.com/using-notes-HJvDjNP58) for a Kustomer organization.\n\n\nAny of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.note.read|org.permission.note.read|", "operationId": "GetNotesForOrg", "parameters": [], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "meta": { "type": "object", "properties": { "pageSize": { "type": "integer" }, "page": { "type": "integer" } }, "required": [ "pageSize", "page" ] }, "data": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "body": { "type": "string" }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" } }, "required": [ "body", "createdAt", "updatedAt" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "customer": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "createdBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "conversation": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "customer", "createdBy", "conversation" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "links": { "type": "object", "properties": { "self": { "type": "string" }, "first": { "type": "string" }, "prev": { "type": "string", "nullable": true }, "next": { "type": "string", "nullable": true } }, "required": [ "self", "first", "prev", "next" ] } }, "required": [ "meta", "data", "links" ] }, "example": { "meta": { "pageSize": 100, "page": 1 }, "data": [ { "type": "note", "id": "57cf1d65079e780006e34f79", "attributes": { "body": "Hey", "createdAt": "2016-09-06T19:47:49.235Z", "updatedAt": "2016-09-06T19:47:49.236Z" }, "relationships": { "org": { "links": { "self": "/v1/orgs/57bb5d2e32e83a130052e94e" }, "data": { "type": "org", "id": "57bb5d2e32e83a130052e94e" } }, "customer": { "links": { "self": "/v1/customers/57c08ccde595371400462df2" }, "data": { "type": "customer", "id": "57c08ccde595371400462df2" } }, "createdBy": { "links": { "self": "/v1/users/57bb5d2e32e83a130052e94f" }, "data": { "type": "user", "id": "57bb5d2e32e83a130052e94f" } }, "conversation": { "links": { "self": "/v1/conversations/57ce17d2369f251400fc8e89" }, "data": { "type": "conversation", "id": "57ce17d2369f251400fc8e89" } } }, "links": { "self": "/v1/notes/57cf1d65079e780006e34f79" } } ], "links": { "self": "/v1/notes?sort=asc&page=1&pageSize=100", "first": "/v1/notes?sort=asc&page=1&pageSize=100", "prev": null, "next": null } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] } }, "/notes/{id}": { "get": { "security": [ { "httpBearer": [] } ], "tags": [ "Notes" ], "summary": "Get note by ID", "description": "Retrieves a note based on the unique note ID.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.note.read|org.permission.note.read|", "operationId": "GetNoteById", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "body": { "type": "string" }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" } }, "required": [ "body", "createdAt", "updatedAt" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "customer": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "createdBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "conversation": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "customer", "createdBy", "conversation" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "note", "id": "57cf1d65079e780006e34f79", "attributes": { "body": "Hey", "createdAt": "2016-09-06T19:47:49.235Z", "updatedAt": "2016-09-06T19:47:49.236Z" }, "relationships": { "org": { "links": { "self": "/v1/orgs/57bb5d2e32e83a130052e94e" }, "data": { "type": "org", "id": "57bb5d2e32e83a130052e94e" } }, "customer": { "links": { "self": "/v1/customers/57c08ccde595371400462df2" }, "data": { "type": "customer", "id": "57c08ccde595371400462df2" } }, "createdBy": { "links": { "self": "/v1/users/57bb5d2e32e83a130052e94f" }, "data": { "type": "user", "id": "57bb5d2e32e83a130052e94f" } }, "conversation": { "links": { "self": "/v1/conversations/57ce17d2369f251400fc8e89" }, "data": { "type": "conversation", "id": "57ce17d2369f251400fc8e89" } } }, "links": { "self": "/v1/notes/57cf1d65079e780006e34f79" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] }, "put": { "security": [ { "httpBearer": [] } ], "tags": [ "Notes" ], "summary": "Update note by ID", "description": "Updates a note based on the unique note ID.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.note.write|org.permission.note.update|\n\n### Note\n> This endpoint is subject to Object Rate Limiting, which limits how many updates single user can make to a single note. To learn more, see [Rate limiting](https://developer.kustomer.com/kustomer-api-docs/reference/rate-limiting).\n\n### Authorization\n> The `org.admin` role is required for setting `createdAt`, `createdBy`, `modifiedAt`, and `modifiedBy`. Otherwise, these attributes are automatically set by the token.", "operationId": "UpdateNoteById", "requestBody": { "description": "", "content": { "application/json": { "schema": { "type": "object", "properties": { "conversation": { "type": "string" }, "externalId": { "type": "string", "maxLength": 256, "nullable": true }, "body": { "type": "string", "minLength": 1, "maxLength": 10240 }, "userMentions": { "type": "array", "items": { "type": "object", "properties": { "user": { "type": "string" }, "team": { "type": "string" } } } }, "deleted": { "type": "boolean", "nullable": true }, "attachments": { "type": "array", "items": { "type": "object", "properties": { "_id": { "type": "string", "format": "object-id" }, "name": { "type": "string" }, "contentType": { "type": "string" }, "contentLength": { "type": "number" }, "sourceId": { "type": "string", "format": "object-id" } }, "required": [ "_id", "name", "contentType", "contentLength" ], "additionalProperties": false }, "uniqueItems": true }, "createdAt": { "type": "string", "format": "date-time" }, "modifiedAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "createdBy": { "type": "string", "format": "object-id" }, "modifiedBy": { "type": "string", "format": "object-id", "nullable": true }, "lang": { "type": "string", "maxLength": 100, "nullable": true } }, "required": [ "conversation", "body" ], "additionalProperties": false } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "body": { "type": "string" }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" } }, "required": [ "body", "createdAt", "updatedAt" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "customer": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "createdBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "conversation": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "userMentions": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } } }, "required": [ "data" ] } }, "required": [ "org", "customer", "createdBy", "conversation", "userMentions" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "note", "id": "57cf1d65079e780006e34f79", "attributes": { "body": "Hey Agent Smith, do you know the answer to this problem?", "createdAt": "2016-09-06T19:47:49.235Z", "updatedAt": "2016-11-13T17:50:09.477Z" }, "relationships": { "org": { "links": { "self": "/v1/orgs/57bb5d2e32e83a130052e94e" }, "data": { "type": "org", "id": "57bb5d2e32e83a130052e94e" } }, "customer": { "links": { "self": "/v1/customers/57c08ccde595371400462df2" }, "data": { "type": "customer", "id": "57c08ccde595371400462df2" } }, "createdBy": { "links": { "self": "/v1/users/57bb5d2e32e83a130052e94f" }, "data": { "type": "user", "id": "57bb5d2e32e83a130052e94f" } }, "conversation": { "links": { "self": "/v1/conversations/57ce17d2369f251400fc8e89" }, "data": { "type": "conversation", "id": "57ce17d2369f251400fc8e89" } }, "userMentions": { "data": [ { "type": "user", "id": "570690cb8f17df14005fc527" } ] } }, "links": { "self": "/v1/notes/57cf1d65079e780006e34f79" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ], "parameters": [ { "name": "replace", "in": "query", "required": false, "schema": { "type": "boolean", "example": true, "default": false }, "description": "Set to `true` to update the document. Otherwise, performs the same update as a PATCH request. Default value: `false`." } ] }, "patch": { "security": [ { "httpBearer": [] } ], "tags": [ "Notes" ], "summary": "Update note attributes by ID", "description": "Updates one or more note attibutes based on the unique note ID.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.note.write|org.permission.note.update|\n\n### Note\n> This endpoint is subject to Object Rate Limiting, which limits how many updates single user can make to a single note. To learn more, see [Rate limiting](https://developer.kustomer.com/kustomer-api-docs/reference/rate-limiting).\n\n### Authorization\n> The `org.admin` role is required for setting `createdAt`, `createdBy`, `modifiedAt`, and `modifiedBy`. Otherwise, these attributes are automatically set by the token.", "operationId": "PatchNoteById", "requestBody": { "description": "", "content": { "application/json": { "schema": { "type": "object", "properties": { "conversation": { "type": "string" }, "externalId": { "type": "string", "maxLength": 256, "nullable": true }, "body": { "type": "string", "minLength": 1, "maxLength": 10240 }, "userMentions": { "type": "array", "items": { "type": "object", "properties": { "user": { "type": "string" }, "team": { "type": "string" } } } }, "deleted": { "type": "boolean", "nullable": true }, "attachments": { "type": "array", "items": { "type": "object", "properties": { "_id": { "type": "string", "format": "object-id" }, "name": { "type": "string" }, "contentType": { "type": "string" }, "contentLength": { "type": "number" }, "sourceId": { "type": "string", "format": "object-id" } }, "required": [ "_id", "name", "contentType", "contentLength" ], "additionalProperties": false }, "uniqueItems": true }, "createdAt": { "type": "string", "format": "date-time" }, "modifiedAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "createdBy": { "type": "string", "format": "object-id" }, "modifiedBy": { "type": "string", "format": "object-id", "nullable": true }, "lang": { "type": "string", "maxLength": 100, "nullable": true } }, "additionalProperties": false } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "body": { "type": "string" }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" } }, "required": [ "body", "createdAt", "updatedAt" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "customer": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "createdBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "conversation": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "userMentions": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } } }, "required": [ "data" ] } }, "required": [ "org", "customer", "createdBy", "conversation", "userMentions" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "note", "id": "57cf1d65079e780006e34f79", "attributes": { "body": "Hey Agent Smith, do you know the answer to this problem?", "createdAt": "2016-09-06T19:47:49.235Z", "updatedAt": "2016-11-13T17:50:09.477Z" }, "relationships": { "org": { "links": { "self": "/v1/orgs/57bb5d2e32e83a130052e94e" }, "data": { "type": "org", "id": "57bb5d2e32e83a130052e94e" } }, "customer": { "links": { "self": "/v1/customers/57c08ccde595371400462df2" }, "data": { "type": "customer", "id": "57c08ccde595371400462df2" } }, "createdBy": { "links": { "self": "/v1/users/57bb5d2e32e83a130052e94f" }, "data": { "type": "user", "id": "57bb5d2e32e83a130052e94f" } }, "conversation": { "links": { "self": "/v1/conversations/57ce17d2369f251400fc8e89" }, "data": { "type": "conversation", "id": "57ce17d2369f251400fc8e89" } }, "userMentions": { "data": [ { "type": "user", "id": "570690cb8f17df14005fc527" } ] } }, "links": { "self": "/v1/notes/57cf1d65079e780006e34f79" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] }, "delete": { "security": [ { "httpBearer": [] } ], "tags": [ "Notes" ], "summary": "Delete note by ID", "description": "Deletes a note based on the unique note ID.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.note.write|org.permission.note.delete|", "operationId": "DeleteNoteById", "responses": { "204": { "description": "No Content", "content": { "text/plain": { "example": "" } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] }, "parameters": [ { "schema": { "type": "string", "example": "57cf1d65079e780006e34f79" }, "name": "id", "in": "path", "required": true, "description": "Unique note ID." } ] }, "/tracking/event": { "post": { "security": [ { "httpBearer": [] } ], "tags": [ "Tracking Events" ], "summary": "Create tracking event", "description": "Creates a new tracking event.\n\nThe following role is required for this endpoint: org.tracking", "operationId": "CreateTrackingEvent", "parameters": [], "requestBody": { "description": "", "content": { "application/json": { "schema": { "type": "object", "properties": { "trackingId": { "type": "string" }, "sessionId": { "type": "string" }, "name": { "type": "string", "pattern": "^[a-zA-Z]{1}[a-zA-Z0-9-_.]+$", "maxLength": 255 }, "meta": { "type": "object", "maxProperties": 100, "additionalProperties": false } }, "required": [ "name" ], "additionalProperties": false } } } }, "responses": { "204": { "description": "No Content", "content": { "text/plain": { "example": "" } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] } }, "/tracking/identity": { "post": { "security": [ { "httpBearer": [] } ], "tags": [ "Tracking Events" ], "summary": "Create tracking identity", "description": "Identifies a user.\n\nThe following role is required for this endpoint: org.tracking", "operationId": "CreateTrackingIdentity", "parameters": [], "requestBody": { "description": "", "content": { "application/json": { "schema": { "type": "object", "properties": { "remember": { "type": "boolean" }, "trackingId": { "type": "string" }, "sessionId": { "type": "string" }, "name": { "type": "string" }, "company": { "type": "string" }, "externalId": { "type": "string", "maxLength": 256 }, "username": { "type": "string", "maxLength": 256 }, "signedUpAt": { "type": "string", "format": "date-time" }, "birthdayAt": { "type": "string", "format": "date-time" }, "gender": { "type": "string", "enum": [ "m", "f" ] }, "locale": { "type": "string", "maxLength": 16 }, "timeZone": { "type": "string", "maxLength": 64 }, "email": { "type": "string", "format": "email" }, "phone": { "type": "string", "format": "phone-number" }, "location": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "home", "work", "other" ], "nullable": true }, "name": { "type": "string", "nullable": true }, "address": { "type": "string", "maxLength": 256, "nullable": true }, "address2": { "type": "string", "maxLength": 256, "nullable": true }, "address3": { "type": "string", "maxLength": 256, "nullable": true }, "latitude": { "type": "number", "nullable": true }, "longitude": { "type": "number", "nullable": true }, "countryCode": { "type": "string", "minLength": 2, "maxLength": 2, "nullable": true }, "countryName": { "type": "string", "maxLength": 64, "nullable": true }, "regionCode": { "type": "string", "maxLength": 2, "nullable": true }, "regionName": { "type": "string", "maxLength": 128, "nullable": true }, "cityName": { "type": "string", "maxLength": 128, "nullable": true }, "zipCode": { "type": "string", "maxLength": 30, "nullable": true }, "areaCode": { "type": "string", "maxLength": 30, "nullable": true } }, "additionalProperties": false }, "tags": { "type": "array", "items": { "type": "string" }, "maxItems": 20, "uniqueItems": true }, "custom": { "type": "object", "maxProperties": 100, "additionalProperties": false } }, "additionalProperties": false } } } }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "trackingId": { "type": "string" }, "email": { "type": "string" }, "status": { "type": "string" }, "statusAt": { "type": "string" }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" } }, "required": [ "trackingId", "email", "status", "statusAt", "createdAt", "updatedAt" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "customer": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "customer" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "identity", "id": "58290b8acca9b0a5e0189626", "attributes": { "trackingId": "58290b8a91113b1900bbee48", "email": "johnsmith@example.com", "status": "updated", "statusAt": "2016-11-14T00:55:38.947Z", "createdAt": "2016-11-14T00:55:38.922Z", "updatedAt": "2016-11-14T00:55:38.947Z" }, "relationships": { "org": { "links": { "self": "/v1/orgs/57bb5d2e32e83a130052e94e" }, "data": { "type": "org", "id": "57bb5d2e32e83a130052e94e" } }, "customer": { "links": { "self": "/v1/customers/58290b8b7c7f551a00b5b738" }, "data": { "type": "customer", "id": "58290b8b7c7f551a00b5b738" } } }, "links": { "self": "/v1/tracking/identity/58290b8acca9b0a5e0189626" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] } }, "/tracking/identityEvent": { "post": { "security": [ { "httpBearer": [] } ], "tags": [ "Tracking Events" ], "summary": "Create tracking identity and track event", "description": "Identifies a user and tracks an event with a single API call.\n\nThe following role is required for this endpoint: org.tracking", "operationId": "CreateTrackingIdentityEvent", "parameters": [], "requestBody": { "description": "", "content": { "application/json": { "schema": { "type": "object", "properties": { "identity": { "type": "object", "properties": { "remember": { "type": "boolean" }, "trackingId": { "type": "string" }, "sessionId": { "type": "string" }, "name": { "type": "string" }, "company": { "type": "string" }, "externalId": { "type": "string", "maxLength": 256 }, "username": { "type": "string", "maxLength": 256 }, "signedUpAt": { "type": "string", "format": "date-time" }, "birthdayAt": { "type": "string", "format": "date-time" }, "gender": { "type": "string", "enum": [ "m", "f" ] }, "locale": { "type": "string", "maxLength": 16 }, "timeZone": { "type": "string", "maxLength": 64 }, "email": { "type": "string", "format": "email" }, "phone": { "type": "string", "format": "phone-number" }, "location": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "home", "work", "other" ], "nullable": true }, "name": { "type": "string", "nullable": true }, "address": { "type": "string", "maxLength": 256, "nullable": true }, "address2": { "type": "string", "maxLength": 256, "nullable": true }, "address3": { "type": "string", "maxLength": 256, "nullable": true }, "latitude": { "type": "number", "nullable": true }, "longitude": { "type": "number", "nullable": true }, "countryCode": { "type": "string", "minLength": 2, "maxLength": 2, "nullable": true }, "countryName": { "type": "string", "maxLength": 64, "nullable": true }, "regionCode": { "type": "string", "maxLength": 2, "nullable": true }, "regionName": { "type": "string", "maxLength": 128, "nullable": true }, "cityName": { "type": "string", "maxLength": 128, "nullable": true }, "zipCode": { "type": "string", "maxLength": 30, "nullable": true }, "areaCode": { "type": "string", "maxLength": 30, "nullable": true } }, "additionalProperties": false }, "tags": { "type": "array", "items": { "type": "string" }, "maxItems": 20, "uniqueItems": true }, "custom": { "type": "object", "maxProperties": 100, "additionalProperties": false } }, "additionalProperties": false }, "event": { "type": "object", "properties": { "trackingId": { "type": "string" }, "sessionId": { "type": "string" }, "name": { "type": "string", "pattern": "^[a-zA-Z]{1}[a-zA-Z0-9-_.]+$", "maxLength": 255 }, "meta": { "type": "object", "maxProperties": 100, "additionalProperties": false } }, "required": [ "name" ], "additionalProperties": false } }, "required": [ "identity", "event" ], "additionalProperties": false } } } }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "trackingId": { "type": "string" }, "email": { "type": "string" }, "status": { "type": "string" }, "statusAt": { "type": "string" }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" } }, "required": [ "trackingId", "email", "status", "statusAt", "createdAt", "updatedAt" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "customer": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "customer" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "identity", "id": "58290b8acca9b0a5e0189626", "attributes": { "trackingId": "58290b8a91113b1900bbee48", "email": "johnsmith@example.com", "status": "updated", "statusAt": "2016-11-14T00:55:38.947Z", "createdAt": "2016-11-14T00:55:38.922Z", "updatedAt": "2016-11-14T00:55:38.947Z" }, "relationships": { "org": { "links": { "self": "/v1/orgs/57bb5d2e32e83a130052e94e" }, "data": { "type": "org", "id": "57bb5d2e32e83a130052e94e" } }, "customer": { "links": { "self": "/v1/customers/58290b8b7c7f551a00b5b738" }, "data": { "type": "customer", "id": "58290b8b7c7f551a00b5b738" } } }, "links": { "self": "/v1/tracking/identity/58290b8acca9b0a5e0189626" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] } }, "/customers/search": { "post": { "security": [ { "httpBearer": [] } ], "tags": [ "Search", "Customers (Search)" ], "summary": "Create customer search", "description": "Searches across customer data with criteria based on standard Object data and any custom attribute data for standard Objects, including Message, Conversation, and Company objects.\nStandard object data, custom object data, and conversation time data is limited to objects that have an updatedAt more recent than in the past 2 years. To query for older, archived data for standard and custom objects, see the [Archive Search API](https://developer.kustomer.com/kustomer-api-docs/reference/customerarchivesearch).\nOlder conversation time data is not available via search.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.search.read|org.permission.search.create|\n|org.admin.search.read|org.permission.search.update|\n||org.permission.search_global.create|\n||org.permission.search_preview.create|\n\n## Filter on dates\nYou can filter by dates in either a local date `YYYY-MM-DD` format or a UTC date format. If you include a timezone in the query, a local date will be adjusted to account for the included timezone. UTC dates will not be timezone adjusted.\n
\n### Example of search criteria with local date\n```json\n{\n \"and\": [\n {\n \"conversation_created_at\": {\n \"lte\": \"2020-11-19\"\n }\n }\n ],\n \"queryContext\": \"conversation\",\n \"timeZone\": \"America/New_York\"\n}\n```\n#### Note\n> The default `GMT` timezone is applied when you exclude a timezone.\n\n### Example of search criteria with UTC date\n```json\n{\n \"and\": [\n {\n \"conversation_created_at\": {\n \"lte\": \"2020-11-20T16:34:00.000Z\"\n }\n }\n ],\n \"queryContext\": \"conversation\"\n}\n```\n\n## Filter on standard attributes\nFor a list of available standard attributes, see [Standard attributes JSON schema](https://developer.kustomer.com/kustomer-api-docs/reference/search#standard-attributes-json-schema).\n\n### Example of search criteria with standard attributes\n```json\n[\n {\"customer_updated_at\": {\"gte\": \"2016-06-24\" }},\n {\"conversation_status\": {\"equals\": \"done\" }}\n]\n```\n\n## Filter on custom attributes for standard Objects\nYou can query custom attibutes on on standard Objects with the following syntax:\n`<>_custom_<>`.\n\n### Example of search criteria with custom attributes\n\n```json\n{ \"customer_custom_myCustomStr\": { \"equals\": \"some value\" }}\n{ \"message_custom_myCustomNum\": { \"gte\": 5 }}\n```\n\n## Filter on custom attributes for custom Objects\nYou can query custom attributes for custom Object with the following syntax: `kobject_custom_<>_<>`.\n\n### Examples\n```json\n{ \"kobject_custom_myKlass_myCustomNum\": { \"gte\": 5 }}\n```\n\n## Sort on customer attributes\nYou can sort based on the following customer attributes:\n\n```\ncustomer_name\ncustomer_gender\ncustomer_created_at\ncustomer_updated_at\ncustomer_modified_at\ncustomer_externalId\ncustomer_activity_at\ncustomer_last_seen_at\ncustomer_signed_up_at\ncustomer_lastmessage_preview\ncustomer_progressive_status\ncustomer_done\ncustomer_open\ncustomer_snoozed\ncustomer_last_message_sent_at\ncustomer_last_message_out_sent_at\ncustomer_last_message_unresponded_to_sent_at\ncustomer_last_message_at\n```\n\n### Example of sort with customer attributes\n```\n{\"sort\": [{\"customer_updated_at\": \"asc\"}]}\n{\"sort\": [{\"customer_gender\": \"asc\"}, {\"customer_created_at\": \"asc\"}]}\n```\n\n#### Note\n> Sorting based on other standard Object attributes is unavailable.\n\n\n## Pagination\nThere is a hard limit of **100** for the maximum number of pages.\n\nThere may be cases where you want to page through more records. For example, let's say you'd like to get an initial snapshot of data and then update the data.\n\nTo work around the pagination limit, you can write a query based on the `updated_at` attribute for a standard Object. You can then use the returned information in following API requests based on the last `updated_at` value from the response.\n\n\n## Standard attributes JSON Schema\n\n```json\n{\n \"type\": \"object\",\n \"properties\": {\n \"customer_any_text\": {\n \"type\": \"string\",\n \"operator\": \"any\"\n },\n \"customer_name\": {\n \"type\": \"string\",\n \"operator\": \"string\"\n },\n \"customer_gender\": {\n \"type\": \"string\",\n \"enum\": [\"m\", \"f\"],\n \"operator\": \"list\"\n },\n \"customer_presence\": {\n \"type\": \"string\",\n \"enum\": [\"online\", \"offline\", \"idle\"],\n \"operator\": \"list\"\n },\n \"customer_email\": {\n \"type\": \"string\",\n \"format\": \"email\",\n \"operator\": \"string\"\n },\n \"customer_shared_email\": {\n \"type\": \"string\",\n \"format\": \"email\",\n \"operator\": \"string\"\n },\n \"customer_phone\": {\n \"type\": \"string\",\n \"pattern\": \"^\\\\+?[1-9]\\\\d{1,14}$\",\n \"operator\": \"string\"\n },\n \"customer_shared_phone\": {\n \"type\": \"string\",\n \"pattern\": \"^\\\\+?[1-9]\\\\d{1,14}$\",\n \"operator\": \"string\"\n },\n \"customer_urls\": {\n \"type\": \"string\",\n \"operator\": \"string\"\n },\n \"customer_address\": {\n \"type\": \"string\",\n \"operator\": \"string\"\n },\n \"customer_locale\": {\n \"type\": \"string\",\n \"operator\": \"string\"\n },\n \"customer_activity_at\": {\n \"type\": \"string\",\n \"format\": \"date-time\",\n \"operator\": \"datetime\"\n },\n \"customer_last_seen_at\": {\n \"type\": \"string\",\n \"format\": \"date-time\",\n \"operator\": \"datetime\"\n },\n \"customer_signed_up_at\": {\n \"type\": \"string\",\n \"format\": \"date-time\",\n \"operator\": \"datetime\"\n },\n \"customer_last_message_sent_at\": {\n \"type\": \"string\",\n \"format\": \"date-time\",\n \"operator\": \"datetime\"\n },\n \"customer_last_message_out_sent_at\": {\n \"type\": \"string\",\n \"format\": \"date-time\",\n \"operator\": \"datetime\"\n },\n \"customer_last_message_unresponded_to_sent_at\": {\n \"type\": \"string\",\n \"format\": \"date-time\",\n \"operator\": \"datetime\"\n },\n \"customer_last_message_at\": {\n \"type\": \"string\",\n \"format\": \"date-time\",\n \"operator\": \"datetime\"\n },\n \"customer_externalId\": {\n \"type\": \"string\",\n \"operator\": \"string_notanalyzed\"\n },\n \"customer_shared_externalId\": {\n \"type\": \"string\",\n \"operator\": \"string_notanalyzed\"\n },\n \"customer_created_at\": {\n \"type\": \"string\",\n \"format\": \"date-time\",\n \"operator\": \"datetime\"\n },\n \"customer_updated_at\": {\n \"type\": \"string\",\n \"format\": \"date-time\",\n \"operator\": \"datetime\"\n },\n \"customer_modified_at\": {\n \"type\": \"string\",\n \"format\": \"date-time\",\n \"operator\": \"datetime\"\n },\n \"customer_created_by\": {\n \"$ref\": \"#/definitions/user\",\n \"operator\": \"list\"\n },\n \"customer_modified_by\": {\n \"$ref\": \"#/definitions/user\",\n \"operator\": \"list\"\n },\n \"customer_satisfaction_avg_score\": {\n \"type\": \"number\",\n \"operator\": \"number\"\n },\n \"customer_satisfaction_avg_rating\": {\n \"type\": \"number\",\n \"operator\": \"number\"\n },\n \"customer_conversations_count\": {\n \"type\": \"number\",\n \"operator\": \"number\"\n },\n \"customer_status\": {\n \"type\": \"string\",\n \"enum\": [\"snoozed\", \"open\", \"done\"],\n \"operator\": \"list\"\n },\n \"customer_progressive_status\": {\n \"type\": \"string\",\n \"enum\": [\"snoozed\", \"open\", \"done\"],\n \"operator\": \"list\"\n },\n \"customer_active_users\": {\n \"$ref\": \"#/definitions/user\",\n \"operator\": \"list\"\n },\n \"customer_watchers\": {\n \"$ref\": \"#/definitions/user\",\n \"operator\": \"list\"\n },\n \"customer_tags\": {\n \"type\": \"string\",\n \"operator\": \"list\"\n },\n \"customer_sentiment\": {\n \"type\": \"string\",\n \"enum\": [\"happy\", \"unhappy\", \"indifferent\"],\n \"operator\": \"list\"\n },\n \"customer_social_type\": {\n \"type\": \"string\",\n \"enum\": [\"facebook\", \"instagram\", \"whatsapp\", \"linkedin\", \"pinterest\", \"twitter\"],\n \"operator\": \"list\"\n },\n \"customer_social_userid\": {\n \"type\": \"string\",\n \"operator\": \"string_notanalyzed\"\n },\n \"customer_social_username\": {\n \"type\": \"string\",\n \"operator\": \"string_notanalyzed\"\n },\n \"customer_shared_social_type\": {\n \"type\": \"string\",\n \"enum\": [\"facebook\", \"instagram\", \"whatsapp\", \"linkedin\", \"pinterest\", \"twitter\"],\n \"operator\": \"list\"\n },\n \"customer_shared_social_userid\": {\n \"type\": \"string\",\n \"operator\": \"string_notanalyzed\"\n },\n \"customer_shared_social_username\": {\n \"type\": \"string\",\n \"operator\": \"string_notanalyzed\"\n },\n \"customer_default_lang\": {\n \"type\": \"string\",\n \"operator\": \"string_notanalyzed\"\n },\n \"customer_imported_at\": {\n \"type\": \"string\",\n \"format\": \"date-time\",\n \"operator\": \"datetime\"\n },\n \"customer_imported\": {\n \"type\": \"boolean\",\n \"operator\": \"boolean\"\n },\n \"company_any_text\": {\n \"type\": \"string\",\n \"operator\": \"any\"\n },\n \"company_name\": {\n \"type\": \"string\",\n \"operator\": \"string\"\n },\n \"company_tags\": {\n \"type\": \"string\",\n \"operator\": \"list\"\n },\n \"company_default_lang\": {\n \"type\": \"string\",\n \"operator\": \"string_notanalyzed\"\n },\n \"company_imported_at\": {\n \"type\": \"string\",\n \"format\": \"date-time\",\n \"operator\": \"datetime\"\n },\n \"company_imported\": {\n \"type\": \"boolean\",\n \"operator\": \"boolean\"\n },\n \"message_any_text\": {\n \"type\": \"string\",\n \"operator\": \"any\"\n },\n \"message_body\": {\n \"type\": \"string\",\n \"operator\": \"text\"\n },\n \"message_channel\": {\n \"type\": \"string\",\n \"enum\": [\"sms\", \"chat\", \"email\", \"facebook\", \"voice\", \"twitter-dm\", \"twitter-tweet\", \"instagram\", \"whatsapp\"],\n \"operator\": \"list\"\n },\n \"message_size\": {\n \"type\": \"number\",\n \"operator\": \"number\"\n },\n \"message_direction\": {\n \"type\": \"string\",\n \"enum\": [\"in\", \"out\"],\n \"operator\": \"boolean\"\n },\n \"message_sent_at\": {\n \"type\": \"string\",\n \"format\": \"date-time\",\n \"operator\": \"datetime\"\n },\n \"message_created_at\": {\n \"type\": \"string\",\n \"format\": \"date-time\",\n \"operator\": \"datetime\"\n },\n \"message_updated_at\": {\n \"type\": \"string\",\n \"format\": \"date-time\",\n \"operator\": \"datetime\"\n },\n \"message_created_by\": {\n \"$ref\": \"#/definitions/user\",\n \"operator\": \"list\"\n },\n \"message_modified_by\": {\n \"$ref\": \"#/definitions/user\",\n \"operator\": \"list\"\n },\n \"message_sentiment\": {\n \"type\": \"string\",\n \"enum\": [\"happy\", \"unhappy\", \"indifferent\"],\n \"operator\": \"list\"\n },\n \"message_customer_id\": {\n \"type\": \"string\",\n \"operator\": \"string_notanalyzed\"\n },\n \"message_status\": {\n \"type\": \"string\",\n \"enum\": [\"sent\", \"received\", \"error\"],\n \"operator\": \"list\"\n },\n \"message_error_at\": {\n \"type\": \"string\",\n \"format\": \"date-time\",\n \"operator\": \"datetime\"\n },\n \"message_error_title\": {\n \"type\": \"string\",\n \"operator\": \"string\"\n },\n \"message_external_id\": {\n \"type\": \"string\",\n \"operator\": \"string_notanalyzed\"\n },\n \"message_direction_type\": {\n \"type\": \"string\",\n \"enum\": [\"initial-in\", \"initial-out\", \"response-in\", \"response-out\", \"followup-in\", \"followup-out\"],\n \"operator\": \"list\"\n },\n \"message_created_by_teams\": {\n \"type\": \"string\",\n \"operator\": \"string_notanalyzed\"\n },\n \"message_redacted\": {\n \"type\": \"string\",\n \"operator\": \"boolean\"\n },\n \"message_redacted_at\": {\n \"type\": \"string\",\n \"format\": \"date-time\",\n \"operator\": \"datetime\"\n },\n \"message_imported_at\": {\n \"type\": \"string\",\n \"format\": \"date-time\",\n \"operator\": \"datetime\"\n },\n \"message_imported\": {\n \"type\": \"boolean\",\n \"operator\": \"boolean\"\n },\n \"message_recipients\": {\n \"type\": \"string\",\n \"operator\": \"string\"\n },\n \"message_sender\": {\n \"type\": \"string\",\n \"operator\": \"string\"\n },\n \"message_shortcuts\": {\n \"type\": \"string\",\n \"operator\": \"string_notanalyzed\"\n },\n \"message_subject\": {\n \"type\": \"string\",\n \"operator\": \"text\"\n },\n \"message_source\": {\n \"type\": \"string\",\n \"enum\": [\"bulk\"],\n \"operator\": \"list\"\n },\n \"message_attachment_count\": {\n \"type\": \"number\",\n \"operator\": \"number\"\n },\n \"message_auto\": {\n \"type\": \"string\",\n \"operator\": \"boolean\"\n },\n \"message_lang\": {\n \"type\": \"string\",\n \"operator\": \"string_notanalyzed\"\n },\n \"note_any_text\": {\n \"type\": \"string\",\n \"operator\": \"any\"\n },\n \"note_body\": {\n \"type\": \"string\",\n \"operator\": \"text\"\n },\n \"note_created_at\": {\n \"type\": \"string\",\n \"format\": \"date-time\",\n \"operator\": \"datetime\"\n },\n \"note_modified_at\": {\n \"type\": \"string\",\n \"format\": \"date-time\",\n \"operator\": \"datetime\"\n },\n \"note_updated_at\": {\n \"type\": \"string\",\n \"format\": \"date-time\",\n \"operator\": \"datetime\"\n },\n \"note_created_by\": {\n \"$ref\": \"#/definitions/user\",\n \"operator\": \"list\"\n },\n \"note_modified_by\": {\n \"$ref\": \"#/definitions/user\",\n \"operator\": \"list\"\n },\n \"note_deleted\": {\n \"$ref\": \"#/definitions/user\",\n \"operator\": \"boolean\"\n },\n \"note_user_mentions\": {\n \"$ref\": \"#/definitions/user\",\n \"operator\": \"list\"\n },\n \"note_team_mentions\": {\n \"type\": \"string\",\n \"pattern\": \"^(?=[A-Fa-f\\\\d]{24}$)(\\\\d+[A-Fa-f]|[A-Fa-f]+\\\\d)\",\n \"collection\": \"teams\",\n \"operator\": \"list\"\n },\n \"note_attachment_count\": {\n \"$ref\": \"#/definitions/user\",\n \"operator\": \"number\"\n },\n \"note_external_id\": {\n \"type\": \"string\",\n \"operator\": \"string_notanalyzed\"\n },\n \"note_customer_id\": {\n \"type\": \"string\",\n \"operator\": \"string_notanalyzed\"\n },\n \"note_conversation_id\": {\n \"type\": \"string\",\n \"operator\": \"string_notanalyzed\"\n },\n \"note_lang\": {\n \"type\": \"string\",\n \"operator\": \"string_notanalyzed\"\n },\n \"note_imported_at\": {\n \"type\": \"string\",\n \"format\": \"date-time\",\n \"operator\": \"datetime\"\n },\n \"note_imported\": {\n \"type\": \"boolean\",\n \"operator\": \"boolean\"\n },\n \"conversation_any_text\": {\n \"type\": \"string\",\n \"operator\": \"any\"\n },\n \"conversation_name\": {\n \"type\": \"string\",\n \"operator\": \"string\"\n },\n \"conversation_sentiment\": {\n \"type\": \"string\",\n \"enum\": [\"happy\", \"unhappy\", \"indifferent\"],\n \"operator\": \"list\"\n },\n \"conversation_status\": {\n \"type\": \"string\",\n \"enum\": [\"snoozed\", \"open\", \"done\"],\n \"operator\": \"list\"\n },\n \"conversation_sub_status\": {\n \"type\": \"string\",\n \"operator\": \"string_notanalyzed\"\n },\n \"conversation_created_at\": {\n \"type\": \"string\",\n \"format\": \"date-time\",\n \"operator\": \"datetime\"\n },\n \"conversation_updated_at\": {\n \"type\": \"string\",\n \"format\": \"date-time\",\n \"operator\": \"datetime\"\n },\n \"conversation_modified_at\": {\n \"type\": \"string\",\n \"format\": \"date-time\",\n \"operator\": \"datetime\"\n },\n \"conversation_modified_by\": {\n \"$ref\": \"#/definitions/user\",\n \"operator\": \"list\"\n },\n \"conversation_message_count\": {\n \"type\": \"number\",\n \"operator\": \"number\"\n },\n \"conversation_note_count\": {\n \"type\": \"number\",\n \"operator\": \"number\"\n },\n \"conversation_satisfaction_survey_id\": {\n \"type\": \"string\",\n \"operator\": \"list\"\n },\n \"conversation_satisfaction_sent_by\": {\n \"$ref\": \"#/definitions/user\",\n \"operator\": \"list\"\n },\n \"conversation_satisfaction_sent_by_teams\": {\n \"type\": \"string\",\n \"pattern\": \"^(?=[A-Fa-f\\\\d]{24}$)(\\\\d+[A-Fa-f]|[A-Fa-f]+\\\\d)\",\n \"collection\": \"teams\",\n \"operator\": \"list\"\n },\n \"conversation_satisfaction_created_at\": {\n \"type\": \"string\",\n \"format\": \"date-time\",\n \"operator\": \"datetime\"\n },\n \"conversation_satisfaction_score\": {\n \"type\": \"number\",\n \"operator\": \"number\"\n },\n \"conversation_satisfaction_rating\": {\n \"type\": \"number\",\n \"operator\": \"number\"\n },\n \"conversation_satisfaction_status\": {\n \"type\": \"string\",\n \"enum\": [\n \"canceled\",\n \"scheduled\",\n \"offered\",\n \"unresponded\",\n \"rated\",\n \"commented\"\n ],\n \"operator\": \"list\"\n },\n \"conversation_channels\": {\n \"type\": \"string\",\n \"enum\": [\"sms\", \"chat\", \"email\", \"facebook\", \"voice\", \"twitter-dm\", \"twitter-tweet\", \"instagram\", \"whatsapp\"],\n \"operator\": \"list\"\n },\n \"conversation_satisfaction\": {\n \"type\": \"string\",\n \"operator\": \"string\"\n },\n \"conversation_priority\": {\n \"type\": \"integer\",\n \"operator\": \"number\",\n \"minimum\": 1,\n \"maximum\": 5\n },\n \"conversation_tags\": {\n \"type\": \"string\",\n \"operator\": \"list\"\n },\n \"conversation_assigned_users\": {\n \"$ref\": \"#/definitions/user\",\n \"operator\": \"list\"\n },\n \"conversation_assigned_teams\": {\n \"type\": \"string\",\n \"pattern\": \"^(?=[A-Fa-f\\\\d]{24}$)(\\\\d+[A-Fa-f]|[A-Fa-f]+\\\\d)\",\n \"collection\": \"teams\",\n \"operator\": \"list\"\n },\n \"conversation_last_message_sent_at\": {\n \"type\": \"string\",\n \"format\": \"date-time\",\n \"operator\": \"datetime\"\n },\n \"conversation_last_message_out_sent_at\": {\n \"type\": \"string\",\n \"format\": \"date-time\",\n \"operator\": \"datetime\"\n },\n \"conversation_last_message_unresponded_to_sent_at\": {\n \"type\": \"string\",\n \"format\": \"date-time\",\n \"operator\": \"datetime\"\n },\n \"conversation_last_message_at\": {\n \"type\": \"string\",\n \"format\": \"date-time\",\n \"operator\": \"datetime\"\n },\n \"conversation_first_response_sent_at\": {\n \"type\": \"string\",\n \"format\": \"date-time\",\n \"operator\": \"datetime\"\n },\n \"conversation_first_response_time\": {\n \"type\": \"number\",\n \"operator\": \"number\"\n },\n \"conversation_first_response_created_by\": {\n \"$ref\": \"#/definitions/user\",\n \"operator\": \"list\"\n },\n \"conversation_last_response_created_by\": {\n \"$ref\": \"#/definitions/user\",\n \"operator\": \"list\"\n },\n \"conversation_last_message_direction\": {\n \"type\": \"string\",\n \"enum\": [\"in\", \"out\"],\n \"operator\": \"list\"\n },\n \"conversation_direction\": {\n \"type\": \"string\",\n \"enum\": [\"in\", \"out\"],\n \"operator\": \"list\"\n },\n \"conversation_outbound_message_count\": {\n \"type\": \"number\",\n \"operator\": \"number\"\n },\n \"conversation_customer_id\": {\n \"type\": \"string\",\n \"operator\": \"string_notanalyzed\"\n },\n \"conversation_campaign_id\": {\n \"type\": \"string\",\n \"operator\": \"string_notanalyzed\"\n },\n \"conversation_first_message_in_sent_at\": {\n \"format\": \"date-time\",\n \"operator\": \"datetime\"\n },\n \"conversation_first_message_in_direction_type\": {\n \"type\": \"string\",\n \"enum\": [\"initial-in\", \"initial-out\", \"response-in\", \"response-out\", \"followup-in\", \"followup-out\"],\n \"operator\": \"list\"\n },\n \"conversation_first_message_in_channel\": {\n \"type\": \"string\",\n \"enum\": [\"sms\", \"chat\", \"email\", \"facebook\", \"voice\", \"twitter-dm\", \"twitter-tweet\", \"instagram\", \"whatsapp\"],\n \"operator\": \"list\"\n },\n \"conversation_first_message_out_sent_at\": {\n \"format\": \"date-time\",\n \"operator\": \"datetime\"\n },\n \"conversation_first_message_out_direction_type\": {\n \"type\": \"string\",\n \"enum\": [\"initial-in\", \"initial-out\", \"response-in\", \"response-out\", \"followup-in\", \"followup-out\"],\n \"operator\": \"list\"\n },\n \"conversation_first_message_out_channel\": {\n \"type\": \"string\",\n \"enum\": [\"sms\", \"chat\", \"email\", \"facebook\", \"voice\", \"twitter-dm\", \"twitter-tweet\", \"instagram\", \"whatsapp\"],\n \"operator\": \"list\"\n },\n \"conversation_time_created_at\": {\n \"type\": \"string\",\n \"format\": \"date-time\",\n \"operator\": \"datetime\"\n },\n \"conversation_time_conversation_id\": {\n \"type\": \"string\",\n \"operator\": \"string_notanalyzed\"\n },\n \"conversation_time_created_by_teams\": {\n \"type\": \"string\",\n \"pattern\": \"^(?=[A-Fa-f\\\\d]{24}$)(\\\\d+[A-Fa-f]|[A-Fa-f]+\\\\d)\",\n \"collection\": \"teams\",\n \"operator\": \"list\"\n },\n \"conversation_time_assigned_users\": {\n \"$ref\": \"#/definitions/user\",\n \"operator\": \"list\"\n },\n \"conversation_time_assigned_teams\": {\n \"type\": \"string\",\n \"pattern\": \"^(?=[A-Fa-f\\\\d]{24}$)(\\\\d+[A-Fa-f]|[A-Fa-f]+\\\\d)\",\n \"collection\": \"teams\",\n \"operator\": \"list\"\n },\n \"conversation_time_touched\": {\n \"type\": \"string\",\n \"operator\": \"boolean\"\n },\n \"conversation_time_reopened\": {\n \"type\": \"string\",\n \"operator\": \"boolean\"\n },\n \"conversation_time_snoozed\": {\n \"type\": \"string\",\n \"operator\": \"boolean\"\n },\n \"conversation_time_resolved\": {\n \"type\": \"string\",\n \"operator\": \"boolean\"\n },\n \"conversation_time_message_at\": {\n \"type\": \"string\",\n \"format\": \"date-time\",\n \"operator\": \"datetime\"\n },\n \"conversation_time_message_time\": {\n \"type\": \"number\",\n \"operator\": \"number\"\n },\n \"conversation_time_messages_sent\": {\n \"type\": \"number\",\n \"operator\": \"number\"\n },\n \"conversation_time_note_at\": {\n \"type\": \"string\",\n \"format\": \"date-time\",\n \"operator\": \"datetime\"\n },\n \"conversation_time_note_time\": {\n \"type\": \"number\",\n \"operator\": \"number\"\n },\n \"conversation_time_notes_sent\": {\n \"type\": \"number\",\n \"operator\": \"number\"\n },\n \"conversation_time_handle_at\": {\n \"type\": \"string\",\n \"format\": \"date-time\",\n \"operator\": \"datetime\"\n },\n \"conversation_time_handle_time\": {\n \"type\": \"number\",\n \"operator\": \"number\"\n },\n \"conversation_time_channels\": {\n \"type\": \"string\",\n \"enum\": [\"sms\", \"chat\", \"email\", \"facebook\", \"voice\", \"twitter-dm\", \"twitter-tweet\", \"instagram\", \"whatsapp\"],\n \"operator\": \"list\"\n },\n \"conversation_default_lang\": {\n \"type\": \"string\",\n \"operator\": \"string_notanalyzed\"\n },\n \"any_text\": {\n \"type\": \"string\",\n \"operator\": \"any\"\n },\n \"tracking_events\": {\n \"type\": \"string\",\n \"operator\": \"number\"\n },\n \"conversation_sla_status\": {\n \"type\": \"string\",\n \"enum\": [\"done\", \"pending\", \"paused\"],\n \"operator\": \"list\"\n },\n \"conversation_sla_version_id\": {\n \"type\": \"string\",\n \"operator\": \"string_notanalyzed\"\n },\n \"conversation_sla_id\": {\n \"type\": \"string\",\n \"operator\": \"list\"\n },\n \"conversation_sla_breached\": {\n \"type\": \"boolean\",\n \"operator\": \"boolean\"\n },\n \"conversation_sla_breach_at\": {\n \"type\": \"string\",\n \"format\": \"date-time\",\n \"operator\": \"datetime\"\n },\n \"conversation_sla_satisfied_at\": {\n \"type\": \"string\",\n \"format\": \"date-time\",\n \"operator\": \"datetime\"\n },\n \"conversation_sla_breach_metric\": {\n \"type\": \"string\",\n \"enum\": [\n \"firstResponse\",\n \"totalCustomerWaitTime\",\n \"longestUnrespondedMessage\",\n \"totalConversationOpenTime\"\n ],\n \"operator\": \"list\"\n },\n \"conversation_first_done_created_by\": {\n \"$ref\": \"#/definitions/user\",\n \"operator\": \"list\"\n },\n \"conversation_last_done_created_at\": {\n \"type\": \"string\",\n \"format\": \"date-time\",\n \"operator\": \"datetime\"\n },\n \"conversation_last_done_created_by\": {\n \"$ref\": \"#/definitions/user\",\n \"operator\": \"list\"\n },\n \"conversation_last_done_created_by_teams\": {\n \"type\": \"string\",\n \"pattern\": \"^(?=[A-Fa-f\\\\d]{24}$)(\\\\d+[A-Fa-f]|[A-Fa-f]+\\\\d)\",\n \"collection\": \"teams\",\n \"operator\": \"list\"\n },\n \"conversation_reply_channel\": {\n \"type\": \"string\",\n \"enum\": [\"sms\", \"chat\", \"email\", \"facebook\", \"voice\", \"twitter-dm\", \"twitter-tweet\", \"instagram\", \"whatsapp\"],\n \"operator\": \"list\"\n },\n \"conversation_queue\": {\n \"type\": \"string\",\n \"pattern\": \"^(?=[A-Fa-f\\\\d]{24}$)(\\\\d+[A-Fa-f]|[A-Fa-f]+\\\\d)\",\n \"collection\": \"queues\",\n \"operator\": \"list\"\n },\n \"conversation_external_queue\": {\n \"type\": \"string\",\n \"enum\": [\"amazon-connect\"],\n \"operator\": \"list\"\n },\n \"conversation_ended\": {\n \"type\": \"boolean\",\n \"operator\": \"boolean\"\n },\n \"conversation_ended_at\": {\n \"type\": \"string\",\n \"format\": \"date-time\",\n \"operator\": \"datetime\"\n },\n \"conversation_ended_reason\": {\n \"type\": \"string\",\n \"operator\": \"string\"\n },\n \"conversation_imported_at\": {\n \"type\": \"string\",\n \"format\": \"date-time\",\n \"operator\": \"datetime\"\n },\n \"conversation_imported\": {\n \"type\": \"boolean\",\n \"operator\": \"boolean\"\n },\n \"kobject_any_text\": {\n \"type\": \"string\",\n \"operator\": \"any\"\n },\n \"kobject_created_at\": {\n \"type\": \"string\",\n \"format\": \"date-time\",\n \"operator\": \"datetime\"\n },\n \"kobject_updated_at\": {\n \"type\": \"string\",\n \"format\": \"date-time\",\n \"operator\": \"datetime\"\n },\n \"kobject_imported_at\": {\n \"type\": \"string\",\n \"format\": \"date-time\",\n \"operator\": \"datetime\"\n },\n \"kobject_imported\": {\n \"type\": \"boolean\",\n \"operator\": \"boolean\"\n }\n },\n \"definitions\": {\n \"user\": {\n \"type\": \"string\",\n \"pattern\": \"^(?=[A-Fa-f\\\\d]{24}$)(\\\\d+[A-Fa-f]|[A-Fa-f]+\\\\d)\",\n \"collection\": \"users\"\n }\n },\n \"additionalProperties\": false\n}\n\n```\n", "operationId": "CustomerSearch", "parameters": [], "requestBody": { "description": "## Example request\n\nCreates a query to retrieve the last `updatedAt` attribute to use in a subsequent request.\n\n```json\n{\n \"and\": [\n { \"customer_updated_at\": { \"gte\": \"2016-01-01\" } }\n ],\n \"sort\" : [{\"customer_updated_at\": \"asc\"}],\n \"queryContext\": \"customer\",\n \"or\":[]\n}\n```\n\n## Example of next request\n\nUses the returned `updatedAt` value from the previous request to page through all customer data and keep data up to date.\n\n```json\n{\n \"and\": [\n { \"customer_updated_at\": { \"gte\": \"2016-07-27T22:30:48.939Z\" } }\n ],\n \"sort\" : [{\"customer_updated_at\": \"asc\"}],\n \"queryContext\": \"customer\",\n \"or\":[]\n}\n```\n", "content": { "application/json": { "schema": { "type": "object", "properties": { "searchHash": { "type": "string" }, "queryContext": { "type": "string", "pattern": "^(company|customer|message|conversation|conversation_time|note|kobject|kobject_.*|work_session|work_item)$" }, "includeDeleted": { "type": "boolean" }, "timeZone": { "type": "string" }, "and": { "anyOf": [ { "type": "object" }, { "type": "array", "items": { "type": "object" }, "maxItems": 20, "uniqueItems": true } ] }, "or": { "anyOf": [ { "type": "object" }, { "type": "array", "items": { "type": "object" }, "maxItems": 20, "uniqueItems": true } ] }, "not": { "anyOf": [ { "type": "object" }, { "type": "array", "items": { "type": "object" }, "maxItems": 20, "uniqueItems": true } ] }, "sort": { "anyOf": [ { "type": "object" }, { "type": "array", "items": { "type": "object" }, "maxItems": 5, "uniqueItems": true } ] }, "aggs": { "type": "object" }, "fields": { "type": "array", "items": { "type": "object" }, "maxItems": 20, "uniqueItems": true } }, "additionalProperties": false } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "meta": { "type": "object", "properties": { "pageSize": { "type": "integer" }, "page": { "type": "integer" }, "total": { "type": "integer" }, "totalPages": { "type": "integer" }, "aggregations": { "type": "object" } }, "required": [ "pageSize", "page", "total", "totalPages", "aggregations" ] }, "data": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "name": { "type": "string" }, "displayName": { "type": "string" }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "lastActivityAt": { "type": "string" }, "verified": { "type": "boolean" }, "rev": { "type": "integer" } }, "required": [ "name", "displayName", "createdAt", "updatedAt", "lastActivityAt", "verified", "rev" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "links": { "type": "object", "properties": { "self": { "type": "string" }, "first": { "type": "string" }, "prev": { "type": "string", "nullable": true }, "next": { "type": "string" }, "last": { "type": "string" } }, "required": [ "self", "first", "prev", "next", "last" ] } }, "required": [ "meta", "data", "links" ] }, "example": { "meta": { "pageSize": 100, "page": 1, "total": 7503, "totalPages": 76, "aggregations": {} }, "data": [ { "type": "customer", "id": "576db7781126c61100824494", "attributes": { "name": "Dave Smith", "displayName": "Dave", "createdAt": "2016-06-24T22:43:04.298Z", "updatedAt": "2016-06-24T22:43:04.298Z", "lastActivityAt": "2016-06-24T22:43:04.298Z", "verified": true, "rev": 1 }, "relationships": { "org": { "links": { "self": "/v1/orgs/573f7702a1a00c10005adc2a" }, "data": { "type": "org", "id": "573f7702a1a00c10005adc2a" } } }, "links": { "self": "/v1/customers/576db7781126c61100824494" } }, { "type": "customer", "id": "5771a9181126c611008253ff", "attributes": { "name": "Peter Johansen", "displayName": "Pete", "createdAt": "2016-07-27T22:30:48.939Z", "updatedAt": "2016-07-27T22:30:48.939Z", "lastActivityAt": "2016-07-27T22:30:48.939Z", "verified": true, "rev": 1 }, "relationships": { "org": { "links": { "self": "/v1/orgs/573f7702a1a00c10005adc2a" }, "data": { "type": "org", "id": "573f7702a1a00c10005adc2a" } } }, "links": { "self": "/v1/customers/5771a9181126c611008253ff" } } ], "links": { "self": "/v1/customers/search?page=1&pageSize=100", "first": "/v1/customers/search?page=1&pageSize=100", "prev": null, "next": "/v1/customers/search?page=2&pageSize=100", "last": "/v1/customers/search?page=76&pageSize=100" } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] } }, "/customers/archive/search": { "post": { "security": [ { "httpBearer": [] } ], "tags": [ "Search", "Customers (Search)" ], "summary": "Create customer archive search", "description": "Searches across all customer data with criteria based on a limited number of attributes on standard objects, including Message, Conversation, and Company objects, and on custom objects. Returns standard objects and custom objects older than 2 years ago that are unavailable in standard searches.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.search.read|org.permission.search.create|\n|org.admin.search.read|org.permission.search.update|\n||org.permission.search_global.create|\n||org.permission.search_preview.create|\n\n## Filter on dates\nYou can filter by dates in either a local date `YYYY-MM-DD` format or a UTC date format. If you include a timezone in the query, a local date will be adjusted to account for the included timezone. UTC dates will not be timezone adjusted.\n
\n### Example of search criteria with local date\n```json\n{\n \"and\": [\n {\n \"conversation_created_at\": {\n \"lte\": \"2020-11-19\"\n }\n }\n ],\n \"queryContext\": \"conversation\",\n \"timeZone\": \"America/New_York\"\n}\n```\n#### Note\n> The default `GMT` timezone is applied when you exclude a timezone.\n\n### Example of search criteria with UTC date\n```json\n{\n \"and\": [\n {\n \"conversation_created_at\": {\n \"lte\": \"2020-11-20T16:34:00.000Z\"\n }\n }\n ],\n \"queryContext\": \"conversation\"\n}\n```\n\n## Filtering\nFor a list of available standard attributes, see [Standard attributes JSON schema](https://developer.kustomer.com/kustomer-api-docs/reference/search#standard-attributes-json-schema).\n\n### Example of search criteria with standard attributes\n```json\n[\n {\"conversation_updated_at\": {\"gte\": \"2016-06-24\" }},\n {\"conversation_customer_id\": {\"equals\": \"65f49506237963001f01a391\" }}\n]\n```\n## Sort on attributes\nYou can sort based on the following attributes:\n\n```\nconversation_created_at\nconversation_updated_at\nconversation_customer_id\nconversation_deleted\ncustomer_companyId\ncustomer_created_at\ncustomer_updated_at\ncustomer_deleted\nmessage_id\nmessage_created_at\nmessage_updated_at\nkobject_created_at\nkobject_updated_at\n^kobject.*_created_at$\n^kobject.*_updated_at$\ncompany_created_at\ncompany_updated_at\n```\n\n### Example of sort with attributes\n```\n{\"sort\": [{\"conversation_created_at\": \"asc\"}]}\n{\"sort\": [{\"message_id\": \"asc\"}, {\"message_created_at\": \"asc\"}]}\n```\n\n#### Note\n> Sorting based on other standard Object attributes is unavailable.\n\n## Pagination\nThere is a hard limit of **100** for the maximum number of pages.\n\nThere may be cases where you want to page through more records. For example, let's say you'd like to get an initial snapshot of data and then update the data.\n\nTo work around the pagination limit, you can write a query based on the `updated_at` attribute for a standard Object. You can then use the returned information in following API requests based on the last `updated_at` value from the response.\n\n## Filterable attributes JSON Schema\n\n```json\n{\n \"type\": \"object\",\n \"properties\": {\n \"customer_any_text_new\": {\n \"type\": \"string\",\n \"operator\": \"any\"\n },\n \"customer_id\": {\n \"type\": \"string\",\n \"operator\": \"string_notanalyzed\"\n },\n \"customer_created_at\": {\n \"type\": \"string\",\n \"format\": \"date-time\",\n \"operator\": \"datetime\"\n },\n \"customer_updated_at\": {\n \"type\": \"string\",\n \"format\": \"date-time\",\n \"operator\": \"datetime\"\n },\n \"customer_companyId\": {\n \"type\": \"string\",\n \"operator\": \"string_notanalyzed\"\n },\n \"company_created_at\": {\n \"type\": \"string\",\n \"format\": \"date-time\",\n \"operator\": \"datetime\"\n },\n \"company_updated_at\": {\n \"type\": \"string\",\n \"format\": \"date-time\",\n \"operator\": \"datetime\"\n },\n \"message_any_text\": {\n \"type\": \"string\",\n \"operator\": \"any\"\n },\n \"message_created_at\": {\n \"type\": \"string\",\n \"format\": \"date-time\",\n \"operator\": \"datetime\"\n },\n \"message_updated_at\": {\n \"type\": \"string\",\n \"format\": \"date-time\",\n \"operator\": \"datetime\"\n },\n \"message_conversation_id\": {\n \"type\": \"string\",\n \"operator\": \"string_notanalyzed\"\n },\n \"conversation_any_text\": {\n \"type\": \"string\",\n \"operator\": \"any\"\n },\n \"conversation_created_at\": {\n \"type\": \"string\",\n \"format\": \"date-time\",\n \"operator\": \"datetime\"\n },\n \"conversation_updated_at\": {\n \"type\": \"string\",\n \"format\": \"date-time\",\n \"operator\": \"datetime\"\n },\n \"conversation_customer_id\": {\n \"type\": \"string\",\n \"operator\": \"string_notanalyzed\"\n },\n \"kobject_any_text\": {\n \"type\": \"string\",\n \"operator\": \"any\"\n },\n \"kobject_created_at\": {\n \"type\": \"string\",\n \"format\": \"date-time\",\n \"operator\": \"datetime\"\n },\n \"kobject_updated_at\": {\n \"type\": \"string\",\n \"format\": \"date-time\",\n \"operator\": \"datetime\"\n },\n },\n \"additionalProperties\": false\n}\n\n```\n", "operationId": "CustomerArchiveSearch", "parameters": [], "requestBody": { "description": "## Example request\n\nCreates a query to retrieve the last `updatedAt` attribute to use in a subsequent request.\n\n```json\n{\n \"and\": [\n { \"customer_updated_at\": { \"gte\": \"2016-01-01\" } }\n ],\n \"sort\" : [{\"customer_updated_at\": \"asc\"}],\n \"queryContext\": \"customer\",\n \"or\":[]\n}\n```\n\n## Example of next request\n\nUses the returned `updatedAt` value from the previous request to page through all customer data and keep data up to date.\n\n```json\n{\n \"and\": [\n { \"customer_updated_at\": { \"gte\": \"2016-07-27T22:30:48.939Z\" } }\n ],\n \"sort\" : [{\"customer_updated_at\": \"asc\"}],\n \"queryContext\": \"customer\",\n \"or\":[]\n}\n```\n", "content": { "application/json": { "schema": { "type": "object", "properties": { "queryContext": { "type": "string", "pattern": "^(message|conversation|customer|kobject|kobject_.*|company)$" }, "includeDeleted": { "type": "boolean" }, "timeZone": { "type": "string" }, "and": { "anyOf": [ { "type": "object" }, { "type": "array", "items": { "type": "object", "properties": { "conversation_id": { "type": "object" }, "conversation_created_at": { "type": "object" }, "conversation_updated_at": { "type": "object" }, "conversation_customer_id": { "type": "object" }, "conversation_any_text": { "type": "object" }, "conversation_deleted": { "type": "object" }, "customer_id": { "type": "object" }, "customer_companyId": { "type": "object" }, "customer_created_at": { "type": "object" }, "customer_updated_at": { "type": "object" }, "customer_deleted": { "type": "object" }, "customer_any_text_new": { "type": "object" }, "message_id": { "type": "object" }, "message_created_at": { "type": "object" }, "message_updated_at": { "type": "object" }, "message_conversation_id": { "type": "object" }, "message_any_text": { "type": "object" }, "kobject_id": { "type": "object" }, "kobject_created_at": { "type": "object" }, "kobject_updated_at": { "type": "object" }, "kobject_customer_id": { "type": "object" }, "kobject_company_id": { "type": "object" }, "kobject_any_text": { "type": "object" }, "^kobject_.*_id$": { "type": "object" }, "^kobject_.*_created_at$": { "type": "object" }, "^kobject_.*_updated_at$": { "type": "object" }, "^kobject_.*_customer_id$": { "type": "object" }, "^kobject_.*_company_id$": { "type": "object" }, "^kobject_.*_any_text$": { "type": "object" }, "company_created_at": { "type": "object" }, "company_updated_at": { "type": "object" } } }, "maxItems": 20, "uniqueItems": true } ] }, "or": { "anyOf": [ { "type": "object" }, { "type": "array", "items": { "type": "object", "properties": { "conversation_id": { "type": "object" }, "conversation_created_at": { "type": "object" }, "conversation_updated_at": { "type": "object" }, "conversation_customer_id": { "type": "object" }, "conversation_any_text": { "type": "object" }, "conversation_deleted": { "type": "object" }, "customer_id": { "type": "object" }, "customer_companyId": { "type": "object" }, "customer_created_at": { "type": "object" }, "customer_updated_at": { "type": "object" }, "customer_deleted": { "type": "object" }, "customer_any_text_new": { "type": "object" }, "message_id": { "type": "object" }, "message_created_at": { "type": "object" }, "message_updated_at": { "type": "object" }, "message_conversation_id": { "type": "object" }, "message_any_text": { "type": "object" }, "kobject_id": { "type": "object" }, "kobject_created_at": { "type": "object" }, "kobject_updated_at": { "type": "object" }, "kobject_customer_id": { "type": "object" }, "kobject_company_id": { "type": "object" }, "kobject_any_text": { "type": "object" }, "^kobject_.*_id$": { "type": "object" }, "^kobject_.*_created_at$": { "type": "object" }, "^kobject_.*_updated_at$": { "type": "object" }, "^kobject_.*_customer_id$": { "type": "object" }, "^kobject_.*_company_id$": { "type": "object" }, "^kobject_.*_any_text$": { "type": "object" }, "company_created_at": { "type": "object" }, "company_updated_at": { "type": "object" } } }, "maxItems": 20, "uniqueItems": true } ] }, "not": { "anyOf": [ { "type": "object" }, { "type": "array", "items": { "type": "object", "properties": { "conversation_id": { "type": "object" }, "conversation_created_at": { "type": "object" }, "conversation_updated_at": { "type": "object" }, "conversation_customer_id": { "type": "object" }, "conversation_any_text": { "type": "object" }, "conversation_deleted": { "type": "object" }, "customer_id": { "type": "object" }, "customer_companyId": { "type": "object" }, "customer_created_at": { "type": "object" }, "customer_updated_at": { "type": "object" }, "customer_deleted": { "type": "object" }, "customer_any_text_new": { "type": "object" }, "message_id": { "type": "object" }, "message_created_at": { "type": "object" }, "message_updated_at": { "type": "object" }, "message_conversation_id": { "type": "object" }, "message_any_text": { "type": "object" }, "kobject_id": { "type": "object" }, "kobject_created_at": { "type": "object" }, "kobject_updated_at": { "type": "object" }, "kobject_customer_id": { "type": "object" }, "kobject_company_id": { "type": "object" }, "kobject_any_text": { "type": "object" }, "^kobject_.*_id$": { "type": "object" }, "^kobject_.*_created_at$": { "type": "object" }, "^kobject_.*_updated_at$": { "type": "object" }, "^kobject_.*_customer_id$": { "type": "object" }, "^kobject_.*_company_id$": { "type": "object" }, "^kobject_.*_any_text$": { "type": "object" }, "company_created_at": { "type": "object" }, "company_updated_at": { "type": "object" } } }, "maxItems": 20, "uniqueItems": true } ] }, "sort": { "anyOf": [ { "type": "object" }, { "type": "array", "items": { "type": "object" }, "maxItems": 5, "uniqueItems": true } ] } }, "additionalProperties": false } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "meta": { "type": "object", "properties": { "pageSize": { "type": "integer" }, "page": { "type": "integer" }, "total": { "type": "integer" }, "totalPages": { "type": "integer" }, "aggregations": { "type": "object" } }, "required": [ "pageSize", "page", "total", "totalPages", "aggregations" ] }, "data": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "name": { "type": "string" }, "displayName": { "type": "string" }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "lastActivityAt": { "type": "string" }, "verified": { "type": "boolean" }, "rev": { "type": "integer" } }, "required": [ "name", "displayName", "createdAt", "updatedAt", "lastActivityAt", "verified", "rev" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "links": { "type": "object", "properties": { "self": { "type": "string" }, "first": { "type": "string" }, "prev": { "type": "string", "nullable": true }, "next": { "type": "string" }, "last": { "type": "string" } }, "required": [ "self", "first", "prev", "next", "last" ] } }, "required": [ "meta", "data", "links" ] }, "example": { "meta": { "pageSize": 100, "page": 1, "total": 7503, "totalPages": 76, "aggregations": {} }, "data": [ { "type": "customer", "id": "576db7781126c61100824494", "attributes": { "name": "Dave Smith", "displayName": "Dave", "createdAt": "2016-06-24T22:43:04.298Z", "updatedAt": "2016-06-24T22:43:04.298Z", "lastActivityAt": "2016-06-24T22:43:04.298Z", "verified": true, "rev": 1 }, "relationships": { "org": { "links": { "self": "/v1/orgs/573f7702a1a00c10005adc2a" }, "data": { "type": "org", "id": "573f7702a1a00c10005adc2a" } } }, "links": { "self": "/v1/customers/576db7781126c61100824494" } }, { "type": "customer", "id": "5771a9181126c611008253ff", "attributes": { "name": "Peter Johansen", "displayName": "Pete", "createdAt": "2016-07-27T22:30:48.939Z", "updatedAt": "2016-07-27T22:30:48.939Z", "lastActivityAt": "2016-07-27T22:30:48.939Z", "verified": true, "rev": 1 }, "relationships": { "org": { "links": { "self": "/v1/orgs/573f7702a1a00c10005adc2a" }, "data": { "type": "org", "id": "573f7702a1a00c10005adc2a" } } }, "links": { "self": "/v1/customers/5771a9181126c611008253ff" } } ], "links": { "self": "/v1/customers/search?page=1&pageSize=100", "first": "/v1/customers/search?page=1&pageSize=100", "prev": null, "next": "/v1/customers/search?page=2&pageSize=100", "last": "/v1/customers/search?page=76&pageSize=100" } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] } }, "/satisfaction": { "get": { "security": [ { "httpBearer": [] } ], "tags": [ "Satisfaction" ], "summary": "Get Satisfactions", "description": "Retrieves a paginated list of satisfaction forms for the organization.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.satisfaction.read|org.permission.satisfaction.read|", "operationId": "GetSatisfaction", "parameters": [ { "name": "page", "in": "query", "schema": { "type": "number", "default": 1, "example": 1 }, "description": "Number of pages to return for results. Default value: 1." }, { "name": "pageSize", "in": "query", "required": false, "schema": { "type": "number", "default": 100, "example": 100 }, "description": "Number of results to return per page. Default value: 100." } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "meta": { "type": "object", "properties": { "pageSize": { "type": "integer" }, "page": { "type": "integer" } }, "required": [ "pageSize", "page" ] }, "data": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "name": { "type": "string" }, "formType": { "type": "string" }, "enabled": { "type": "boolean" }, "channel": { "type": "string" }, "description": { "type": "string" }, "from": { "type": "object", "properties": { "account": { "type": "string" }, "app": { "type": "string" }, "channel": { "type": "string" } } }, "metaTitle": { "type": "string" }, "metaDescription": { "type": "string" }, "delayTime": { "type": "number" }, "scale": { "type": "object", "properties": { "options": { "type": "number" }, "type": { "type": "string" }, "labelHigh": { "type": "string" }, "labelLow": { "type": "string" } } }, "introduction": { "type": "string" }, "ratingPrompt": { "type": "string" }, "questions": { "type": "array" }, "positiveQuestions": { "type": "array" }, "negativeQuestions": { "type": "array" }, "allQuestions": { "type": "array" }, "followUpType": { "type": "string" }, "criteria": { "type": "object", "properties": { "and": { "type": "array" }, "or": { "type": "array" } } }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "modifiedAt": { "type": "string" } } }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "createdBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "modifiedBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "template": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "createdBy" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "links": { "type": "object", "properties": { "self": { "type": "string" }, "first": { "type": "string" }, "prev": { "type": "string", "nullable": true }, "next": { "type": "string", "nullable": true } }, "required": [ "self", "first", "prev", "next" ] } }, "required": [ "meta", "data", "links" ] }, "example": { "meta": { "pageSize": 100, "page": 1 }, "data": [ { "type": "satisfaction", "id": "5daf7921124be4f2960cb197", "attributes": { "name": "Satisfacton Form for Email", "formType": "csat", "enabled": true, "channel": "email", "description": "This survey will be sent when email conversations are marked done.", "from": { "channel": "email", "account": "support@test.mail.kustomerapp.com", "app": "postmark" }, "metaTitle": "Satisfaction", "metaDescription": "Email survey", "delayTime": 0, "scale": { "options": 5, "type": "number", "labelLow": "Terrible", "labelHigh": "Amazing" }, "introduction": "Tell us about your experience.", "ratingPrompt": "How satisfied are you with your interaction?", "questions": [], "positiveQuestions": [], "negativeQuestions": [], "allQuestions": [], "followUpType": "all", "criteria": { "and": [], "or": [] }, "createdAt": "2019-08-15T14:25:30.715Z", "updatedAt": "2022-07-11T19:52:48.296Z", "modified": "2022-07-11T19:52:48.296Z" }, "relationships": { "org": { "links": { "self": "/v1/orgs/57f29863a1dbf61100e6aa92" }, "data": { "type": "org", "id": "57f29863a1dbf61100e6aa92" } }, "createdBy": { "links": { "self": "/v1/users/58190b991f2932100010d683" }, "data": { "type": "user", "id": "58190b991f2932100010d683" } }, "modifiedBy": { "links": { "self": "/v1/users/58190b991f2932100010d683" }, "data": { "type": "user", "id": "58190b991f2932100010d683" } } } } ] } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] } }, "/slas/{id}": { "get": { "security": [ { "httpBearer": [] } ], "tags": [ "SLAs" ], "summary": "Get SLA by ID", "description": "Retrieves an [SLA](https://help.kustomer.com/service-level-agreements-SyZ4xWcgf) based on the unique SLA ID.\n\nUse the optional `versions` query param to retrieve information about SLA versions.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.user.sla.read|org.permission.sla.read|", "operationId": "GetSlaById", "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "currentVersion": { "type": "integer" }, "createdAt": { "type": "string" } }, "required": [ "currentVersion", "createdAt" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "createdBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "versions": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } } }, "required": [ "data" ] } }, "required": [ "org", "createdBy", "versions" ] } }, "required": [ "type", "id", "attributes", "relationships" ] }, "included": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "name": { "type": "string" }, "description": { "type": "string" }, "version": { "type": "integer" }, "hours": { "type": "string" }, "metrics": { "type": "object", "properties": { "firstResponse": { "type": "object", "properties": { "enabled": { "type": "boolean" }, "times": { "type": "object", "properties": { "1": { "type": "integer" }, "2": { "type": "integer" }, "3": { "type": "integer" }, "4": { "type": "integer" }, "5": { "type": "integer" } }, "required": [ "1", "2", "3", "4", "5" ] } }, "required": [ "enabled", "times" ] }, "longestUnrespondedMessage": { "type": "object", "properties": { "enabled": { "type": "boolean" }, "times": { "type": "object", "properties": { "1": { "type": "integer" }, "2": { "type": "integer" }, "3": { "type": "integer" }, "4": { "type": "integer" }, "5": { "type": "integer" } }, "required": [ "1", "2", "3", "4", "5" ] } }, "required": [ "enabled", "times" ] }, "totalConversationOpenTime": { "type": "object", "properties": { "enabled": { "type": "boolean" }, "times": { "type": "object" } }, "required": [ "enabled", "times" ] }, "totalCustomerWaitTime": { "type": "object", "properties": { "enabled": { "type": "boolean" }, "times": { "type": "object" } }, "required": [ "enabled", "times" ] } }, "required": [ "firstResponse", "longestUnrespondedMessage", "totalConversationOpenTime", "totalCustomerWaitTime" ] }, "criteria": { "type": "object", "properties": { "and": { "type": "array", "items": { "type": "object", "properties": { "conversation_channel": { "type": "object", "properties": { "operator": { "type": "string" }, "value": { "type": "string" } }, "required": [ "operator", "value" ] } }, "required": [ "conversation_channel" ] } } }, "required": [ "and" ] }, "createdAt": { "type": "string" } }, "required": [ "name", "description", "version", "hours", "metrics", "criteria", "createdAt" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "createdBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "sla": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "data", "links" ] } }, "required": [ "org", "createdBy", "sla" ] } }, "required": [ "type", "id", "attributes", "relationships" ] } }, "required": [ "data", "included" ] }, "example": { "data": { "type": "sla", "id": "5fadc1ba6647f1953ff94916", "attributes": { "currentVersion": 1, "createdAt": "2020-11-12T23:14:02.462Z" }, "relationships": { "org": { "links": { "self": "/v1/orgs/5d811e40de762100130174a8" }, "data": { "type": "org", "id": "5d811e40de762100130174a8" } }, "createdBy": { "links": { "self": "/v1/users/5d811e4f6be8d8001391132c" }, "data": { "type": "user", "id": "5d811e4f6be8d8001391132c" } }, "versions": { "data": [ { "type": "sla_version", "id": "5fadc1ba6647f10a1ef94915" }, { "type": "sla_version", "id": "5fadc1dd6647f175a7f9491e" } ] } } }, "included": { "type": "sla_version", "id": "5fadc1dd6647f175a7f9491e", "attributes": { "name": "Email Policy", "description": "SLA policy for email conversations.", "version": 1, "hours": "calendar", "metrics": { "firstResponse": { "enabled": true, "times": { "1": 3600000, "2": 3600000, "3": 3600000, "4": 3600000, "5": 3600000 } }, "longestUnrespondedMessage": { "enabled": true, "times": { "1": 14400000, "2": 14400000, "3": 14400000, "4": 14400000, "5": 14400000 } }, "totalConversationOpenTime": { "enabled": false, "times": {} }, "totalCustomerWaitTime": { "enabled": false, "times": {} } }, "criteria": { "and": [ { "conversation_channel": { "operator": "contains", "value": "email" } } ] }, "createdAt": "2020-11-12T23:14:37.406Z" }, "relationships": { "org": { "links": { "self": "/v1/orgs/5d811e40de762100130174a8" }, "data": { "type": "org", "id": "5d811e40de762100130174a8" } }, "createdBy": { "links": { "self": "/v1/users/5d811e4f6be8d8001391132c" }, "data": { "type": "user", "id": "5d811e4f6be8d8001391132c" } }, "sla": { "data": { "type": "sla", "id": "5fadc1ba6647f1953ff94916" }, "links": { "self": "/v1/slas/5fadc1ba6647f1953ff94916" } } } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ], "parameters": [ { "schema": { "type": "string", "enum": [ "active", "all" ], "example": "active" }, "in": "query", "name": "versions", "description": "Option to include information about SLA versions. Use `all` to retrieve information about all versions. Use `active` to retrieve information about the active version only." } ] }, "parameters": [ { "schema": { "type": "string", "example": "5fadc1ba6647f1953ff94916" }, "name": "id", "in": "path", "description": "Unique SLA ID.", "required": true } ] }, "/spam/senders": { "put": { "security": [ { "httpBearer": [] } ], "tags": [ "Spam" ], "summary": "Upsert spam sender", "description": "Assigns a spam list status for a new sender, or updates the spam list status for an existing sender.\n\nYou can assign senders to a `list` status: `whitelist` (never considered spam) or `blacklist` (always considered spam).\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.admin.spam.write|org.permission.spam.update|", "operationId": "UpsertSpamSender", "requestBody": { "description": "", "content": { "application/json": { "example": "{\n \"channel\": \"email\",\n \"sender\": \"allow@me.com\",\n \"list\": \"whitelist\"\n}" } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "sender": { "type": "string" }, "channel": { "type": "string" }, "list": { "type": "string" }, "createdAt": { "type": "string" }, "modifiedAt": { "type": "string" }, "updatedAt": { "type": "string" } }, "required": [ "sender", "channel", "list", "createdAt", "modifiedAt", "updatedAt" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "createdBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "modifiedBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "createdBy", "modifiedBy" ] } }, "required": [ "type", "id", "attributes", "relationships" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "sender", "id": "5f52b303775dbe9e4ed8f9a3", "attributes": { "sender": "allow@me.com", "channel": "email", "list": "whitelist", "createdAt": "2020-09-04T21:34:58.858Z", "modifiedAt": "2020-09-04T21:34:58.858Z", "updatedAt": "2020-09-04T21:34:58.858Z" }, "relationships": { "org": { "links": { "self": "/v1/orgs/5f06187f1adcf30013d1f08a" }, "data": { "type": "org", "id": "5f06187f1adcf30013d1f08a" } }, "createdBy": { "links": { "self": "/v1/users/5f51520d35f53c001405bc65" }, "data": { "type": "user", "id": "5f51520d35f53c001405bc65" } }, "modifiedBy": { "links": { "self": "/v1/users/5f51520d35f53c001405bc65" }, "data": { "type": "user", "id": "5f51520d35f53c001405bc65" } } } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] }, "get": { "security": [ { "httpBearer": [] } ], "tags": [ "Spam" ], "summary": "Get spam senders", "description": "Retrieves a paginated list of senders.\n\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.admin.spam.read|org.permission.spam.read|", "operationId": "GetSpamSenders", "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "meta": { "type": "object", "properties": { "pageSize": { "type": "integer" }, "page": { "type": "integer" } }, "required": [ "pageSize", "page" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" }, "first": { "type": "string" }, "prev": { "type": "string", "nullable": true }, "next": { "type": "string", "nullable": true } }, "required": [ "self", "first", "prev", "next" ] }, "data": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "sender": { "type": "string" }, "channel": { "type": "string" }, "list": { "type": "string" }, "createdAt": { "type": "string" }, "modifiedAt": { "type": "string" }, "updatedAt": { "type": "string" } }, "required": [ "sender", "channel", "list", "createdAt", "modifiedAt", "updatedAt" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "createdBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "modifiedBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "createdBy", "modifiedBy" ] } }, "required": [ "type", "id", "attributes", "relationships" ] } } }, "required": [ "meta", "links", "data" ] }, "example": { "meta": { "pageSize": 100, "page": 1 }, "links": { "self": "/v1/spam/senders?page=1&pageSize=100", "first": "/v1/spam/senders?page=1&pageSize=100", "prev": null, "next": null }, "data": [ { "type": "sender", "id": "5f52b303775dbe9e4ed8f9a3", "attributes": { "sender": "allow@me.com", "channel": "email", "list": "whitelist", "createdAt": "2020-09-04T21:34:58.858Z", "modifiedAt": "2020-09-04T21:34:58.858Z", "updatedAt": "2020-09-04T21:34:58.858Z" }, "relationships": { "org": { "links": { "self": "/v1/orgs/5f06187f1adcf30013d1f08a" }, "data": { "type": "org", "id": "5f06187f1adcf30013d1f08a" } }, "createdBy": { "links": { "self": "/v1/users/5f51520d35f53c001405bc65" }, "data": { "type": "user", "id": "5f51520d35f53c001405bc65" } }, "modifiedBy": { "links": { "self": "/v1/users/5f51520d35f53c001405bc65" }, "data": { "type": "user", "id": "5f51520d35f53c001405bc65" } } } } ] } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] } }, "/spam/senders/{id}": { "delete": { "security": [ { "httpBearer": [] } ], "tags": [ "Spam" ], "summary": "Delete a spam sender", "description": "Deletes a spam sender based on the unique sender ID.\nAny one of the following roles is required for this endpoint:\n\n|Legacy Role|Equivalent Permission Set Role|\n|-----|--------|\n|org.admin.spam.write|org.permission.spam.delete|", "operationId": "DeleteSpamSender", "responses": { "204": { "description": "Success", "content": { "text/plain": { "example": "" } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] }, "parameters": [ { "schema": { "type": "string", "example": "5f52b303775dbe9e4ed8f9a3" }, "name": "id", "in": "path", "required": true, "description": "Unique sender ID." } ] }, "/klasses/{name}/externalId={externalId}": { "parameters": [ { "schema": { "type": "string" }, "name": "name", "in": "path", "required": true, "description": "Name of KObject." }, { "schema": { "type": "string" }, "name": "externalId", "in": "path", "required": true, "description": "External ID of KObject." } ], "get": { "summary": "Get KObject by external ID", "tags": [ "KObjects (Custom Objects)" ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "title": { "type": "string" }, "icon": { "type": "string" }, "images": { "type": "array", "items": { "type": "string" } }, "custom": { "type": "object", "properties": { "orderStatusStr": { "type": "string" }, "shippingStatusStr": { "type": "string" }, "billingStatusStr": { "type": "string" }, "specialInstructionsStr": { "type": "string" }, "orderNumberNum": { "type": "integer" }, "orderDescriptionStr": { "type": "string" }, "totalPriceNum": { "type": "number" }, "orderUpdatedAt": { "type": "string" } }, "required": [ "orderStatusStr", "shippingStatusStr", "billingStatusStr", "specialInstructionsStr", "orderNumberNum", "orderDescriptionStr", "totalPriceNum", "orderUpdatedAt" ] }, "tags": { "type": "array" }, "updatedAt": { "type": "string" }, "createdAt": { "type": "string" }, "rev": { "type": "integer" }, "firstDone": { "type": "object", "properties": { "time": { "type": "integer", "example": 27122 }, "businessTime": { "type": "integer", "example": 27122 }, "createdAt": { "type": "string", "format": "date-time", "example": "2021-06-01T12:00:00Z" }, "createdBy": { "type": "string", "format": "object-id", "example": "60b6b1b3b3b3b3b3b3b3b3b3" }, "createdByTeam": { "type": "string", "format": "object-id", "example": "60b6b1b3b3b3b3b3b3b3b3b3" }, "assignedTeam": { "type": "string", "format": "object-id", "example": "60b6b1b3b3b3b3b3b3b3b3" }, "assignedUser": { "type": "string", "format": "object-id", "example": "60b6b1b3b3b3b3b3b3b3b3" }, "commentCount": { "type": "integer", "example": 1 } } }, "lastDone": { "type": "object", "properties": { "time": { "type": "integer", "example": 27122 }, "businessTime": { "type": "integer", "example": 27122 }, "createdAt": { "type": "string", "format": "date-time", "example": "2021-06-01T12:00:00Z" }, "createdBy": { "type": "string", "format": "object-id", "example": "60b6b1b3b3b3b3b3b3b3b3b3" }, "createdByTeam": { "type": "string", "format": "object-id", "example": "60b6b1b3b3b3b3b3b3b3b3b3" }, "assignedTeam": { "type": "string", "format": "object-id", "example": "60b6b1b3b3b3b3b3b3b3b3" }, "assignedUser": { "type": "string", "format": "object-id", "example": "60b6b1b3b3b3b3b3b3b3b3" }, "commentCount": { "type": "integer", "example": 1 } } }, "doneCount": { "type": "integer", "example": 0 }, "reopenCount": { "type": "integer", "example": 0 }, "reopenFromDoneCount": { "type": "integer", "example": 0 }, "queue": { "type": "string", "format": "object-id", "example": "60b6b1b3b3b3b3b3b3b3b3b3" }, "assignedUser": { "type": "string", "format": "object-id", "example": "60b6b1b3b3b3b3b3b3b3b3" }, "status": { "type": "string", "enum": [ "open", "done" ], "example": "open" } }, "required": [ "title", "icon", "images", "custom", "tags", "updatedAt", "createdAt", "rev" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "klass": { "type": "object", "properties": { "link": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "link", "data" ] } }, "required": [ "org", "klass" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "kobject.order", "id": "5826ab180fcc2514008b2a94", "attributes": { "externalId": "foo", "title": "Order #1059 (3 items ordered for $64.67)", "icon": "truck-delivery", "images": [ "https://cdn.shopify.com/s/files/1/1489/4596/products/hoodie-2_1.jpg", "https://kustomer-integrations.s3.amazonaws.com/kusty-swag/img/koffee.png", "https://cdn.shopify.com/s/files/1/1489/4596/products/shirt-3_large.jpg?v=1473819771" ], "custom": { "orderStatusStr": "fulfilled", "shippingStatusStr": "fulfilled", "billingStatusStr": "authorized", "specialInstructionsStr": "The tshirt is a gift, can you include a gift bag?", "orderNumberNum": 1059, "orderDescriptionStr": "3 items ordered for $64.67", "totalPriceNum": 64.67, "orderUpdatedAt": "2016-11-06T13:54:29-05:00" }, "tags": [], "updatedAt": "2016-11-12T05:39:36.976Z", "createdAt": "2016-11-12T05:39:36.976Z", "rev": 0, "queue": "6421a6410258a60037f2546b", "assignedUser": "6421a63ec08d8d001ff95195", "status": "open", "reopenCount": 0, "doneCount": 0, "reopenFromDoneCount": 0, "firstDone": { "time": { "type": "integer", "example": 27122 }, "businessTime": { "type": "integer", "example": 27122 }, "createdAt": { "type": "string", "format": "date-time", "example": "2021-06-01T12:00:00Z" }, "createdBy": { "type": "string", "format": "object-id", "example": "60b6b1b3b3b3b3b3b3b3b3b3" }, "createdByTeam": { "type": "string", "format": "object-id", "example": "60b6b1b3b3b3b3b3b3b3b3b3" }, "assignedTeam": { "type": "string", "format": "object-id", "example": "60b6b1b3b3b3b3b3b3b3b3" }, "assignedUser": { "type": "string", "format": "object-id", "example": "60b6b1b3b3b3b3b3b3b3b3" }, "commentCount": { "type": "integer", "example": 1 } }, "lastDone": { "time": { "type": "integer", "example": 27122 }, "businessTime": { "type": "integer", "example": 27122 }, "createdAt": { "type": "string", "format": "date-time", "example": "2021-06-01T12:00:00Z" }, "createdBy": { "type": "string", "format": "object-id", "example": "60b6b1b3b3b3b3b3b3b3b3b3" }, "createdByTeam": { "type": "string", "format": "object-id", "example": "60b6b1b3b3b3b3b3b3b3b3b3" }, "assignedTeam": { "type": "string", "format": "object-id", "example": "60b6b1b3b3b3b3b3b3b3b3" }, "assignedUser": { "type": "string", "format": "object-id", "example": "60b6b1b3b3b3b3b3b3b3b3" }, "commentCount": { "type": "integer", "example": 1 } } }, "relationships": { "org": { "links": { "self": "/v1/orgs/57bb5d2e32e83a130052e94e" }, "data": { "type": "org", "id": "57bb5d2e32e83a130052e94e" } }, "klass": { "link": { "self": "/v1/klasses/order" }, "data": { "type": "klass", "id": "order" } } }, "links": { "self": "/v1/klasses/orders/externalId=foo" } } } } } } }, "operationId": "GetKlassesByNameAndExternalId", "description": "Retrieve KObject by name and unique external ID.", "security": [ { "httpBearer": [] } ] } }, "/auth/settings": { "get": { "security": [ { "httpBearer": [] } ], "tags": [ "Auth Settings" ], "summary": "Get Auth Settings", "description": "Gets authentication settings for the organization\n\n#### NOTE\n>Requires **org.admin.security** privileges", "operationId": "GetAuthSettings", "parameters": [], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "kustomer": { "type": "object", "properties": { "enabled": { "type": "boolean" } }, "required": [ "enabled" ] }, "google": { "type": "object", "properties": { "enabled": { "type": "boolean" } }, "required": [ "enabled" ] }, "saml": { "type": "object", "properties": { "idpPublicCerts": { "type": "array", "items": { "type": "string" } }, "idpLoginUrl": { "type": "string" }, "idpLogoutUrl": { "type": "string" }, "idpIssuerId": { "type": "string" }, "forceAuth": { "type": "boolean" }, "signRequests": { "type": "boolean" }, "allowUnencryptedAssert": { "type": "boolean" }, "enabled": { "type": "boolean" } }, "required": [ "idpPublicCerts", "idpLoginUrl", "idpLogoutUrl", "idpIssuerId", "forceAuth", "signRequests", "allowUnencryptedAssert", "enabled" ] }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "modifiedAt": { "type": "string" } }, "required": [ "kustomer", "google", "saml", "createdAt", "updatedAt", "modifiedAt" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "data", "links" ] }, "modifiedBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "modifiedBy" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "auth_settings", "id": "5835002161599d1400acdaf9", "attributes": { "kustomer": { "enabled": true }, "google": { "enabled": false }, "saml": { "idpPublicCerts": [ "-----BEGIN CERTIFICATE-----...-----END CERTIFICATE-----" ], "idpLoginUrl": "...", "idpLogoutUrl": "...", "idpIssuerId": "...", "forceAuth": false, "signRequests": false, "allowUnencryptedAssert": true, "enabled": true }, "createdAt": "2016-12-21T13:10:58.555Z", "updatedAt": "2016-12-21T13:45:06.455Z", "modifiedAt": "2016-12-21T13:10:58.555Z" }, "relationships": { "org": { "data": { "type": "org", "id": "5835002161599d1400acdaf9" }, "links": { "self": "/v1/orgs/5835002161599d1400acdaf9" } }, "modifiedBy": { "links": { "self": "/v1/users/5835002261599d1400acdafa" }, "data": { "type": "user", "id": "5835002261599d1400acdafa" } } }, "links": { "self": "/v1/auth/settings" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] }, "put": { "security": [ { "httpBearer": [] } ], "tags": [ "Auth Settings" ], "summary": "Update Auth Settings", "description": "Updates authentication settings for the organization\n\n#### NOTE\n>Requires **org.admin.security** privileges", "operationId": "UpdateAuthSettings", "parameters": [], "requestBody": { "description": "", "content": { "application/json": { "schema": { "type": "object", "properties": { "kustomer": { "type": "object", "properties": { "enabled": { "type": "boolean" } }, "additionalProperties": false, "required": [ "enabled" ] }, "google": { "type": "object", "properties": { "enabled": { "type": "boolean" } }, "additionalProperties": false, "required": [ "enabled" ] }, "saml": { "type": "object", "properties": { "idpPublicCerts": { "type": "array", "items": { "type": "string" } }, "idpLoginUrl": { "type": "string" }, "idpLogoutUrl": { "type": "string" }, "idpIssuerId": { "type": "string" }, "forceAuth": { "type": "boolean" }, "signRequests": { "type": "boolean" }, "allowUnencryptedAssert": { "type": "boolean" }, "enabled": { "type": "boolean" } }, "additionalProperties": false, "required": [ "enabled" ] }, "app": { "type": "object", "properties": { "userSessionExpirationMilliseconds": { "type": "number", "minimum": 600000, "maximum": 2592000000 } }, "additionalProperties": false } }, "required": [ "kustomer", "google" ], "additionalProperties": false } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "kustomer": { "type": "object", "properties": { "enabled": { "type": "boolean" } }, "required": [ "enabled" ] }, "google": { "type": "object", "properties": { "enabled": { "type": "boolean" } }, "required": [ "enabled" ] }, "saml": { "type": "object", "properties": { "idpPublicCerts": { "type": "array", "items": { "type": "string" } }, "idpLoginUrl": { "type": "string" }, "idpLogoutUrl": { "type": "string" }, "idpIssuerId": { "type": "string" }, "forceAuth": { "type": "boolean" }, "signRequests": { "type": "boolean" }, "allowUnencryptedAssert": { "type": "boolean" }, "enabled": { "type": "boolean" } }, "required": [ "idpPublicCerts", "idpLoginUrl", "idpLogoutUrl", "idpIssuerId", "forceAuth", "signRequests", "allowUnencryptedAssert", "enabled" ] }, "app": { "type": "object", "properties": { "userSessionExpirationMilliseconds": { "type": "integer" } }, "required": [ "userSessionExpirationMilliseconds" ] }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "modifiedAt": { "type": "string" } }, "required": [ "kustomer", "google", "saml", "app", "createdAt", "updatedAt", "modifiedAt" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "data", "links" ] }, "modifiedBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "modifiedBy" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "auth_settings", "id": "5835002161599d1400acdaf9", "attributes": { "kustomer": { "enabled": true }, "google": { "enabled": true }, "saml": { "idpPublicCerts": [ "-----BEGIN CERTIFICATE-----...-----END CERTIFICATE-----" ], "idpLoginUrl": "...", "idpLogoutUrl": "...", "idpIssuerId": "...", "forceAuth": false, "signRequests": false, "allowUnencryptedAssert": true, "enabled": true }, "app": { "userSessionExpirationMilliseconds": 2592000000 }, "createdAt": "2016-12-21T13:10:58.555Z", "updatedAt": "2016-12-21T13:45:06.455Z", "modifiedAt": "2016-12-21T13:10:58.555Z" }, "relationships": { "org": { "data": { "type": "org", "id": "5835002161599d1400acdaf9" }, "links": { "self": "/v1/orgs/5835002161599d1400acdaf9" } }, "modifiedBy": { "links": { "self": "/v1/users/5835002261599d1400acdafa" }, "data": { "type": "user", "id": "5835002261599d1400acdafa" } } }, "links": { "self": "/v1/auth/settings" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] } }, "/auth/customer/settings": { "get": { "security": [ { "httpBearer": [] } ], "tags": [ "Auth Settings" ], "summary": "Get Auth Customer Settings", "description": "Gets customer authentication settings, including a generated secret token.\n\n#### NOTE\n>Requires **org.admin** privileges", "operationId": "GetAuthCustomerSettings", "parameters": [], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "secret": { "type": "string" }, "corsWhitelist": { "type": "array" }, "updatedAt": { "type": "string" }, "createdAt": { "type": "string" } }, "required": [ "secret", "corsWhitelist", "updatedAt", "createdAt" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "data", "links" ] } }, "required": [ "org" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "customer_auth_settings", "id": "5d4dbe1c727b490013880c89", "attributes": { "secret": "-----SECRET-----", "corsWhitelist": [], "updatedAt": "2019-10-18T15:26:26.666Z", "createdAt": "2019-10-18T15:26:26.666Z" }, "relationships": { "org": { "data": { "type": "org", "id": "5d4dbe1c727b490013880c89" }, "links": { "self": "/v1/orgs/5d4dbe1c727b490013880c89" } } }, "links": { "self": "/v1/auth/customer/settings" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] } }, "/p/auth/settings": { "get": { "tags": [ "Auth Settings" ], "summary": "Get Public Auth Settings", "description": "Gets public authentication settings for the organization.", "operationId": "GetPublicAuthSettings", "parameters": [], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "kustomer": { "type": "object", "properties": { "enabled": { "type": "boolean" } }, "required": [ "enabled" ] }, "google": { "type": "object", "properties": { "enabled": { "type": "boolean" } }, "required": [ "enabled" ] }, "saml": { "type": "object", "properties": { "enabled": { "type": "boolean" } }, "required": [ "enabled" ] } }, "required": [ "kustomer", "google", "saml" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "auth_settings", "id": "jeremy-2016-11-22-test1", "attributes": { "kustomer": { "enabled": true }, "google": { "enabled": false }, "saml": { "enabled": false } }, "links": { "self": "/p/v1/auth/settings" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] } }, "/auth/tokens": { "post": { "tags": [ "Auth Tokens" ], "summary": "Create Token", "description": "Logs in to an organization with domain, email, and password.\n\n#### NOTE\n> **Machine tokens** can be created within the settings section by an administrator for API, tracking, and hook access", "operationId": "CreateToken", "parameters": [], "requestBody": { "description": "", "content": { "application/json": { "schema": { "type": "object", "properties": { "domain": { "type": "string", "pattern": "^[a-zA-Z0-9]{1}[a-zA-Z0-9-_]+$", "minLength": 3, "maxLength": 256 }, "email": { "type": "string", "format": "email", "maxLength": 256 }, "password": { "type": "string", "minLength": 3, "maxLength": 256 }, "singleAccessToken": { "type": "string", "maxLength": 256 }, "googleAuthToken": { "type": "string" }, "samlAuthToken": { "type": "string" }, "remember": { "type": "boolean" } }, "anyOf": [ { "required": [ "domain", "email", "password" ] }, { "required": [ "domain", "singleAccessToken" ] }, { "required": [ "domain", "googleAuthToken" ] }, { "required": [ "domain", "samlAuthToken" ] } ], "additionalProperties": false } } } }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "token": { "type": "string" }, "lastTokenChars": { "type": "string" }, "name": { "type": "string" }, "ipAddress": { "type": "string" }, "userAgent": { "type": "string" }, "roles": { "type": "array", "items": { "type": "string" } }, "updatedAt": { "type": "string" }, "createdAt": { "type": "string" }, "lastAccessedAt": { "type": "string" } }, "required": [ "token", "lastTokenChars", "name", "ipAddress", "userAgent", "roles", "updatedAt", "createdAt", "lastAccessedAt" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "user": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "user" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "auth_token", "id": "5822276811e88a1000787abe", "attributes": { "token": "...", "lastTokenChars": "xyz123", "name": "Jeremy", "ipAddress": "::ffff:10.0.5.222", "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.71 Safari/537.36", "roles": [ "org" ], "updatedAt": "2016-11-08T19:28:40.280Z", "createdAt": "2016-11-08T19:28:40.280Z", "lastAccessedAt": "2016-11-08T19:28:40.280Z" }, "relationships": { "org": { "links": { "self": "/v1/orgs/57f29863a1dbf61100e6aa92" }, "data": { "type": "org", "id": "57f29863a1dbf61100e6aa92" } }, "user": { "links": { "self": "/v1/users/58190b991f2932100010d683" }, "data": { "type": "user", "id": "58190b991f2932100010d683" } } }, "links": { "self": "/v1/auth/tokens/5822276811e88a1000787abe" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] }, "get": { "security": [ { "httpBearer": [] } ], "tags": [ "Auth Tokens" ], "summary": "Get Auth Tokens", "description": "Returns a list of all auth tokens associated with the current authenticated user\n\n#### NOTE\n> Requires **org.admin.security** privileges", "operationId": "GetAuthTokens", "parameters": [], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "meta": { "type": "object", "properties": { "pageSize": { "type": "string" }, "page": { "type": "string" } }, "required": [ "pageSize", "page" ] }, "data": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "lastTokenChars": { "type": "string" }, "name": { "type": "string" }, "ipAddress": { "type": "string" }, "userAgent": { "type": "string" }, "roles": { "type": "array", "items": { "type": "string" } }, "updatedAt": { "type": "string" }, "createdAt": { "type": "string" }, "lastAccessedAt": { "type": "string" } }, "required": [ "lastTokenChars", "name", "ipAddress", "userAgent", "roles", "updatedAt", "createdAt", "lastAccessedAt" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "user": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "user" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "links": { "type": "object", "properties": { "self": { "type": "string" }, "first": { "type": "string" }, "prev": { "type": "string" }, "next": { "type": "string" } }, "required": [ "self", "first", "prev", "next" ] } }, "required": [ "meta", "data", "links" ] }, "example": { "meta": { "pageSize": "", "page": "" }, "data": [ { "type": "", "id": "", "attributes": { "lastTokenChars": "", "name": "", "ipAddress": "", "userAgent": "", "roles": [ "", "" ], "updatedAt": "", "createdAt": "", "lastAccessedAt": "" }, "relationships": { "org": { "links": { "self": "" }, "data": { "type": "", "id": "" } }, "user": { "links": { "self": "" }, "data": { "type": "", "id": "" } } }, "links": { "self": "" } }, { "type": "", "id": "", "attributes": { "lastTokenChars": "", "name": "", "ipAddress": "", "userAgent": "", "roles": [ "", "" ], "updatedAt": "", "createdAt": "", "lastAccessedAt": "" }, "relationships": { "org": { "links": { "self": "" }, "data": { "type": "", "id": "" } }, "user": { "links": { "self": "" }, "data": { "type": "", "id": "" } } }, "links": { "self": "" } } ], "links": { "self": "", "first": "", "prev": "schema type not provided", "next": "schema type not provided" } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] } }, "/auth/tokens/{id}": { "get": { "security": [ { "httpBearer": [] } ], "tags": [ "Auth Tokens" ], "summary": "Get Auth Token by ID", "description": "Gets an authentication token for any user within the organization by id\n\n#### NOTE\n> Requires **org.admin** privileges", "operationId": "GetAuthTokenById", "parameters": [ { "name": "id", "in": "path", "description": "*required* unique token id", "required": true, "style": "simple", "schema": { "type": "string", "example": "" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "lastTokenChars": { "type": "string" }, "name": { "type": "string" }, "ipAddress": { "type": "string" }, "userAgent": { "type": "string" }, "roles": { "type": "array", "items": { "type": "string" } }, "updatedAt": { "type": "string" }, "createdAt": { "type": "string" }, "lastAccessedAt": { "type": "string" } }, "required": [ "lastTokenChars", "name", "ipAddress", "userAgent", "roles", "updatedAt", "createdAt", "lastAccessedAt" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "user": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "user" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "", "id": "", "attributes": { "lastTokenChars": "", "name": "", "ipAddress": "", "userAgent": "", "roles": [ "", "" ], "updatedAt": "", "createdAt": "", "lastAccessedAt": "" }, "relationships": { "org": { "links": { "self": "" }, "data": { "type": "", "id": "" } }, "user": { "links": { "self": "" }, "data": { "type": "", "id": "" } } }, "links": { "self": "" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] }, "delete": { "security": [ { "httpBearer": [] } ], "tags": [ "Auth Tokens" ], "summary": "Delete Auth Token by ID", "description": "Deletes an authentication token for any user within the organization by id", "operationId": "DeleteAuthTokenById", "parameters": [ { "name": "id", "in": "path", "description": "Unique token id", "required": true, "style": "simple", "schema": { "type": "string", "example": "" } } ], "responses": { "204": { "description": "No Content", "content": { "text/plain": { "example": "" } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] } }, "/auth/tokens/current": { "get": { "security": [ { "httpBearer": [] } ], "tags": [ "Auth Tokens" ], "summary": "Get Current Auth Token", "description": "Gets the current authentication token data", "operationId": "GetCurrentAuthToken", "parameters": [], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "lastTokenChars": { "type": "string" }, "name": { "type": "string" }, "ipAddress": { "type": "string" }, "userAgent": { "type": "string" }, "roles": { "type": "array", "items": { "type": "string" } }, "updatedAt": { "type": "string" }, "createdAt": { "type": "string" }, "lastAccessedAt": { "type": "string" } }, "required": [ "lastTokenChars", "name", "ipAddress", "userAgent", "roles", "updatedAt", "createdAt", "lastAccessedAt" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "user": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "user" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "auth_token", "id": "5822276811e88a1000787abe", "attributes": { "lastTokenChars": "xyz123", "name": "Jeremy", "ipAddress": "::ffff:10.0.5.222", "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.71 Safari/537.36", "roles": [ "org" ], "updatedAt": "2016-11-08T19:28:40.280Z", "createdAt": "2016-11-08T19:28:40.280Z", "lastAccessedAt": "2016-11-08T19:28:40.280Z" }, "relationships": { "org": { "links": { "self": "/v1/orgs/57f29863a1dbf61100e6aa92" }, "data": { "type": "org", "id": "57f29863a1dbf61100e6aa92" } }, "user": { "links": { "self": "/v1/users/58190b991f2932100010d683" }, "data": { "type": "user", "id": "58190b991f2932100010d683" } } }, "links": { "self": "/v1/auth/tokens/5822276811e88a1000787abe" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] }, "delete": { "security": [ { "httpBearer": [] } ], "tags": [ "Auth Tokens" ], "summary": "Delete Current Auth Token", "description": "Deletes the current authentication token", "operationId": "DeleteCurrentAuthToken", "parameters": [], "responses": { "204": { "description": "No Content", "content": { "text/plain": { "example": "" } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] } }, "/auth/roles": { "get": { "security": [ { "httpBearer": [] } ], "tags": [ "Role Groups" ], "summary": "Get Auth Roles", "description": "Gets available organization Roles", "operationId": "GetAuthRoles", "parameters": [], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } } }, "required": [ "data" ] }, "example": { "data": [ { "type": "role", "id": "org" }, { "type": "role", "id": "org.tracking" }, { "type": "role", "id": "org.hooks" }, { "type": "role", "id": "org.admin" }, { "type": "role", "id": "org.admin.read" }, { "type": "role", "id": "org.admin.write" }, { "type": "role", "id": "org.admin.analytics" }, { "type": "role", "id": "org.admin.analytics.read" }, { "type": "role", "id": "org.admin.analytics.write" }, { "type": "role", "id": "org.admin.api" }, { "type": "role", "id": "org.admin.api.read" }, { "type": "role", "id": "org.admin.api.write" }, { "type": "role", "id": "org.admin.apps" }, { "type": "role", "id": "org.admin.apps.read" }, { "type": "role", "id": "org.admin.apps.write" }, { "type": "role", "id": "org.admin.audit_logs" }, { "type": "role", "id": "org.admin.audit_logs.read" }, { "type": "role", "id": "org.admin.audit_logs.write" }, { "type": "role", "id": "org.admin.billing" }, { "type": "role", "id": "org.admin.billing.read" }, { "type": "role", "id": "org.admin.billing.write" }, { "type": "role", "id": "org.admin.campaign" }, { "type": "role", "id": "org.admin.campaign.read" }, { "type": "role", "id": "org.admin.campaign.write" }, { "type": "role", "id": "org.admin.business_rule" }, { "type": "role", "id": "org.admin.business_rule.read" }, { "type": "role", "id": "org.admin.business_rule.write" }, { "type": "role", "id": "org.admin.content" }, { "type": "role", "id": "org.admin.content.read" }, { "type": "role", "id": "org.admin.content.write" }, { "type": "role", "id": "org.admin.shortcut" }, { "type": "role", "id": "org.admin.shortcut.read" }, { "type": "role", "id": "org.admin.shortcut.write" }, { "type": "role", "id": "org.admin.content.shortcut" }, { "type": "role", "id": "org.admin.content.shortcut.read" }, { "type": "role", "id": "org.admin.content.shortcut.write" }, { "type": "role", "id": "org.admin.template" }, { "type": "role", "id": "org.admin.template.read" }, { "type": "role", "id": "org.admin.template.write" }, { "type": "role", "id": "org.admin.content.template" }, { "type": "role", "id": "org.admin.content.template.read" }, { "type": "role", "id": "org.admin.content.template.write" }, { "type": "role", "id": "org.admin.kb" }, { "type": "role", "id": "org.admin.kb.read" }, { "type": "role", "id": "org.admin.kb.write" }, { "type": "role", "id": "org.admin.content.kb" }, { "type": "role", "id": "org.admin.content.kb.read" }, { "type": "role", "id": "org.admin.content.kb.write" }, { "type": "role", "id": "org.admin.satisfaction" }, { "type": "role", "id": "org.admin.satisfaction.read" }, { "type": "role", "id": "org.admin.satisfaction.write" }, { "type": "role", "id": "org.admin.snippet" }, { "type": "role", "id": "org.admin.snippet.read" }, { "type": "role", "id": "org.admin.snippet.write" }, { "type": "role", "id": "org.admin.content.snippet" }, { "type": "role", "id": "org.admin.content.snippet.read" }, { "type": "role", "id": "org.admin.content.snippet.write" }, { "type": "role", "id": "org.admin.conversation.delete" }, { "type": "role", "id": "org.admin.conversation.delete.read" }, { "type": "role", "id": "org.admin.conversation.delete.write" }, { "type": "role", "id": "org.admin.conversation.merge" }, { "type": "role", "id": "org.admin.conversation.merge.read" }, { "type": "role", "id": "org.admin.conversation.merge.write" }, { "type": "role", "id": "org.admin.customer.delete" }, { "type": "role", "id": "org.admin.customer.delete.read" }, { "type": "role", "id": "org.admin.customer.delete.write" }, { "type": "role", "id": "org.admin.customer.merge" }, { "type": "role", "id": "org.admin.customer.merge.read" }, { "type": "role", "id": "org.admin.customer.merge.write" }, { "type": "role", "id": "org.admin.hook" }, { "type": "role", "id": "org.admin.hook.read" }, { "type": "role", "id": "org.admin.hook.write" }, { "type": "role", "id": "org.admin.klass" }, { "type": "role", "id": "org.admin.klass.read" }, { "type": "role", "id": "org.admin.klass.write" }, { "type": "role", "id": "org.admin.kview" }, { "type": "role", "id": "org.admin.kview.read" }, { "type": "role", "id": "org.admin.kview.write" }, { "type": "role", "id": "org.admin.logs" }, { "type": "role", "id": "org.admin.logs.read" }, { "type": "role", "id": "org.admin.logs.write" }, { "type": "role", "id": "org.admin.message" }, { "type": "role", "id": "org.admin.message.read" }, { "type": "role", "id": "org.admin.message.write" }, { "type": "role", "id": "org.admin.metadata" }, { "type": "role", "id": "org.admin.metadata.read" }, { "type": "role", "id": "org.admin.metadata.write" }, { "type": "role", "id": "org.admin.reference" }, { "type": "role", "id": "org.admin.reference.read" }, { "type": "role", "id": "org.admin.reference.write" }, { "type": "role", "id": "org.admin.role_group" }, { "type": "role", "id": "org.admin.role_group.read" }, { "type": "role", "id": "org.admin.role_group.write" }, { "type": "role", "id": "org.admin.routing" }, { "type": "role", "id": "org.admin.routing.read" }, { "type": "role", "id": "org.admin.routing.write" }, { "type": "role", "id": "org.admin.schedule" }, { "type": "role", "id": "org.admin.schedule.read" }, { "type": "role", "id": "org.admin.schedule.write" }, { "type": "role", "id": "org.admin.search" }, { "type": "role", "id": "org.admin.search.read" }, { "type": "role", "id": "org.admin.search.write" }, { "type": "role", "id": "org.admin.security" }, { "type": "role", "id": "org.admin.security.read" }, { "type": "role", "id": "org.admin.security.write" }, { "type": "role", "id": "org.admin.send_action" }, { "type": "role", "id": "org.admin.send_action.read" }, { "type": "role", "id": "org.admin.send_action.write" }, { "type": "role", "id": "org.admin.setting" }, { "type": "role", "id": "org.admin.setting.read" }, { "type": "role", "id": "org.admin.setting.write" }, { "type": "role", "id": "org.admin.sla" }, { "type": "role", "id": "org.admin.sla.read" }, { "type": "role", "id": "org.admin.sla.write" }, { "type": "role", "id": "org.admin.snooze" }, { "type": "role", "id": "org.admin.snooze.read" }, { "type": "role", "id": "org.admin.snooze.write" }, { "type": "role", "id": "org.admin.content.snooze" }, { "type": "role", "id": "org.admin.content.snooze.read" }, { "type": "role", "id": "org.admin.content.snooze.write" }, { "type": "role", "id": "org.admin.sub_status" }, { "type": "role", "id": "org.admin.sub_status.read" }, { "type": "role", "id": "org.admin.sub_status.write" }, { "type": "role", "id": "org.admin.content.sub_status" }, { "type": "role", "id": "org.admin.content.sub_status.read" }, { "type": "role", "id": "org.admin.content.sub_status.write" }, { "type": "role", "id": "org.admin.tag" }, { "type": "role", "id": "org.admin.tag.read" }, { "type": "role", "id": "org.admin.tag.write" }, { "type": "role", "id": "org.admin.team" }, { "type": "role", "id": "org.admin.team.read" }, { "type": "role", "id": "org.admin.team.write" }, { "type": "role", "id": "org.admin.user" }, { "type": "role", "id": "org.admin.user.read" }, { "type": "role", "id": "org.admin.user.write" }, { "type": "role", "id": "org.admin.user-activity" }, { "type": "role", "id": "org.admin.user-activity.read" }, { "type": "role", "id": "org.admin.user-activity.write" }, { "type": "role", "id": "org.admin.workflow" }, { "type": "role", "id": "org.admin.workflow.read" }, { "type": "role", "id": "org.admin.workflow.write" }, { "type": "role", "id": "org.user" }, { "type": "role", "id": "org.user.read" }, { "type": "role", "id": "org.user.write" }, { "type": "role", "id": "org.user.apps" }, { "type": "role", "id": "org.user.apps.read" }, { "type": "role", "id": "org.user.apps.write" }, { "type": "role", "id": "org.user.audit_logs" }, { "type": "role", "id": "org.user.audit_logs.read" }, { "type": "role", "id": "org.user.audit_logs.write" }, { "type": "role", "id": "org.user.attachment" }, { "type": "role", "id": "org.user.attachment.read" }, { "type": "role", "id": "org.user.attachment.write" }, { "type": "role", "id": "org.user.bulk" }, { "type": "role", "id": "org.user.bulk.read" }, { "type": "role", "id": "org.user.bulk.write" }, { "type": "role", "id": "org.user.company" }, { "type": "role", "id": "org.user.company.read" }, { "type": "role", "id": "org.user.company.write" }, { "type": "role", "id": "org.user.content" }, { "type": "role", "id": "org.user.content.read" }, { "type": "role", "id": "org.user.content.write" }, { "type": "role", "id": "org.user.content.shortcut" }, { "type": "role", "id": "org.user.content.shortcut.read" }, { "type": "role", "id": "org.user.content.shortcut.write" }, { "type": "role", "id": "org.user.content.snippet" }, { "type": "role", "id": "org.user.content.snippet.read" }, { "type": "role", "id": "org.user.content.snippet.write" }, { "type": "role", "id": "org.user.conversation" }, { "type": "role", "id": "org.user.conversation.read" }, { "type": "role", "id": "org.user.conversation.write" }, { "type": "role", "id": "org.user.conversation_forward" }, { "type": "role", "id": "org.user.conversation_forward.read" }, { "type": "role", "id": "org.user.conversation_forward.write" }, { "type": "role", "id": "org.user.customer" }, { "type": "role", "id": "org.user.customer.read" }, { "type": "role", "id": "org.user.customer.write" }, { "type": "role", "id": "org.user.customer.watcher" }, { "type": "role", "id": "org.user.customer.watcher.read" }, { "type": "role", "id": "org.user.customer.watcher.write" }, { "type": "role", "id": "org.user.draft" }, { "type": "role", "id": "org.user.draft.read" }, { "type": "role", "id": "org.user.draft.write" }, { "type": "role", "id": "org.user.event" }, { "type": "role", "id": "org.user.event.read" }, { "type": "role", "id": "org.user.event.write" }, { "type": "role", "id": "org.user.job" }, { "type": "role", "id": "org.user.job.read" }, { "type": "role", "id": "org.user.job.write" }, { "type": "role", "id": "org.user.kb" }, { "type": "role", "id": "org.user.kb.read" }, { "type": "role", "id": "org.user.kb.write" }, { "type": "role", "id": "org.user.klass" }, { "type": "role", "id": "org.user.klass.read" }, { "type": "role", "id": "org.user.klass.write" }, { "type": "role", "id": "org.user.kobject" }, { "type": "role", "id": "org.user.kobject.read" }, { "type": "role", "id": "org.user.kobject.write" }, { "type": "role", "id": "org.user.kview" }, { "type": "role", "id": "org.user.kview.read" }, { "type": "role", "id": "org.user.kview.write" }, { "type": "role", "id": "org.user.logs" }, { "type": "role", "id": "org.user.logs.read" }, { "type": "role", "id": "org.user.logs.write" }, { "type": "role", "id": "org.user.media" }, { "type": "role", "id": "org.user.media.read" }, { "type": "role", "id": "org.user.media.write" }, { "type": "role", "id": "org.user.message" }, { "type": "role", "id": "org.user.message.read" }, { "type": "role", "id": "org.user.message.write" }, { "type": "role", "id": "org.user.metadata" }, { "type": "role", "id": "org.user.metadata.read" }, { "type": "role", "id": "org.user.metadata.write" }, { "type": "role", "id": "org.user.note" }, { "type": "role", "id": "org.user.note.read" }, { "type": "role", "id": "org.user.note.write" }, { "type": "role", "id": "org.user.notification" }, { "type": "role", "id": "org.user.notification.read" }, { "type": "role", "id": "org.user.notification.write" }, { "type": "role", "id": "org.user.reference" }, { "type": "role", "id": "org.user.reference.read" }, { "type": "role", "id": "org.user.reference.write" }, { "type": "role", "id": "org.user.role_group" }, { "type": "role", "id": "org.user.role_group.read" }, { "type": "role", "id": "org.user.role_group.write" }, { "type": "role", "id": "org.user.routing" }, { "type": "role", "id": "org.user.routing.read" }, { "type": "role", "id": "org.user.routing.write" }, { "type": "role", "id": "org.user.satisfaction" }, { "type": "role", "id": "org.user.satisfaction.read" }, { "type": "role", "id": "org.user.satisfaction.write" }, { "type": "role", "id": "org.user.search" }, { "type": "role", "id": "org.user.search.read" }, { "type": "role", "id": "org.user.search.write" }, { "type": "role", "id": "org.user.send_action" }, { "type": "role", "id": "org.user.send_action.read" }, { "type": "role", "id": "org.user.send_action.write" }, { "type": "role", "id": "org.user.setting" }, { "type": "role", "id": "org.user.setting.read" }, { "type": "role", "id": "org.user.setting.write" }, { "type": "role", "id": "org.user.shortcut" }, { "type": "role", "id": "org.user.shortcut.read" }, { "type": "role", "id": "org.user.shortcut.write" }, { "type": "role", "id": "org.user.shortlink" }, { "type": "role", "id": "org.user.shortlink.read" }, { "type": "role", "id": "org.user.shortlink.write" }, { "type": "role", "id": "org.user.sla" }, { "type": "role", "id": "org.user.sla.read" }, { "type": "role", "id": "org.user.sla.write" }, { "type": "role", "id": "org.user.snippet" }, { "type": "role", "id": "org.user.snippet.read" }, { "type": "role", "id": "org.user.snippet.write" }, { "type": "role", "id": "org.user.tag" }, { "type": "role", "id": "org.user.tag.read" }, { "type": "role", "id": "org.user.tag.write" }, { "type": "role", "id": "org.user.team" }, { "type": "role", "id": "org.user.team.read" }, { "type": "role", "id": "org.user.team.write" }, { "type": "role", "id": "org.user.template" }, { "type": "role", "id": "org.user.template.read" }, { "type": "role", "id": "org.user.template.write" }, { "type": "role", "id": "org.user.content.template" }, { "type": "role", "id": "org.user.content.template.read" }, { "type": "role", "id": "org.user.content.template.write" }, { "type": "role", "id": "org.user.business_rule" }, { "type": "role", "id": "org.user.business_rule.read" }, { "type": "role", "id": "org.user.business_rule.write" } ] } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] } }, "/role-groups": { "post": { "security": [ { "httpBearer": [] } ], "tags": [ "Role Groups" ], "summary": "Create a Role Group", "description": "Creates a custom role group for the organization.\n\n### Auth Roles\nFor a list of latest available outh roles, checkout the response from the Get Auth Roles API endpoint.", "operationId": "CreateRoleGroup", "parameters": [], "requestBody": { "description": "Create a custom role group for the organization.\n\n### Auth Roles\nFor a list of latest available outh roles, checkout the response from the Get Auth Roles API endpoint.", "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1, "maxLength": 255 }, "description": { "type": "string", "maxLength": 1024 }, "display": { "type": "boolean" }, "roles": { "type": "array", "items": { "type": "string" }, "uniqueItems": true } }, "required": [ "name" ], "additionalProperties": false } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "name": { "type": "string" }, "description": { "type": "string" }, "display": { "type": "boolean" }, "system": { "type": "boolean" }, "roles": { "type": "array", "items": { "type": "string" } }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" } }, "required": [ "name", "description", "display", "system", "roles", "createdAt", "updatedAt" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org" ] } }, "required": [ "type", "id", "attributes", "relationships" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "role_group", "id": "5afee08eb06db6d51b8cf61e", "attributes": { "name": "My Custom Administrator Role Group", "description": "Has full access to everything in Kustomer.", "display": true, "system": false, "roles": [ "org.admin", "org.user", "org.tracking", "org.hooks" ], "createdAt": "2018-06-22T13:14:57.123Z", "updatedAt": "2018-06-22T13:14:57.123Z" }, "relationships": { "org": { "links": { "self": "/v1/orgs/581392b55ac7a2110099d9c8" }, "data": { "type": "org", "id": "581392b55ac7a2110099d9c8" } } } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] }, "get": { "security": [ { "httpBearer": [] } ], "tags": [ "Role Groups" ], "summary": "Get All Role Groups", "description": "Lists the organization's role groups.\n\nThis will include both the system (uneditable) and custom role groups.", "operationId": "GetAllRoleGroups", "parameters": [], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "meta": { "type": "object", "properties": { "pageSize": { "type": "integer" }, "page": { "type": "integer" } }, "required": [ "pageSize", "page" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" }, "first": { "type": "string" }, "prev": { "type": "string", "nullable": true }, "next": { "type": "string", "nullable": true } }, "required": [ "self", "first", "prev", "next" ] }, "data": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "name": { "type": "string" }, "description": { "type": "string" }, "display": { "type": "boolean" }, "system": { "type": "boolean" }, "roles": { "type": "array", "items": { "type": "string" } }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" } }, "required": [ "name", "description", "display", "system", "roles", "createdAt", "updatedAt" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org" ] } }, "required": [ "type", "id", "attributes", "relationships" ] } } }, "required": [ "meta", "links", "data" ] }, "example": { "meta": { "pageSize": 100, "page": 1 }, "links": { "self": "/v1/role-groups?page=1&pageSize=100", "first": "/v1/role-groups?page=1&pageSize=100", "prev": null, "next": null }, "data": [ { "type": "role_group", "id": "5afee08eb06db6d51b8cf61e", "attributes": { "name": "Administrator", "description": "Has full access to everything in Kustomer.", "display": true, "system": true, "roles": [ "org.admin", "org.user", "org.tracking", "org.hooks" ], "createdAt": "2018-06-22T13:14:57.123Z", "updatedAt": "2018-06-22T13:14:57.123Z" }, "relationships": { "org": { "links": { "self": "/v1/orgs/581392b55ac7a2110099d9c8" }, "data": { "type": "org", "id": "581392b55ac7a2110099d9c8" } } } }, { "type": "role_group", "id": "5afee08eb06db6d51b8cf620", "attributes": { "name": "Manager", "description": "Can update customers, send messages, and has access to Reporting, Searches, and creating teams/users/searches.", "display": true, "system": true, "roles": [ "org.user", "org.admin.customer.merge", "org.admin.conversation.merge", "org.admin.team", "org.admin.user", "org.admin.analytics", "org.admin.search" ], "createdAt": "2018-06-22T13:14:57.123Z", "updatedAt": "2018-06-22T13:14:57.123Z" }, "relationships": { "org": { "links": { "self": "/v1/orgs/581392b55ac7a2110099d9c8" }, "data": { "type": "org", "id": "581392b55ac7a2110099d9c8" } } } } ] } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] } }, "/role-groups/{id}": { "get": { "security": [ { "httpBearer": [] } ], "tags": [ "Role Groups" ], "summary": "Get A Role Group By ID", "description": "Gets a single role group.", "operationId": "GetRoleGroupById", "parameters": [ { "name": "id", "in": "path", "description": "Role Group ID", "required": true, "style": "simple", "schema": { "type": "string", "example": "" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "name": { "type": "string" }, "description": { "type": "string" }, "display": { "type": "boolean" }, "system": { "type": "boolean" }, "roles": { "type": "array", "items": { "type": "string" } }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" } }, "required": [ "name", "description", "display", "system", "roles", "createdAt", "updatedAt" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org" ] } }, "required": [ "type", "id", "attributes", "relationships" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "role_group", "id": "5afee08eb06db6d51b8cf61e", "attributes": { "name": "Administrator", "description": "Has full access to everything in Kustomer.", "display": true, "system": true, "roles": [ "org.admin", "org.user", "org.tracking", "org.hooks" ], "createdAt": "2018-06-22T13:14:57.123Z", "updatedAt": "2018-06-22T13:14:57.123Z" }, "relationships": { "org": { "links": { "self": "/v1/orgs/581392b55ac7a2110099d9c8" }, "data": { "type": "org", "id": "581392b55ac7a2110099d9c8" } } } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] }, "put": { "security": [ { "httpBearer": [] } ], "tags": [ "Role Groups" ], "summary": "Update a Role Group", "description": "Updates a role group for the organiztion\n\n### Auth Roles\nFor a list of latest available outh roles, checkout the response from the Get Auth Roles API endpoint.", "operationId": "UpdateRoleGroup", "parameters": [ { "name": "id", "in": "path", "description": "Role Group ID", "required": true, "style": "simple", "schema": { "type": "string", "example": "" } } ], "requestBody": { "description": "Update a role group for the organiztion\n\n### Auth Roles\nFor a list of latest available outh roles, checkout the response from the Get Auth Roles API endpoint.", "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1, "maxLength": 255 }, "description": { "type": "string", "maxLength": 1024 }, "display": { "type": "boolean" }, "roles": { "type": "array", "items": { "type": "string" }, "uniqueItems": true } }, "additionalProperties": false } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "name": { "type": "string" }, "description": { "type": "string" }, "display": { "type": "boolean" }, "system": { "type": "boolean" }, "roles": { "type": "array", "items": { "type": "string" } }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" } }, "required": [ "name", "description", "display", "system", "roles", "createdAt", "updatedAt" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org" ] } }, "required": [ "type", "id", "attributes", "relationships" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "role_group", "id": "5afee08eb06db6d51b8cf61e", "attributes": { "name": "Administrator", "description": "Has full access to everything in Kustomer", "display": true, "system": false, "roles": [ "org.admin" ], "createdAt": "", "updatedAt": "" }, "relationships": { "org": { "links": { "self": "/v1/orgs/581392b55ac7a2110099d9c8" }, "data": { "type": "org", "id": "581392b55ac7a2110099d9c8" } } } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] }, "delete": { "security": [ { "httpBearer": [] } ], "tags": [ "Role Groups" ], "summary": "Delete a Role Group", "description": "Deletes a role group for the organiztion by ID", "operationId": "DeleteRoleGroup", "parameters": [ { "name": "id", "in": "path", "description": "Role Group ID", "required": true, "style": "simple", "schema": { "type": "string", "example": "" } } ], "responses": { "204": { "description": "No Content", "content": { "text/plain": { "example": "" } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] } }, "/teams": { "post": { "security": [ { "httpBearer": [] } ], "tags": [ "Teams" ], "summary": "Create Team", "description": "Creates a Team.", "operationId": "CreateTeam", "parameters": [], "requestBody": { "description": "Create a Team", "content": { "application/json": { "schema": { "type": "object", "properties": { "icon": { "type": "string", "maxLength": 64 }, "name": { "type": "string", "minLength": 1, "maxLength": 256 }, "displayName": { "type": "string", "minLength": 1, "maxLength": 256 }, "createdAt": { "type": "string", "format": "date-time" }, "importedAt": { "type": "string", "format": "date-time" }, "members": { "type": "array", "items": { "type": "string" }, "maxItems": 1000, "uniqueItems": true }, "externalId": { "type": "string", "maxLength": 256 } }, "required": [ "name" ], "additionalProperties": false } } } }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "name": { "type": "string" }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "modifiedAt": { "type": "string" }, "members": { "type": "array", "items": { "type": "string" } } }, "required": [ "name", "createdAt", "updatedAt", "modifiedAt", "members" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "createdBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "modifiedBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "createdBy", "modifiedBy" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "team", "id": "5828e52f7c7f551a00b5b731", "attributes": { "name": "Team Yo", "createdAt": "2016-11-13T22:11:59.985Z", "updatedAt": "2016-11-13T22:11:59.985Z", "modifiedAt": "2016-11-13T22:11:59.985Z", "members": [ "57bb5d2e32e83a130052e94f" ] }, "relationships": { "org": { "links": { "self": "/v1/orgs/57bb5d2e32e83a130052e94e" }, "data": { "type": "org", "id": "57bb5d2e32e83a130052e94e" } }, "createdBy": { "links": { "self": "/v1/users/57bb5d2e32e83a130052e94f" }, "data": { "type": "user", "id": "57bb5d2e32e83a130052e94f" } }, "modifiedBy": { "links": { "self": "/v1/users/57bb5d2e32e83a130052e94f" }, "data": { "type": "user", "id": "57bb5d2e32e83a130052e94f" } } }, "links": { "self": "/v1/teams/5828e52f7c7f551a00b5b731" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] }, "get": { "security": [ { "httpBearer": [] } ], "tags": [ "Teams" ], "summary": "Get Teams", "description": "Gets Teams for the Organization", "operationId": "GetTeams", "parameters": [], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "meta": { "type": "object", "properties": { "pageSize": { "type": "integer" }, "page": { "type": "integer" } }, "required": [ "pageSize", "page" ] }, "data": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "name": { "type": "string" }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "modifiedAt": { "type": "string" }, "members": { "type": "array", "items": { "type": "string" } } }, "required": [ "name", "createdAt", "updatedAt", "modifiedAt", "members" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "createdBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "modifiedBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "createdBy", "modifiedBy" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "links": { "type": "object", "properties": { "self": { "type": "string" }, "first": { "type": "string" }, "prev": { "type": "string", "nullable": true }, "next": { "type": "string", "nullable": true } }, "required": [ "self", "first", "prev", "next" ] } }, "required": [ "meta", "data", "links" ] }, "example": { "meta": { "pageSize": 100, "page": 1 }, "data": [ { "type": "team", "id": "5808da1ef39bc314009cf5ca", "attributes": { "name": "Development Team", "createdAt": "2016-10-20T14:52:14.578Z", "updatedAt": "2016-10-22T02:49:40.299Z", "modifiedAt": "2016-10-22T02:49:40.299Z", "members": [ "57bb5d2e32e83a130052e94f", "57c105aae595371400462e70" ] }, "relationships": { "org": { "links": { "self": "/v1/orgs/57bb5d2e32e83a130052e94e" }, "data": { "type": "org", "id": "57bb5d2e32e83a130052e94e" } }, "createdBy": { "links": { "self": "/v1/users/57bb5d2e32e83a130052e94f" }, "data": { "type": "user", "id": "57bb5d2e32e83a130052e94f" } }, "modifiedBy": { "links": { "self": "/v1/users/57bb5d2e32e83a130052e94f" }, "data": { "type": "user", "id": "57bb5d2e32e83a130052e94f" } } }, "links": { "self": "/v1/teams/5808da1ef39bc314009cf5ca" } }, { "type": "team", "id": "5828e52f7c7f551a00b5b731", "attributes": { "name": "Sales Team", "createdAt": "2016-11-13T22:11:59.985Z", "updatedAt": "2016-11-14T00:43:54.925Z", "modifiedAt": "2016-11-14T00:43:54.925Z", "members": [ "57bb5d2e32e83a130052e94f" ] }, "relationships": { "org": { "links": { "self": "/v1/orgs/57bb5d2e32e83a130052e94e" }, "data": { "type": "org", "id": "57bb5d2e32e83a130052e94e" } }, "createdBy": { "links": { "self": "/v1/users/57bb5d2e32e83a130052e94f" }, "data": { "type": "user", "id": "57bb5d2e32e83a130052e94f" } }, "modifiedBy": { "links": { "self": "/v1/users/57bb5d2e32e83a130052e94f" }, "data": { "type": "user", "id": "57bb5d2e32e83a130052e94f" } } }, "links": { "self": "/v1/teams/5828e52f7c7f551a00b5b731" } } ], "links": { "self": "/v1/teams?page=1&pageSize=100", "first": "/v1/teams?page=1&pageSize=100", "prev": null, "next": null } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] } }, "/users/{id}/teams": { "get": { "security": [ { "httpBearer": [] } ], "tags": [ "Teams" ], "summary": "Get a User's Teams", "description": "Gets list of all Teams for a specific user.", "operationId": "GetUsersTeams", "parameters": [ { "name": "id", "in": "path", "description": "User ID", "required": true, "style": "simple", "schema": { "type": "string", "example": "" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "meta": { "type": "object", "properties": { "pageSize": { "type": "integer" }, "page": { "type": "integer" } }, "required": [ "pageSize", "page" ] }, "data": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "name": { "type": "string" }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "modifiedAt": { "type": "string" }, "members": { "type": "array", "items": { "type": "string" } } }, "required": [ "name", "createdAt", "updatedAt", "modifiedAt", "members" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "createdBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "modifiedBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "createdBy", "modifiedBy" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "links": { "type": "object", "properties": { "self": { "type": "string" }, "first": { "type": "string" }, "prev": { "type": "string", "nullable": true }, "next": { "type": "string", "nullable": true } }, "required": [ "self", "first", "prev", "next" ] } }, "required": [ "meta", "data", "links" ] }, "example": { "meta": { "pageSize": 100, "page": 1 }, "data": [ { "type": "team", "id": "5808da1ef39bc314009cf5ca", "attributes": { "name": "Development Team", "createdAt": "2016-10-20T14:52:14.578Z", "updatedAt": "2016-10-22T02:49:40.299Z", "modifiedAt": "2016-10-22T02:49:40.299Z", "members": [ "57bb5d2e32e83a130052e94f", "57c105aae595371400462e70" ] }, "relationships": { "org": { "links": { "self": "/v1/orgs/57bb5d2e32e83a130052e94e" }, "data": { "type": "org", "id": "57bb5d2e32e83a130052e94e" } }, "createdBy": { "links": { "self": "/v1/users/57bb5d2e32e83a130052e94f" }, "data": { "type": "user", "id": "57bb5d2e32e83a130052e94f" } }, "modifiedBy": { "links": { "self": "/v1/users/57bb5d2e32e83a130052e94f" }, "data": { "type": "user", "id": "57bb5d2e32e83a130052e94f" } } }, "links": { "self": "/v1/teams/5808da1ef39bc314009cf5ca" } }, { "type": "team", "id": "5828e52f7c7f551a00b5b731", "attributes": { "name": "Sales Team", "createdAt": "2016-11-13T22:11:59.985Z", "updatedAt": "2016-11-14T00:43:54.925Z", "modifiedAt": "2016-11-14T00:43:54.925Z", "members": [ "57bb5d2e32e83a130052e94f" ] }, "relationships": { "org": { "links": { "self": "/v1/orgs/57bb5d2e32e83a130052e94e" }, "data": { "type": "org", "id": "57bb5d2e32e83a130052e94e" } }, "createdBy": { "links": { "self": "/v1/users/57bb5d2e32e83a130052e94f" }, "data": { "type": "user", "id": "57bb5d2e32e83a130052e94f" } }, "modifiedBy": { "links": { "self": "/v1/users/57bb5d2e32e83a130052e94f" }, "data": { "type": "user", "id": "57bb5d2e32e83a130052e94f" } } }, "links": { "self": "/v1/teams/5828e52f7c7f551a00b5b731" } } ], "links": { "self": "/v1/teams?page=1&pageSize=100", "first": "/v1/teams?page=1&pageSize=100", "prev": null, "next": null } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] } }, "/teams/{id}": { "get": { "security": [ { "httpBearer": [] } ], "summary": "Get Team by ID", "description": "Gets a Team by ID.\n\n> **Note** To retrieve user records of all members within a team, use the results from the members array and make a subsequent call to [Get User Multi](#endpoint:d4yQXqTBxzzhg96Gk)\n", "operationId": "GetTeamById", "parameters": [ { "name": "id", "in": "path", "description": "Team ID", "required": true, "style": "simple", "schema": { "type": "string", "example": "" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "name": { "type": "string" }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "modifiedAt": { "type": "string" }, "members": { "type": "array", "items": { "type": "string" } } }, "required": [ "name", "createdAt", "updatedAt", "modifiedAt", "members" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "createdBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "modifiedBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "createdBy", "modifiedBy" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "team", "id": "5828e52f7c7f551a00b5b731", "attributes": { "name": "Sales Team", "createdAt": "2016-11-13T22:11:59.985Z", "updatedAt": "2016-11-13T22:11:59.985Z", "modifiedAt": "2016-11-13T22:11:59.985Z", "members": [ "57bb5d2e32e83a130052e94e", "57bb5d2e32e83a130052e94f" ] }, "relationships": { "org": { "links": { "self": "/v1/orgs/57bb5d2e32e83a130052e94e" }, "data": { "type": "org", "id": "57bb5d2e32e83a130052e94e" } }, "createdBy": { "links": { "self": "/v1/users/57bb5d2e32e83a130052e94f" }, "data": { "type": "user", "id": "57bb5d2e32e83a130052e94f" } }, "modifiedBy": { "links": { "self": "/v1/users/57bb5d2e32e83a130052e94f" }, "data": { "type": "user", "id": "57bb5d2e32e83a130052e94f" } } }, "links": { "self": "/v1/teams/5828e52f7c7f551a00b5b731" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ], "tags": [ "Teams (By ID)" ] }, "put": { "security": [ { "httpBearer": [] } ], "summary": "Update Team by ID", "description": "Updates a team document by ID.", "operationId": "UpdateTeamById", "parameters": [ { "name": "id", "in": "path", "description": "Team ID", "required": true, "style": "simple", "schema": { "type": "string", "example": "" } } ], "requestBody": { "description": "", "content": { "application/json": { "schema": { "type": "object", "properties": { "icon": { "anyOf": [ { "type": "string", "maxLength": 64 } ], "nullable": true }, "name": { "type": "string", "minLength": 1, "maxLength": 256 }, "displayName": { "type": "string", "minLength": 1, "maxLength": 256 }, "members": { "type": "array", "items": { "type": "string" }, "maxItems": 1000, "uniqueItems": true }, "createdAt": { "type": "string", "format": "date-time" }, "deleted": { "type": "boolean", "nullable": true } }, "required": [ "name" ], "additionalProperties": false } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "name": { "type": "string" }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "modifiedAt": { "type": "string" }, "members": { "type": "array", "items": { "type": "string" } } }, "required": [ "name", "createdAt", "updatedAt", "modifiedAt", "members" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "createdBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "modifiedBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "createdBy", "modifiedBy" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "team", "id": "5828e52f7c7f551a00b5b731", "attributes": { "name": "Sales Team", "createdAt": "2016-11-13T22:11:59.985Z", "updatedAt": "2016-11-13T22:11:59.985Z", "modifiedAt": "2016-11-13T22:11:59.985Z", "members": [ "57bb5d2e32e83a130052e94f" ] }, "relationships": { "org": { "links": { "self": "/v1/orgs/57bb5d2e32e83a130052e94e" }, "data": { "type": "org", "id": "57bb5d2e32e83a130052e94e" } }, "createdBy": { "links": { "self": "/v1/users/57bb5d2e32e83a130052e94f" }, "data": { "type": "user", "id": "57bb5d2e32e83a130052e94f" } }, "modifiedBy": { "links": { "self": "/v1/users/57bb5d2e32e83a130052e94f" }, "data": { "type": "user", "id": "57bb5d2e32e83a130052e94f" } } }, "links": { "self": "/v1/teams/5828e52f7c7f551a00b5b731" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ], "tags": [ "Teams (By ID)" ] }, "patch": { "security": [ { "httpBearer": [] } ], "tags": [ "Teams" ], "summary": "Update Team Attributes", "description": "Updates one or more Team Attribute(s) by ID.", "operationId": "UpdateTeamAttributes", "parameters": [ { "name": "id", "in": "path", "description": "Team ID", "required": true, "style": "simple", "schema": { "type": "string", "example": "" } } ], "requestBody": { "description": "", "content": { "application/json": { "schema": { "type": "object", "properties": { "icon": { "anyOf": [ { "type": "string", "maxLength": 64 } ], "nullable": true }, "name": { "type": "string", "minLength": 1, "maxLength": 256 }, "displayName": { "type": "string", "minLength": 1, "maxLength": 256 }, "members": { "type": "array", "items": { "type": "string" }, "maxItems": 1000, "uniqueItems": true }, "createdAt": { "type": "string", "format": "date-time" }, "deleted": { "type": "boolean", "nullable": true } }, "additionalProperties": false } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "name": { "type": "string" }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "modifiedAt": { "type": "string" }, "members": { "type": "array", "items": { "type": "string" } } }, "required": [ "name", "createdAt", "updatedAt", "modifiedAt", "members" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "createdBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "modifiedBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "createdBy", "modifiedBy" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "team", "id": "5828e52f7c7f551a00b5b731", "attributes": { "name": "Sales Team", "createdAt": "2016-11-13T22:11:59.985Z", "updatedAt": "2016-11-13T22:11:59.985Z", "modifiedAt": "2016-11-13T22:11:59.985Z", "members": [ "57bb5d2e32e83a130052e94f" ] }, "relationships": { "org": { "links": { "self": "/v1/orgs/57bb5d2e32e83a130052e94e" }, "data": { "type": "org", "id": "57bb5d2e32e83a130052e94e" } }, "createdBy": { "links": { "self": "/v1/users/57bb5d2e32e83a130052e94f" }, "data": { "type": "user", "id": "57bb5d2e32e83a130052e94f" } }, "modifiedBy": { "links": { "self": "/v1/users/57bb5d2e32e83a130052e94f" }, "data": { "type": "user", "id": "57bb5d2e32e83a130052e94f" } } }, "links": { "self": "/v1/teams/5828e52f7c7f551a00b5b731" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] }, "delete": { "security": [ { "httpBearer": [] } ], "summary": "Delete Team", "description": "Deletes a Team by ID.", "operationId": "DeleteTeam", "parameters": [ { "name": "id", "in": "path", "description": "Team ID", "required": true, "style": "simple", "schema": { "type": "string", "example": "" } } ], "responses": { "204": { "description": "No Content", "content": { "text/plain": { "example": "" } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ], "tags": [ "Teams (By ID)" ] } }, "/teams/{id}/members": { "post": { "security": [ { "httpBearer": [] } ], "tags": [ "Teams" ], "summary": "Add Team Member", "operationId": "AddTeamMember", "parameters": [ { "name": "id", "in": "path", "required": true, "style": "simple", "schema": { "type": "string", "example": "" } } ], "requestBody": { "description": "", "content": { "application/json": { "schema": { "type": "object", "properties": { "members": { "type": "array", "items": { "type": "string" } } }, "required": [ "members" ], "additionalProperties": false } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "name": { "type": "string" }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "modifiedAt": { "type": "string" }, "members": { "type": "array", "items": { "type": "string" } } }, "required": [ "name", "createdAt", "updatedAt", "modifiedAt", "members" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "createdBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "modifiedBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "createdBy", "modifiedBy" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "team", "id": "5828e52f7c7f551a00b5b731", "attributes": { "name": "Sales Team", "createdAt": "2016-11-13T22:11:59.985Z", "updatedAt": "2016-11-13T22:11:59.985Z", "modifiedAt": "2016-11-13T22:11:59.985Z", "members": [ "5e45bc0461c8460012bcbda0", "5e45b8931f9af200134493ca" ] }, "relationships": { "org": { "links": { "self": "/v1/orgs/57bb5d2e32e83a130052e94e" }, "data": { "type": "org", "id": "57bb5d2e32e83a130052e94e" } }, "createdBy": { "links": { "self": "/v1/users/57bb5d2e32e83a130052e94f" }, "data": { "type": "user", "id": "57bb5d2e32e83a130052e94f" } }, "modifiedBy": { "links": { "self": "/v1/users/57bb5d2e32e83a130052e94f" }, "data": { "type": "user", "id": "57bb5d2e32e83a130052e94f" } } }, "links": { "self": "/v1/teams/5828e52f7c7f551a00b5b731" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ], "description": "Adds a member to a Team." }, "delete": { "security": [ { "httpBearer": [] } ], "tags": [ "Teams" ], "summary": "Remove Team Member", "operationId": "RemoveTeamMember", "parameters": [ { "name": "id", "in": "path", "required": true, "style": "simple", "schema": { "type": "string", "example": "" } } ], "requestBody": { "description": "", "content": { "application/json": { "schema": { "type": "object", "properties": { "members": { "type": "array", "items": { "type": "string" } } }, "required": [ "members" ], "additionalProperties": false } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "name": { "type": "string" }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "modifiedAt": { "type": "string" }, "members": { "type": "array", "items": { "type": "string" } } }, "required": [ "name", "createdAt", "updatedAt", "modifiedAt", "members" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "createdBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] }, "modifiedBy": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org", "createdBy", "modifiedBy" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "team", "id": "5828e52f7c7f551a00b5b731", "attributes": { "name": "Sales Team", "createdAt": "2016-11-13T22:11:59.985Z", "updatedAt": "2016-11-13T22:11:59.985Z", "modifiedAt": "2016-11-13T22:11:59.985Z", "members": [ "5e45b8931f9af200134493ca" ] }, "relationships": { "org": { "links": { "self": "/v1/orgs/57bb5d2e32e83a130052e94e" }, "data": { "type": "org", "id": "57bb5d2e32e83a130052e94e" } }, "createdBy": { "links": { "self": "/v1/users/57bb5d2e32e83a130052e94f" }, "data": { "type": "user", "id": "57bb5d2e32e83a130052e94f" } }, "modifiedBy": { "links": { "self": "/v1/users/57bb5d2e32e83a130052e94f" }, "data": { "type": "user", "id": "57bb5d2e32e83a130052e94f" } } }, "links": { "self": "/v1/teams/5828e52f7c7f551a00b5b731" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ], "description": "Deletes a member of a Team." } }, "/users": { "post": { "security": [ { "httpBearer": [] } ], "tags": [ "Users" ], "summary": "Create / Invite New User", "description": "Creates an account for a new user and sends an email invitation to join the organization within Kustomer.\n\n### Note\n> Requires **org.admin.user** permissions. The permissions for the new user cannot exceed those of the user making the request and will be filtered automatically. The default roles for new users are **org.admin** and **org.user**.", "operationId": "CreateInviteNewUser", "parameters": [], "requestBody": { "description": "", "content": { "application/json": { "schema": { "type": "object", "properties": { "displayName": { "type": "string", "maxLength": 256, "nullable": true }, "avatarUrl": { "type": "string", "format": "uri", "nullable": true }, "name": { "type": "string", "minLength": 1, "maxLength": 256 }, "email": { "type": "string", "format": "email", "maxLength": 256 }, "mobile": { "type": "string", "format": "phone-number-e164", "nullable": true }, "emailSignature": { "type": "string", "maxLength": 1024, "nullable": true }, "userType": { "type": "string", "enum": [ "user", "machine", "limited", "hourly" ] }, "roleGroups": { "type": "array", "items": { "type": "string", "format": "object-id" }, "maxLength": 1 }, "roles": { "type": "array", "items": { "type": "string" }, "uniqueItems": true } }, "required": [ "name", "email" ], "additionalProperties": false } } } }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "displayName": { "type": "string", "nullable": true }, "avatarUrl": { "type": "string" }, "name": { "type": "string" }, "userType": { "type": "string" }, "email": { "type": "string" }, "mobile": { "type": "string", "nullable": true }, "emailSignature": { "type": "string", "nullable": true }, "password": { "type": "object", "properties": { "allowNew": { "type": "boolean" }, "forceNew": { "type": "boolean" }, "updatedAt": { "type": "string" } }, "required": [ "allowNew", "forceNew", "updatedAt" ] }, "roles": { "type": "array", "items": { "type": "string" } }, "roleGroups": { "type": "array", "items": { "type": "string" } }, "updatedAt": { "type": "string" }, "createdAt": { "type": "string" } }, "required": [ "displayName", "avatarUrl", "name", "userType", "email", "mobile", "emailSignature", "password", "roles", "roleGroups", "updatedAt", "createdAt" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "user", "id": "582922c07c7f551a00b5b73a", "attributes": { "displayName": null, "avatarUrl": "https://media.kustomerapp.com/media/some/path.png", "name": "John Smith", "userType": "user", "email": "johnsmith@example.com", "mobile": null, "emailSignature": null, "password": { "allowNew": true, "forceNew": true, "updatedAt": "2016-11-14T02:34:40.999Z" }, "roles": [ "org.admin", "org.user" ], "roleGroups": [ "5afee08eb06db6d51b8cf61e" ], "updatedAt": "2016-11-14T02:34:40.988Z", "createdAt": "2016-11-14T02:34:40.988Z" }, "relationships": { "org": { "links": { "self": "/v1/orgs/57bb5d2e32e83a130052e94e" }, "data": { "type": "org", "id": "57bb5d2e32e83a130052e94e" } } }, "links": { "self": "/v1/users/582922c07c7f551a00b5b73a" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] }, "get": { "summary": "Get Users", "operationId": "GetUsers", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "meta": { "type": "object", "properties": { "pageSize": { "type": "integer" }, "page": { "type": "integer" } }, "required": [ "pageSize", "page" ] }, "data": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "displayName": { "type": "string", "nullable": true }, "name": { "type": "string" }, "userType": { "type": "string" }, "email": { "type": "string" }, "mobile": { "type": "string", "nullable": true }, "roles": { "type": "array", "items": { "type": "string" } }, "updatedAt": { "type": "string" }, "createdAt": { "type": "string" } }, "required": [ "displayName", "name", "userType", "email", "mobile", "roles", "updatedAt", "createdAt" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "links": { "type": "object", "properties": { "self": { "type": "string" }, "first": { "type": "string" }, "prev": { "type": "string", "nullable": true }, "next": { "type": "string", "nullable": true } }, "required": [ "self", "first", "prev", "next" ] } }, "required": [ "meta", "data", "links" ] } } } } }, "description": "Retrieves users within the organization.\n\n## Filtering\n\nThis endpoint supports optional filtering in one of the following ways:\n\n**Note: These filters cannot be combined.**\n\n### Pending (invitation)\nAdd ```pending=(true|false)``` in the query parameters with one of the following options:\n\n- `true` - Return only disabled users\n- `false` - Return only active users\n\n### Deleted (deactivated)\nAdd ```deleted=(true|false)``` in the query parameters with one of the following options:\n\n- `true` - Return only deactivated users\n- `false` - Return only active users\n\n### User Type\nAdd ```userType=[userType]``` in the query parameters with one of the following options:\n\n- `user` - Full user\n- `machine` - Machine user / API user\n- `limited` - Collaborator user\n\n### Email\nAdd ```email=[email]``` in the query parameter to filter for a specific user email address.", "parameters": [ { "schema": { "type": "boolean", "example": true }, "in": "query", "name": "pending", "description": "Invitation status of user. `true` returns only users with a pending invitation. `false` returns only active users." }, { "schema": { "type": "boolean", "example": false }, "in": "query", "name": "deleted", "description": "Activation status of user. `true` returns only deactivated users. `false` returns only active users." }, { "schema": { "type": "string", "enum": [ "user", "machine", "limited" ], "example": "user" }, "in": "query", "name": "userType", "description": "User type. Options: `user` for full users, `machine` for a machine user or API user, and `limited` for collaborator user." }, { "schema": { "type": "string", "format": "email", "example": "franz.kafka@kustomer.com" }, "in": "query", "name": "email", "description": "User email address. " } ], "tags": [ "Users" ], "security": [ { "httpBearer": [] } ] } }, "/users/current": { "get": { "security": [ { "httpBearer": [] } ], "tags": [ "Users" ], "summary": "Get Current User", "description": "Retrieves the current user.", "operationId": "GetCurrentUser", "parameters": [], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "displayName": { "type": "string", "nullable": true }, "avatarUrl": { "type": "string" }, "name": { "type": "string" }, "userType": { "type": "string" }, "email": { "type": "string" }, "emailVerifiedAt": { "type": "string" }, "mobile": { "type": "string", "nullable": true }, "password": { "type": "object", "properties": { "allowNew": { "type": "boolean" }, "forceNew": { "type": "boolean" }, "updatedAt": { "type": "string" } }, "required": [ "allowNew", "forceNew", "updatedAt" ] }, "roles": { "type": "array", "items": { "type": "string" } }, "updatedAt": { "type": "string" }, "createdAt": { "type": "string" } }, "required": [ "displayName", "avatarUrl", "name", "userType", "email", "emailVerifiedAt", "mobile", "password", "roles", "updatedAt", "createdAt" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "user", "id": "57bb5d2e32e83a130052e94f", "attributes": { "displayName": null, "avatarUrl": "https://media.kustomerapp.com/media/some/path.png", "name": "Jeremy Suriel", "userType": "user", "email": "jeremy@kustomer.com", "emailVerifiedAt": "2016-10-02T03:56:28.248Z", "mobile": null, "password": { "allowNew": false, "forceNew": false, "updatedAt": "2016-10-02T03:56:38.765Z" }, "roles": [ "org", "system" ], "updatedAt": "2016-10-02T03:56:38.762Z", "createdAt": "2016-08-22T20:14:38.450Z" }, "relationships": { "org": { "links": { "self": "/v1/orgs/57bb5d2e32e83a130052e94e" }, "data": { "type": "org", "id": "57bb5d2e32e83a130052e94e" } } }, "links": { "self": "/v1/users/current" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] }, "put": { "security": [ { "httpBearer": [] } ], "tags": [ "Users" ], "summary": "Update Current User", "description": "Updates the current user.", "operationId": "UpdateCurrentUser", "parameters": [], "requestBody": { "description": "", "content": { "application/json": { "schema": { "type": "object", "properties": { "displayName": { "type": "string", "maxLength": 256, "nullable": true }, "avatarUrl": { "type": "string", "format": "uri", "nullable": true }, "name": { "type": "string", "minLength": 1, "maxLength": 256 }, "email": { "type": "string", "format": "email", "maxLength": 256 }, "mobile": { "type": "string", "format": "phone-number-e164", "nullable": true }, "emailSignature": { "type": "string", "maxLength": 1024, "nullable": true }, "deleted": { "type": "boolean", "nullable": true }, "password": { "type": "string", "minLength": 8, "maxLength": 256 }, "currentPassword": { "type": "string", "minLength": 3, "maxLength": 256 }, "userType": { "type": "string", "enum": [ "user", "limited", "hourly" ] }, "roleGroups": { "type": "array", "items": { "type": "string", "format": "object-id" }, "maxItems": 1 }, "roles": { "type": "array", "items": { "type": "string" }, "uniqueItems": true } }, "additionalProperties": false } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "displayName": { "type": "string", "nullable": true }, "name": { "type": "string" }, "userType": { "type": "string" }, "email": { "type": "string" }, "mobile": { "type": "string", "nullable": true }, "emailSignature": { "type": "string", "nullable": true }, "password": { "type": "object", "properties": { "allowNew": { "type": "boolean" }, "forceNew": { "type": "boolean" }, "updatedAt": { "type": "string" } }, "required": [ "allowNew", "forceNew", "updatedAt" ] }, "roles": { "type": "array", "items": { "type": "string" } }, "roleGroups": { "type": "string" }, "updatedAt": { "type": "string" }, "createdAt": { "type": "string" } }, "required": [ "displayName", "name", "userType", "email", "mobile", "emailSignature", "password", "roles", "roleGroups", "updatedAt", "createdAt" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "user", "id": "582922c07c7f551a00b5b73a", "attributes": { "displayName": null, "name": "John Smith II", "userType": "user", "email": "johnsmith@example.com", "mobile": null, "emailSignature": null, "password": { "allowNew": true, "forceNew": true, "updatedAt": "2016-11-14T02:34:40.999Z" }, "roles": [ "org.admin", "org.user" ], "roleGroups": "5afee08eb06db6d51b8cf61e", "updatedAt": "2016-11-14T02:34:40.988Z", "createdAt": "2016-11-14T02:34:40.988Z" }, "relationships": { "org": { "links": { "self": "/v1/orgs/57bb5d2e32e83a130052e94e" }, "data": { "type": "org", "id": "57bb5d2e32e83a130052e94e" } } }, "links": { "self": "/v1/users/current" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] } }, "/users/{id}": { "get": { "security": [ { "httpBearer": [] } ], "summary": "Get User by ID", "description": "Retrieves a user using their unique ID.", "operationId": "GetUserById", "parameters": [ { "name": "id", "in": "path", "description": "Unique ID of the User", "required": true, "style": "simple", "schema": { "type": "string", "example": "" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "displayName": { "type": "string", "nullable": true }, "name": { "type": "string" }, "userType": { "type": "string" }, "email": { "type": "string" }, "mobile": { "type": "string", "nullable": true }, "roles": { "type": "array", "items": { "type": "string" } }, "updatedAt": { "type": "string" }, "createdAt": { "type": "string" } }, "required": [ "displayName", "name", "userType", "email", "mobile", "roles", "updatedAt", "createdAt" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "user", "id": "582922c07c7f551a00b5b73a", "attributes": { "displayName": null, "name": "John Smith II", "userType": "user", "email": "johnsmith@example.com", "mobile": null, "roles": [ "org.admin", "org.user" ], "updatedAt": "2016-11-14T02:59:21.191Z", "createdAt": "2016-11-14T02:34:40.988Z" }, "relationships": { "org": { "links": { "self": "/v1/orgs/57bb5d2e32e83a130052e94e" }, "data": { "type": "org", "id": "57bb5d2e32e83a130052e94e" } } }, "links": { "self": "/v1/users/582922c07c7f551a00b5b73a" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ], "tags": [ "Users (By ID)" ] }, "put": { "security": [ { "httpBearer": [] } ], "summary": "Update User by ID", "description": "Updates a specific user by ID.\n\n#### Note\n*To delete a user, set deleted to true. You can un-delete by setting the deleted to null*", "operationId": "UpdateUserById", "parameters": [ { "name": "id", "in": "path", "description": "Unique ID of the authorized user.", "required": true, "style": "simple", "schema": { "type": "string", "example": "" } } ], "requestBody": { "description": "Update a specific user.\n\n#### Note\n*To delete a user, set deleted to true. You can un-delete by setting the deleted to null*", "content": { "application/json": { "schema": { "type": "object", "properties": { "displayName": { "type": "string", "maxLength": 256, "nullable": true }, "avatarUrl": { "type": "string", "format": "uri", "nullable": true }, "name": { "type": "string", "minLength": 1, "maxLength": 256 }, "email": { "type": "string", "format": "email", "maxLength": 256 }, "mobile": { "type": "string", "format": "phone-number-e164", "nullable": true }, "emailSignature": { "type": "string", "maxLength": 1024, "nullable": true }, "deleted": { "type": "boolean", "nullable": true }, "password": { "type": "string", "minLength": 8, "maxLength": 256 }, "currentPassword": { "type": "string", "minLength": 3, "maxLength": 256 }, "userType": { "type": "string", "enum": [ "user", "limited", "hourly" ] }, "roleGroups": { "type": "array", "items": { "type": "string", "format": "object-id" }, "maxItems": 1 }, "roles": { "type": "array", "items": { "type": "string" }, "uniqueItems": true } }, "additionalProperties": false } } } }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "displayName": { "type": "string", "nullable": true }, "name": { "type": "string" }, "userType": { "type": "string" }, "email": { "type": "string" }, "mobile": { "type": "string", "nullable": true }, "emailSignature": { "type": "string", "nullable": true }, "password": { "type": "object", "properties": { "allowNew": { "type": "boolean" }, "forceNew": { "type": "boolean" }, "updatedAt": { "type": "string" } }, "required": [ "allowNew", "forceNew", "updatedAt" ] }, "roles": { "type": "array", "items": { "type": "string" } }, "roleGroups": { "type": "array", "items": { "type": "string" } }, "updatedAt": { "type": "string" }, "createdAt": { "type": "string" } }, "required": [ "displayName", "name", "userType", "email", "mobile", "emailSignature", "password", "roles", "roleGroups", "updatedAt", "createdAt" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "required": [ "data" ] }, "example": { "data": { "type": "user", "id": "582922c07c7f551a00b5b73a", "attributes": { "displayName": null, "name": "John Smith II", "userType": "user", "email": "johnsmith@example.com", "mobile": null, "emailSignature": null, "password": { "allowNew": true, "forceNew": true, "updatedAt": "2016-11-14T02:34:40.999Z" }, "roles": [ "org.admin", "org.user" ], "roleGroups": [ "5afee08eb06db6d51b8cf61e" ], "updatedAt": "2016-11-14T02:34:40.988Z", "createdAt": "2016-11-14T02:34:40.988Z" }, "relationships": { "org": { "links": { "self": "/v1/orgs/57bb5d2e32e83a130052e94e" }, "data": { "type": "org", "id": "57bb5d2e32e83a130052e94e" } } }, "links": { "self": "/v1/users/582922c07c7f551a00b5b73a" } } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ], "tags": [ "Users (By ID)" ] } }, "/users/{ids}": { "get": { "security": [ { "httpBearer": [] } ], "summary": "Get Multiple Users by IDs", "description": "Retrieves multiple users in a single request using a list of unique user IDs separated by a comma.", "operationId": "GetMultipleUsersByIds", "parameters": [ { "name": "ids", "in": "path", "description": "IDs of users separated by a comma.", "required": true, "style": "simple", "schema": { "type": "string", "example": "" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "meta": { "type": "object", "properties": { "pageSize": { "type": "integer" }, "page": { "type": "integer" } }, "required": [ "pageSize", "page" ] }, "data": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "type": "object", "properties": { "displayName": { "type": "string", "nullable": true }, "name": { "type": "string" }, "userType": { "type": "string" }, "email": { "type": "string" }, "mobile": { "type": "string", "nullable": true }, "roles": { "type": "array", "items": { "type": "string" } }, "updatedAt": { "type": "string" }, "createdAt": { "type": "string" } }, "required": [ "displayName", "name", "userType", "email", "mobile", "roles", "updatedAt", "createdAt" ] }, "relationships": { "type": "object", "properties": { "org": { "type": "object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] }, "data": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" } }, "required": [ "type", "id" ] } }, "required": [ "links", "data" ] } }, "required": [ "org" ] }, "links": { "type": "object", "properties": { "self": { "type": "string" } }, "required": [ "self" ] } }, "required": [ "type", "id", "attributes", "relationships", "links" ] } }, "links": { "type": "object", "properties": { "self": { "type": "string" }, "first": { "type": "string" }, "prev": { "type": "string", "nullable": true }, "next": { "type": "string", "nullable": true } }, "required": [ "self", "first", "prev", "next" ] } }, "required": [ "meta", "data", "links" ] }, "example": { "meta": { "pageSize": 100, "page": 1 }, "data": [ { "type": "user", "id": "582922c07c7f551a00b5b73a", "attributes": { "displayName": null, "name": "John Smith II", "userType": "user", "email": "johnsmith@example.com", "mobile": null, "roles": [ "org.admin", "org.user" ], "updatedAt": "2016-11-14T02:59:21.191Z", "createdAt": "2016-11-14T02:34:40.988Z" }, "relationships": { "org": { "links": { "self": "/v1/orgs/57bb5d2e32e83a130052e94e" }, "data": { "type": "org", "id": "57bb5d2e32e83a130052e94e" } } }, "links": { "self": "/v1/users/582922c07c7f551a00b5b73a" } }, { "type": "user", "id": "582922c07c7f551a00b5b73b", "attributes": { "displayName": null, "name": "John Smith III", "userType": "user", "email": "johnsmith3@example.com", "mobile": null, "roles": [ "org.admin", "org.user" ], "updatedAt": "2016-11-14T02:59:21.191Z", "createdAt": "2016-11-14T02:34:40.988Z" }, "relationships": { "org": { "links": { "self": "/v1/orgs/57bb5d2e32e83a130052e94e" }, "data": { "type": "org", "id": "57bb5d2e32e83a130052e94e" } } }, "links": { "self": "/v1/users/582922c07c7f551a00b5b73b" } } ], "links": { "self": "/v1/users/582922c07c7f551a00b5b73a,582922c07c7f551a00b5b73b?page=1&pageSize=100", "first": "/v1/users/582922c07c7f551a00b5b73a,582922c07c7f551a00b5b73b?page=1&pageSize=100", "prev": null, "next": null } } } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ], "tags": [ "Users (By ID)" ] } }, "/users/passwordreset": { "post": { "tags": [ "Users" ], "summary": "Reset User's Password", "description": "Requests a password reset.\n\nThis will send an email to the email address specified with a token-based URL for authenticating and setting a new password.", "operationId": "ResetUsersPassword", "parameters": [], "requestBody": { "description": "", "content": { "application/json": { "schema": { "type": "object", "properties": { "domain": { "type": "string", "pattern": "^[a-zA-Z0-9]{1}[a-zA-Z0-9-_]+$", "minLength": 3, "maxLength": 256 }, "email": { "type": "string", "format": "email", "maxLength": 256 } }, "required": [ "domain", "email" ], "additionalProperties": false } } } }, "responses": { "204": { "description": "No Content", "content": { "text/plain": { "example": "" } } } }, "deprecated": false, "servers": [ { "url": "https://api.kustomerapp.com/v1", "variables": {} } ] } } } }