{
	"swagger": "2.0",
	"info": {
		"version": "1.2.1",
		"title": "Adversus API v1 docs",
		"description": "Welcome to the Adversus API documentation. The Adversus API is organized around REST principles. JSON is returned by all API responses including errors. We are continually expanding with more endpoints, feel free to ask for a specific need. If you have any questions or feedback please don't hesitate to ask us at hello@adversus.io.\n\n&nbsp;\n# Pagination\nAll top-level API resources have support for bulk fetches via \"list\" API methods. For instance you can list leads and list sessions. These list API methods share a common structure, taking these parameters: `page` and `pageSize`.\n\n| page | pageSize |\n| ------- | --------|\n| Page number   | A limit on the number of objects to be returned, between 1 and 100. Default is 1000.   |\n\n## Pagination header\nPagination meta data can be found in the meta key in the response, by setting the parameter `includeMeta: true`. It will look something like:\n\n\n```\n{\n\"meta\": {\n  \"pagination\": {\n  \"page\": 3,\n  \"pageCount\": 8,\n  \"pageSize\": 1000,\n  \"total\": 7764,\n  \"firstUrl\": \"(...)/sessions?pageSize=1000\",\n  \"previousUrl\": \"(...)/sessions?page=2&pageSize=1000\",\n  \"nextUrl\": \"(...)/sessions?page=4&pageSize=1000\",\n  \"lastUrl\": \"(...)/sessions?page=8&pageSize=1000\"\n}\n},\n\"sessions\": [ ... ]\n}\n```\n\n&nbsp;\n# Filters\nRow filters enable parametric searches. Row filters enable you to selectively filter read API requests to only data which fits constraints defined in your filters query parameter, similar to the where clause of a SQL query. Factual row filters are implemented as JSON.\n\n## Comparison operators\n| Operator | Description | Supported Datatype(s) | Example |\n| ------- | -------- | ------- | --------|\n| **$eq**   | equal to   | text, numeric, datetime, boolean  | `filters={\"name\":{\"$eq\":\"Campaign A\"}}` |  \n| **$gt**   | greater than | numeric, datetime  | `filters={\"startTime\":{\"$gt\":\"2016-06-22T09:35:49Z\"}}` | \n| **$lt**   | less than | numeric, datetime | `filters={\"leadId\":{\"$lt\":204010037}}` | \n| **$c**   | contains | text, numeric | ` filters={\"name\":{\"$c\":\"A\"}}` | \n| **$nc**   | not contains | text, numeric | `filters={\"name\":{\"$nc\":\"A\"}}` | \n| **$neq**   | not equal to | text, numeric, datetime, boolean | `filters={\"name\":{\"$neq\":\"Campaign A\"}}` | \n\nIt is possible to use multiple filters, eg. `{\"contactAttempts\":{\"$neq\":0},\"lastContactTime\":{\"$gt\":\"2016-06- 22T12:35:29Z\"}}`. \n\nFurthermore it is possible to use multiple filters on the same field, eg. `{\"startTime\":{\"$gt\":\"2016-11- 29T14:51:37Z\",\"$lt\":\"2016-11-30T14:51:37Z\"}}`\n\n&nbsp;\n# Sort\nWhen  listing most resources, you can sort the results using the `sortProperty` and `sortDirection` URL params. Each resource only allows sorting by specific properties. Those properties are noted in each resource's documentation. The `sortDirection` must be either `ASC` (default) or `DESC`.\n\n&nbsp;\n# DateTime format\nDateTime uses format \"string\". DateTime objects are encoded as [ISO 8601 combined date and time representations](https://en.wikipedia.org/wiki/ISO_8601#Combined_date_and_time_representations), eg. `2016-06-26T11:21:32Z`.\n\n# Rate limits\nThe Adversus API rate limits are 1000 requests pr. hour, with a burst rate limit of 60 requests pr. minute, and a maximum of 2 concurrent requests. If the rate limit is exceeded the API will respond with a 429 status code."
	},
	"host": "api.adversus.io",
	"schemes": [
		"https"
	],
	"securityDefinitions": {
		"basicAuth": {
			"type": "basic",
			"description": "HTTP Basic Authentication"
		}
	},
	"basePath": "/v1",
	"produces": [
		"application/json"
	],
	"paths": {
		"/organization": {
			"get": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "Information about the organization for the connected user",
				"description": "Returns an unique identifier, and the name for the organization which the API user belongs to.\n",
				"tags": [
					"organization"
				],
				"responses": {
					"200": {
						"description": "Information about the organization",
						"schema": {
							"$ref": "#/definitions/organization"
						}
					},
					"401": {
						"description": "Unauthorized",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"500": {
						"description": "Unexpected error",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			}
		},
		"/imports": {
			"post": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "Create import",
				"description": "An import is used for bulk import of contacts, and has additional features for handling duplicate checking, and can also be used for updating existing leads. After creating the import, contacts can be added in a streaming fashion using the `import/{id}/insert` endpoint. The import is finally initiated by calling `import/{id}/start`, at which point the import is queud for processing.\nThe `$.match.fields` can be used to specify which fields are used for duplicate checking (e.g. a field that specifies an unique id), and the `$.match.blacklist` specifies which pools contacts should be checked against for duplicates.\nIf existing contacts have fields that should be updated based on the data from the import these can be specified in `$.updateFields`.\nThe only field which is required for creating an import is the `$.poolId`",
				"parameters": [
					{
						"name": "body",
						"in": "body",
						"description": "Create import request body. only poolId is required",
						"required": true,
						"schema": {
							"$ref": "#/definitions/import"
						}
					}
				],
				"tags": [
					"imports"
				],
				"responses": {
					"200": {
						"description": "returns new import request",
						"schema": {
							"type": "object",
							"example": {
								"id": 3,
								"state": "init",
								"match": {
									"fields": [
										12,
										22
									],
									"blacklist": [
										123,
										121
									]
								},
								"updateFields": [
									55,
									34
								],
								"onImportedAction": {
									"type": "addToCampaign",
									"campaignId": 1337
								},
								"poolId": 21,
								"callbackUrl": "https://your-custom-callback-url.dev",
								"contacts": 0
							}
						}
					},
					"401": {
						"description": "Unauthorized",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"500": {
						"description": "Unexpected error",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			}
		},
		"/imports/{id}": {
			"get": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "Get state of import request",
				"description": "Get the current import state",
				"parameters": [
					{
						"name": "id",
						"in": "path",
						"description": "unique identifier for insert group",
						"required": true,
						"type": "number"
					}
				],
				"tags": [
					"imports"
				],
				"responses": {
					"200": {
						"description": "Returns the import request",
						"schema": {
							"type": "object",
							"example": {
								"id": 3,
								"state": "running",
								"match": {
									"fields": [
										12,
										22
									],
									"blacklist": [
										123,
										121
									]
								},
								"updateFields": [
									55,
									34
								],
								"onImportedAction": {
									"type": "none"
								},
								"poolId": 21,
								"callbackUrl": "https://your-custom-callback-url.dev",
								"contacts": 127
							}
						}
					},
					"401": {
						"description": "Unauthorized",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"500": {
						"description": "Unexpected error",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			}
		},
		"/imports{id}/insert": {
			"post": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "Insert into import request",
				"description": "Inserts contacts by submitting an array of objects where each object has a data property with a key value representation of the contacts data.",
				"parameters": [
					{
						"name": "id",
						"in": "path",
						"description": "unique identifier for insert group",
						"required": true,
						"type": "number"
					},
					{
						"name": "body",
						"in": "body",
						"description": "Array of key value objects, with one object per contact",
						"required": true,
						"schema": {
							"type": "object",
							"example": [
								{
									"data": {
										"13266": "Alice",
										"13267": "12345678"
									}
								},
								{
									"data": {
										"13266": "Bob",
										"13267": "23456789"
									}
								}
							]
						}
					}
				],
				"tags": [
					"imports"
				],
				"responses": {
					"200": {
						"description": "Returns object specifiying how many contacts were added to the import and the running total",
						"schema": {
							"type": "object",
							"example": {
								"inserted": 2,
								"total": 2
							}
						}
					},
					"401": {
						"description": "Unauthorized",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"500": {
						"description": "Unexpected error",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			}
		},
		"/imports{id}/start": {
			"post": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "Execute import request",
				"description": "Queues the import request. If a callback url has been specified the system will call this url once the import has been fully processed.",
				"parameters": [
					{
						"name": "id",
						"in": "path",
						"description": "unique identifier for insert group",
						"required": true,
						"type": "number"
					}
				],
				"tags": [
					"imports"
				],
				"responses": {
					"200": {
						"description": "returns the import request",
						"schema": {
							"type": "object",
							"example": {
								"id": 3,
								"state": "init",
								"match": {
									"fields": [
										12,
										123,
										4,
										23
									],
									"blacklist": [
										123,
										121
									]
								},
								"updateFields": [
									55,
									34
								],
								"poolId": 21,
								"callbackUrl": "/bankgroups",
								"contacts": 0
							}
						}
					},
					"401": {
						"description": "Unauthorized",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"500": {
						"description": "Unexpected error",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			}
		},
		"/campaigns": {
			"get": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "Campaign list",
				"description": "The campaign endpoint returns information about the campaigns related to the authenticated user. The response includes the display name\nand other details about each campaigns.\n",
				"parameters": [
					{
						"name": "fieldMappingId",
						"in": "query",
						"description": "An ID of external field mapping to use when returning fields IDs",
						"required": false,
						"type": "integer"
					},
					{
						"name": "filters",
						"in": "query",
						"description": "Json encoded filter description. Valid filter properties include 'name','projectId','updated'",
						"required": false,
						"type": "string"
					},
					{
						"name": "includeMeta",
						"in": "query",
						"description": "Boolean telling if the query needs to return extended info, like pagination.",
						"required": false,
						"type": "string"
					},
					{
						"name": "sortProperty",
						"in": "query",
						"description": "Name of the column the generated query will be sorted by",
						"required": false,
						"type": "string",
						"enum": [
							"name",
							"project_id",
							"updated"
						]
					},
					{
						"name": "sortDirection",
						"in": "query",
						"description": "The direction we want to sort for the 'sortProperty'.",
						"required": false,
						"type": "string",
						"enum": [
							"ASC",
							"DESC"
						]
					},
					{
						"name": "pageSize",
						"in": "query",
						"description": "How many rows should be returned for each page.",
						"required": false,
						"type": "integer"
					},
					{
						"name": "page",
						"in": "query",
						"description": "What page is currently being viewed. If 'pageSize' have been defined and not 'page', 1 will be assumed.",
						"required": false,
						"type": "integer"
					}
				],
				"tags": [
					"campaigns"
				],
				"responses": {
					"200": {
						"description": "An array of campaigns. If importMeta=true then an object of meta and campaigns will be returned",
						"schema": {
							"type": "array",
							"items": {
								"$ref": "#/definitions/campaigns"
							}
						}
					},
					"401": {
						"description": "Unauthorized",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"500": {
						"description": "Unexpected error",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			}
		},
		"/campaigns/{id}": {
			"get": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "Specific campaign",
				"description": "Returns information about a specific campaign.\n",
				"parameters": [
					{
						"name": "id",
						"in": "path",
						"description": "Unique identifier for campaign.",
						"required": true,
						"type": "string"
					},
					{
						"name": "fieldMappingId",
						"in": "query",
						"description": "An ID of external field mapping to use when returning fields IDs",
						"required": false,
						"type": "integer"
					}
				],
				"tags": [
					"campaigns"
				],
				"responses": {
					"200": {
						"description": "An array of campaigns",
						"schema": {
							"type": "array",
							"items": {
								"$ref": "#/definitions/campaigns"
							}
						}
					},
					"400": {
						"description": "Bad input",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"401": {
						"description": "Unauthorized",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"403": {
						"description": "Forbidden",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"404": {
						"description": "Resource not found",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"500": {
						"description": "Unexpected error",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			}
		},
		"/campaigns/{id}/addContact": {
			"post": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "Add a contact to a specific campaign",
				"description": "Adds a contact to a specific campaign (making it a campaign-lead), specifying a lead status indicating the contacts campaign state (e.g. not previously dialed)\n",
				"parameters": [
					{
						"name": "id",
						"in": "path",
						"description": "Unique identifier for campaign.",
						"required": true,
						"type": "string"
					},
					{
						"name": "body",
						"in": "body",
						"description": "Contact id and initial campaign status",
						"required": true,
						"schema": {
							"$ref": "#/definitions/campaign-add-contact"
						}
					}
				],
				"tags": [
					"campaigns",
					"contacts"
				],
				"responses": {
					"201": {
						"description": "The contact has been added to the campaign",
						"headers": {
							"Location": {
								"description": "Resource url for the created lead",
								"type": "string"
							}
						}
					},
					"400": {
						"description": "Returned if the lead has already been added to the campaign, or the request is otherwise not well-formed",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"404": {
						"description": "Indicates that either the campaign or the contact could not be found",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"500": {
						"description": "Unexpected error",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			}
		},
		"/campaigns/{id}/addContacts": {
			"post": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "Add multiple contacts to a specific campaign",
				"description": "Adds the contacts to a specific campaign - similar to campaigns/{id}/addContact, but takes an array of contacts\n",
				"parameters": [
					{
						"name": "id",
						"in": "path",
						"description": "Unique identifier for campaign.",
						"required": true,
						"type": "string"
					},
					{
						"name": "body",
						"in": "body",
						"description": "Contact id and initial campaign status",
						"required": true,
						"schema": {
							"$ref": "#/definitions/campaign-add-contacts"
						}
					}
				],
				"tags": [
					"campaigns",
					"contacts"
				],
				"responses": {
					"201": {
						"description": "The contact has been added to the campaign",
						"headers": {
							"Location": {
								"description": "Resource url for the created lead",
								"type": "string"
							}
						}
					},
					"400": {
						"description": "Returned if the lead has already been added to the campaign, or the request is otherwise not well-formed",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"404": {
						"description": "Indicates that either the campaign or the contact could not be found",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"500": {
						"description": "Unexpected error",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			}
		},
		"/campaigns/{id}/efficiency": {
			"get": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "Check efficiency for a campaign",
				"description": "Return efficiency on a campaign to see what time is being used for.\n",
				"parameters": [
					{
						"name": "id",
						"in": "path",
						"description": "Unique identifier for campaign.",
						"required": true,
						"type": "string"
					},
					{
						"name": "filters",
						"in": "query",
						"description": "Json encoded filter description",
						"required": false,
						"type": "string"
					},
					{
						"name": "includeMeta",
						"in": "query",
						"description": "Boolean telling if the query needs to return extended info, like pagination.",
						"required": false,
						"type": "string"
					},
					{
						"name": "sortProperty",
						"in": "query",
						"description": "Name of the column the generated query will be sorted by",
						"required": false,
						"type": "string",
						"enum": [
							"start",
							"end"
						]
					},
					{
						"name": "sortDirection",
						"in": "query",
						"description": "The direction we want to sort for the 'sortProperty'.",
						"required": false,
						"type": "string",
						"enum": [
							"ASC",
							"DESC"
						]
					},
					{
						"name": "pageSize",
						"in": "query",
						"description": "How many rows should be returned for each page.",
						"required": false,
						"type": "integer"
					},
					{
						"name": "page",
						"in": "query",
						"description": "What page is currently being viewed. If 'pageSize' have been defined and not 'page', 1 will be assumed.",
						"required": false,
						"type": "integer"
					}
				],
				"tags": [
					"campaigns",
					"efficiency"
				],
				"responses": {
					"200": {
						"description": "A list of active users and related efficiency data",
						"schema": {
							"type": "array",
							"items": {
								"$ref": "#/definitions/efficiency"
							}
						}
					},
					"204": {
						"description": "There is no data for the requested resource",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"400": {
						"description": "Bad input",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"403": {
						"description": "User does not have the necessary permissions for the requested campaign",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"500": {
						"description": "Unexpected error",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			}
		},
		"/campaign-fields": {
			"get": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "Get all campaign fields",
				"description": "Returns list of campaign fields \n",
				"parameters": [],
				"tags": [
					"campaign-fields"
				],
				"responses": {
					"200": {
						"description": "The list of campaign-fields",
						"schema": {
							"type": "object",
							"example": [
								{
									"id": 3,
									"name": "my first campaign field!",
									"type": "string"
								},
								{
									"id": 3,
									"name": "ohh wait theres 2 of them",
									"type": "number"
								}
							]
						}
					},
					"400": {
						"description": "the request is not well-formed",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"404": {
						"description": "Indicates that the campaign could not be found",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"500": {
						"description": "Unexpected error",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			},
			"post": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "Create a campaign field",
				"description": "Creates a new campaign field, returns array of campaign fields \n",
				"parameters": [
					{
						"name": "body",
						"in": "body",
						"description": "Campaign field specification",
						"required": true,
						"schema": {
							"$ref": "#/definitions/campaign-field-post"
						}
					}
				],
				"tags": [
					"campaign-fields"
				],
				"responses": {
					"202": {
						"description": "The field has been created",
						"schema": {
							"type": "object",
							"example": [
								{
									"id": 3,
									"name": "my first campaign field!",
									"value": "its something!",
									"type": "string"
								}
							]
						}
					},
					"400": {
						"description": "the request is not well-formed",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"500": {
						"description": "Unexpected error",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			}
		},
		"/campaign-fields/{id}": {
			"get": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "Get a specific campaign field",
				"description": "Returns information about a specific campaign field \n",
				"parameters": [
					{
						"name": "id",
						"in": "path",
						"description": "Unique identifier for campaign field.",
						"required": true,
						"type": "integer"
					}
				],
				"tags": [
					"campaign-fields"
				],
				"responses": {
					"200": {
						"description": "Campaign field found",
						"schema": {
							"type": "object",
							"example": {
								"id": 3,
								"name": "my first campaign field!",
								"type": "string"
							}
						}
					},
					"400": {
						"description": "the request is not well-formed",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"404": {
						"description": "Indicates that either the campaign or the campaign field could not be found",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"500": {
						"description": "Unexpected error",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			},
			"put": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "Update a campaign field",
				"description": "Updates a campaign field \n",
				"parameters": [
					{
						"name": "id",
						"in": "path",
						"description": "Unique identifier for campaign field.",
						"required": true,
						"type": "integer"
					},
					{
						"name": "body",
						"in": "body",
						"description": "Campaign field specification.",
						"required": true,
						"schema": {
							"$ref": "#/definitions/campaign-field"
						}
					}
				],
				"tags": [
					"campaign-fields"
				],
				"responses": {
					"200": {
						"description": "The field was updated",
						"schema": {
							"type": "object",
							"example": {
								"id": 3,
								"name": "my first campaign field!",
								"type": "string"
							}
						}
					},
					"400": {
						"description": "the request is not well-formed",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"404": {
						"description": "Indicates that either the campaign or the campaign field could not be found",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"500": {
						"description": "Unexpected error",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			}
		},
		"/campaigns/{id}/data": {
			"patch": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "Insert, update, delete campaign field data",
				"description": "Updates data values in specified field ids. The key representing campagin field Id, and value representing the new value for the field  \n",
				"parameters": [
					{
						"name": "id",
						"in": "path",
						"description": "Unique identifier for campaign.",
						"required": true,
						"type": "integer"
					},
					{
						"name": "body",
						"in": "body",
						"description": "Key-value map containing the fields that should be added, updated or deleted. Leaving the value empty or null will delete the data",
						"required": true,
						"schema": {
							"type": "object",
							"example": {
								"4": "this is my new value",
								"6": "",
								"12": "this is my updated value"
							}
						}
					}
				],
				"tags": [
					"campaign-fields"
				],
				"responses": {
					"200": {
						"description": "The campaign field data was updated. All active campaign fields are returned, fields without a value for the campaign have a value of null",
						"schema": {
							"type": "object",
							"example": [
								{
									"id": 4,
									"name": "my first campaign field",
									"value": "this is my new value",
									"type": "string"
								},
								{
									"id": 6,
									"name": "my second campaign field",
									"value": null,
									"type": "string"
								},
								{
									"id": 12,
									"name": "my third campaign field",
									"value": "this is my updated value",
									"type": "string"
								}
							]
						}
					},
					"400": {
						"description": "the request is not well-formed",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"404": {
						"description": "Indicates that either the campaign or the campaign field could not be found",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"500": {
						"description": "Unexpected error",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			}
		},
		"/campaigns/{id}/segments": {
			"get": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "Get a list of active campaign segments from a campaign",
				"parameters": [
					{
						"name": "id",
						"in": "path",
						"description": "Unique identifier for campaign.",
						"required": true,
						"type": "integer"
					}
				],
				"tags": [
					"campaign-segmentations"
				],
				"responses": {
					"200": {
						"description": "A list of campaign segments",
						"schema": {
							"type": "object",
							"example": [
								{
									"id": 1,
									"name": "Manual segment",
									"type": "manual",
									"referenceId": 1,
									"campaignId": 2,
									"state": "active",
									"createdAt": "2023-01-19T08:13:50.000Z",
									"updatedAt": "2023-01-19T08:13:50.000Z"
								},
								{
									"id": 2,
									"name": "Manual segment",
									"type": "manual",
									"referenceId": 2,
									"campaignId": 2,
									"state": "active",
									"createdAt": "2023-01-19T08:13:50.000Z",
									"updatedAt": "2023-01-19T08:13:50.000Z"
								}
							]
						}
					},
					"403": {
						"description": "User has no access to the campaign",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"404": {
						"description": "Unexpected error",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			}
		},
		"/user-fields": {
			"get": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "Get all user fields",
				"description": "Returns list of user fields \n",
				"parameters": [],
				"tags": [
					"user-fields"
				],
				"responses": {
					"200": {
						"description": "The list of user-fields",
						"schema": {
							"type": "object",
							"example": {
								"userFields": [
									{
										"id": 3,
										"name": "my first user field!",
										"type": "string"
									},
									{
										"id": 3,
										"name": "ohh wait theres 2 of them",
										"type": "number"
									}
								]
							}
						}
					},
					"400": {
						"description": "the request is not well-formed",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"404": {
						"description": "Indicates that the user could not be found",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"500": {
						"description": "Unexpected error",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			},
			"post": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "Create a user field",
				"description": "Creates a new user field, returns array of user fields \n",
				"parameters": [
					{
						"name": "body",
						"in": "body",
						"description": "user field specification",
						"required": true,
						"schema": {
							"$ref": "#/definitions/user-field"
						}
					}
				],
				"tags": [
					"user-fields"
				],
				"responses": {
					"202": {
						"description": "The field has been created",
						"schema": {
							"type": "object",
							"example": {
								"userFields": [
									{
										"id": 3,
										"name": "my first useer field!",
										"value": "its something!",
										"type": "string"
									}
								]
							}
						}
					},
					"400": {
						"description": "the request is not well-formed",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"500": {
						"description": "Unexpected error",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			}
		},
		"/user-fields/{id}": {
			"get": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "Get a specific user field",
				"description": "Returns information about a specific user field \n",
				"parameters": [
					{
						"name": "id",
						"in": "path",
						"description": "Unique identifier for user field.",
						"required": true,
						"type": "integer"
					}
				],
				"tags": [
					"user-fields"
				],
				"responses": {
					"200": {
						"description": "User field found",
						"schema": {
							"type": "object",
							"example": {
								"id": 3,
								"name": "my first user field!",
								"type": "string"
							}
						}
					},
					"400": {
						"description": "the request is not well-formed",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"404": {
						"description": "Indicates that either the user or the user field could not be found",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"500": {
						"description": "Unexpected error",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			},
			"put": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "Update a user field",
				"description": "Updates a user field \n",
				"parameters": [
					{
						"name": "id",
						"in": "path",
						"description": "Unique identifier for user field.",
						"required": true,
						"type": "integer"
					},
					{
						"name": "body",
						"in": "body",
						"description": "User field specification.",
						"required": true,
						"schema": {
							"$ref": "#/definitions/user-field"
						}
					}
				],
				"tags": [
					"user-fields"
				],
				"responses": {
					"200": {
						"description": "The field was updated",
						"schema": {
							"type": "object",
							"example": {
								"id": 3,
								"name": "my first user field!",
								"type": "string"
							}
						}
					},
					"400": {
						"description": "the request is not well-formed",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"404": {
						"description": "Indicates that either the user or the user field could not be found",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"500": {
						"description": "Unexpected error",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			}
		},
		"/users/{id}/data": {
			"patch": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "Insert, update, delete user field data",
				"description": "Updates data values in specified field ids. The key representing campagin field Id, and value representing the new value for the field  \n",
				"parameters": [
					{
						"name": "id",
						"in": "path",
						"description": "Unique identifier for user.",
						"required": true,
						"type": "integer"
					},
					{
						"name": "body",
						"in": "body",
						"description": "Key-value map containing the fields that should be added, updated or deleted. Leaving the value empty or null will delete the data",
						"required": true,
						"schema": {
							"type": "object",
							"example": {
								"4": "this is my new value",
								"6": "",
								"12": "this is my updated value"
							}
						}
					}
				],
				"tags": [
					"user-fields"
				],
				"responses": {
					"200": {
						"description": "The user field data was updated. All active user fields are returned, fields without a value for the user have a value of null",
						"schema": {
							"type": "object",
							"example": [
								{
									"id": 4,
									"name": "my first user field",
									"value": "this is my new value",
									"type": "string"
								},
								{
									"id": 6,
									"name": "my second user field",
									"value": null,
									"type": "string"
								},
								{
									"id": 12,
									"name": "my third user field",
									"value": "this is my updated value",
									"type": "string"
								}
							]
						}
					},
					"400": {
						"description": "the request is not well-formed",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"404": {
						"description": "Indicates that either the user or the user field could not be found",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"500": {
						"description": "Unexpected error",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			}
		},
		"/contacts/findByData": {
			"post": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "Contact list",
				"description": "Search for a contact by specifying a filter for the contact-data. The filter keys should correspond to the field ids. Only the $eq and $in filter operators are allowed.\n",
				"parameters": [
					{
						"name": "body",
						"in": "body",
						"description": "Filter description (ref. https://adversus.dk/api/), with the filter keys being field identifiers",
						"required": true,
						"schema": {
							"type": "object",
							"example": {
								"42": "Alice",
								"1337": "12345678"
							}
						}
					},
					{
						"name": "includeMeta",
						"in": "query",
						"description": "Boolean telling if the query needs to return extended info, like pagination.",
						"required": false,
						"type": "string"
					},
					{
						"name": "pageSize",
						"in": "query",
						"description": "How many rows should be returned for each page.",
						"required": false,
						"type": "integer"
					},
					{
						"name": "page",
						"in": "query",
						"description": "What page is currently being viewed. If 'pageSize' have been defined and not 'page', 1 will be assumed.",
						"required": false,
						"type": "integer"
					}
				],
				"tags": [
					"contacts"
				],
				"responses": {
					"200": {
						"description": "An array of contact identifiers matching the fitler.",
						"schema": {
							"type": "array",
							"items": {
								"type": "integer"
							}
						}
					},
					"400": {
						"description": "Bad request. Will be returned if the filter is not valid, e.g. the field identifiers are invalid or the filter is not well-formed",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"500": {
						"description": "Unexpected error",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			}
		},
		"/contacts": {
			"get": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "Contact list",
				"description": "Equivalent to the contacts/findByData endpoint, but allows specifying the filter as a query parameter.",
				"parameters": [
					{
						"name": "filters",
						"in": "query",
						"description": "Json encoded filter description. Valid filter properties include 'id', 'poolId', 'importId' and existing heading ids",
						"required": false,
						"type": "string"
					},
					{
						"name": "projection",
						"in": "query",
						"description": "A comma seperated list of field identifiers, which should be shown for each contact. __IMPORTANT:__ When a projection is not defined, only the contact ids will be returned.",
						"required": false,
						"type": "string"
					},
					{
						"name": "includeMeta",
						"in": "query",
						"description": "Boolean telling if the query needs to return extended info, like pagination.",
						"required": false,
						"type": "string"
					},
					{
						"name": "sortProperty",
						"in": "query",
						"description": "Name of the column the generated query will be sorted by",
						"required": false,
						"type": "string"
					},
					{
						"name": "sortDirection",
						"in": "query",
						"description": "The direction we want to sort for the 'sortProperty'.",
						"required": false,
						"type": "string",
						"enum": [
							"ASC",
							"DESC"
						]
					},
					{
						"name": "pageSize",
						"in": "query",
						"description": "How many rows should be returned for each page.",
						"required": false,
						"type": "integer"
					},
					{
						"name": "page",
						"in": "query",
						"description": "What page is currently being viewed. If 'pageSize' have been defined and not 'page', 1 will be assumed.",
						"required": false,
						"type": "integer"
					}
				],
				"tags": [
					"contacts"
				],
				"responses": {
					"200": {
						"description": "An array of contacts matching the filter. __IMPORTANT:__ If a projection is not specified, only the contact ids will be returned.",
						"schema": {
							"$ref": "#/definitions/contactsResponse"
						}
					},
					"400": {
						"description": "Bad request. Will be returned if the filter is not valid, e.g. the field identifiers are invalid or the filter is not well-formed",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"500": {
						"description": "Unexpected error",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			},
			"post": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "Create a contact associated with some pool",
				"description": "Create a contact by specifying the pool and data-entries.",
				"parameters": [
					{
						"name": "body",
						"in": "body",
						"description": "Json object containing the pool identifier for the contact and the data fields that should be created",
						"required": true,
						"schema": {
							"type": "object",
							"example": {
								"poolId": 1337,
								"data": {
									"1": "Alice",
									"5": "8200",
									"8": "123456789",
									"13": "Wonderland"
								}
							}
						}
					}
				],
				"tags": [
					"contacts"
				],
				"responses": {
					"200": {
						"description": "The non-empty data-entries for the specified contact as a key-value map (after updating)",
						"schema": {
							"type": "object",
							"example": {
								"id": 321654,
								"poolId": 1337,
								"data": {
									"1": "Alice",
									"5": "8200",
									"8": "123456789",
									"13": "Wonderland"
								}
							}
						}
					},
					"400": {
						"description": "The poolId field is missing",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"404": {
						"description": "The pool could not be found",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"500": {
						"description": "Unexpected error",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			}
		},
		"/contacts/{id}": {
			"get": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "Get info on specific contact",
				"description": "Returns the non-empty data-entries for a given contact id",
				"parameters": [
					{
						"name": "id",
						"in": "path",
						"description": "Contact identifier",
						"required": true,
						"type": "integer"
					}
				],
				"tags": [
					"contacts"
				],
				"responses": {
					"200": {
						"description": "The non-empty data-entries for the specified contact as a key-value map",
						"schema": {
							"type": "object",
							"example": {
								"id": 321654,
								"poolId": 2409,
								"externalId": "92",
								"data": {
									"1": "Alice",
									"8": "123456789",
									"13": "Wonderland"
								}
							}
						}
					},
					"404": {
						"description": "The contact could not be found",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"500": {
						"description": "Unexpected error",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			},
			"patch": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "Update the data for a given contact",
				"description": "Patches the data-entries for a given contact, by specifying a key-value map with the fields that should be altered",
				"parameters": [
					{
						"name": "id",
						"in": "path",
						"description": "Contact identifier",
						"required": true,
						"type": "integer"
					},
					{
						"name": "body",
						"in": "body",
						"description": "Key-value map containing the fields that should be added or updated",
						"required": true,
						"schema": {
							"type": "object",
							"example": {
								"data": {
									"13267": "88668866"
								}
							}
						}
					}
				],
				"tags": [
					"contacts"
				],
				"responses": {
					"200": {
						"description": "The non-empty data-entries for the specified contact as a key-value map (after updating)",
						"schema": {
							"type": "object",
							"example": {
								"id": 321654,
								"poolId": 2409,
								"externalId": "98",
								"data": {
									"1": "Alice",
									"5": "8200",
									"8": "123456789",
									"13": "Wonderland"
								}
							}
						}
					},
					"404": {
						"description": "The contact could not be found",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"500": {
						"description": "Unexpected error",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			},
			"delete": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "Delete a specific contact",
				"description": "Deletes the contact specified",
				"parameters": [
					{
						"name": "id",
						"in": "path",
						"description": "Contact identifier",
						"required": true,
						"type": "integer"
					}
				],
				"tags": [
					"contacts"
				],
				"responses": {
					"200": {
						"description": "The contact was deleted",
						"schema": {
							"type": "object",
							"example": {
								"code": 200,
								"message": "Contact deleted"
							}
						}
					},
					"404": {
						"description": "The contact could not be found",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"500": {
						"description": "Unexpected error",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			}
		},
		"/contacts/{id}/persons": {
			"get": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "Get contact persons & data from a given contact",
				"description": "Get the contact persons with their current data",
				"parameters": [],
				"tags": [
					"contacts"
				],
				"responses": {
					"200": {
						"description": "List of contact persons",
						"schema": {
							"type": "array",
							"items": {
								"type": "object",
								"properties": {
									"id": {
										"type": "integer",
										"description": "The contact person id",
										"example": 10
									},
									"data": {
										"type": "object",
										"description": "Key/value pairs of field_id → value",
										"example": {
											"1": "stringly",
											"2": null,
											"3": 42,
											"4": "2026-02-17"
										}
									}
								},
								"required": [
									"id",
									"data"
								]
							}
						}
					},
					"400": {
						"description": "Unexpected error",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"500": {
						"description": "Unexpected error",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			}
		},
		"/contacts-external/{externalId}": {
			"patch": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "Update the data for a given contact (identified by the external id)",
				"description": "Patches the data-entries for a given contact, by specifying a key-value map with the fields that should be altered",
				"parameters": [
					{
						"name": "externalId",
						"in": "path",
						"description": "Contact identifier",
						"required": true,
						"type": "integer"
					},
					{
						"name": "body",
						"in": "body",
						"description": "Key-value map containing the fields that should be added or updated",
						"required": true,
						"schema": {
							"type": "object",
							"example": {
								"poolId": "2409",
								"data": {
									"13267": "88668866"
								}
							}
						}
					}
				],
				"tags": [
					"contacts"
				],
				"responses": {
					"200": {
						"description": "The non-empty data-entries for the specified contact as a key-value map (after updating)",
						"schema": {
							"type": "object",
							"example": {
								"id": 321654,
								"poolId": 2409,
								"externalId": "98",
								"data": {
									"1": "Alice",
									"5": "8200",
									"8": "123456789",
									"13": "Wonderland"
								}
							}
						}
					},
					"404": {
						"description": "The contact could not be found",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"500": {
						"description": "Unexpected error",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			}
		},
		"/contact-persons/fields": {
			"get": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "Contact person fields list",
				"description": "Get a list of contact person fields",
				"parameters": [
					{
						"name": "includeMeta",
						"in": "query",
						"description": "Boolean telling if the query needs to return extended info, like pagination.",
						"required": false,
						"type": "string"
					},
					{
						"name": "sortProperty",
						"in": "query",
						"description": "Name of the column the generated query will be sorted by",
						"required": false,
						"type": "string"
					},
					{
						"name": "sortDirection",
						"in": "query",
						"description": "The direction we want to sort for the 'sortProperty'.",
						"required": false,
						"type": "string",
						"enum": [
							"ASC",
							"DESC"
						]
					},
					{
						"name": "pageSize",
						"in": "query",
						"description": "How many rows should be returned for each page.",
						"required": false,
						"type": "integer"
					},
					{
						"name": "page",
						"in": "query",
						"description": "What page is currently being viewed. If 'pageSize' have been defined and not 'page', 1 will be assumed.",
						"required": false,
						"type": "integer"
					}
				],
				"tags": [
					"contact-persons"
				],
				"responses": {
					"200": {
						"description": "List of contact person fields",
						"schema": {
							"type": "object",
							"properties": {
								"fields": {
									"type": "array",
									"properties": {
										"id": {
											"type": "integer",
											"example": 1
										},
										"name": {
											"type": "string",
											"example": "First Name"
										},
										"type": {
											"type": "string",
											"example": "string"
										}
									}
								}
							}
						}
					},
					"400": {
						"description": "Unexpected error",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"500": {
						"description": "Unexpected error",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			}
		},
		"/contact-persons": {
			"post": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "Create a contact person and related data.",
				"description": "Create a contact person and add the related data.",
				"parameters": [
					{
						"name": "body",
						"in": "body",
						"description": "Contact persons create body.",
						"required": true,
						"schema": {
							"type": "object",
							"properties": {
								"contactId": {
									"type": "integer",
									"description": "Contact ID for the new person",
									"example": 123
								},
								"data": {
									"type": "object",
									"description": "Field values to create",
									"example": {
										"1": "Grethe",
										"2": "Doe"
									}
								}
							},
							"required": [
								"id",
								"data"
							]
						}
					}
				],
				"tags": [
					"contact-persons"
				],
				"responses": {
					"200": {
						"description": "Contact person field/data key pair for the newly created contact person.",
						"schema": {
							"type": "object",
							"properties": {
								"id": {
									"type": "integer",
									"description": "Person id for the contact person.",
									"example": 123
								},
								"data": {
									"type": "object",
									"description": "Field key/pair values",
									"example": {
										"1": "Grethe",
										"2": "Doe"
									}
								}
							}
						}
					},
					"400": {
						"description": "Bad input",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"500": {
						"description": "Unexpected error",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			}
		},
		"/contact-persons/{id}": {
			"patch": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "Update the data relation for a contact person.",
				"description": "Update the data relation for a contact person.",
				"parameters": [
					{
						"name": "id",
						"in": "path",
						"description": "Unique identifier for contact person.",
						"required": true,
						"type": "integer"
					},
					{
						"name": "body",
						"in": "body",
						"description": "Contact persons update body.",
						"required": true,
						"schema": {
							"type": "object",
							"properties": {
								"data": {
									"type": "object",
									"description": "Field values to update",
									"example": {
										"1": "Aruther",
										"3": "2026-02-17"
									}
								}
							},
							"required": [
								"id",
								"data"
							]
						}
					}
				],
				"tags": [
					"contact-persons"
				],
				"responses": {
					"200": {
						"description": "Contact person field/data key pair for the updated contact person.",
						"schema": {
							"type": "object",
							"properties": {
								"id": {
									"type": "integer",
									"description": "Person id for the contact person.",
									"example": 123
								},
								"data": {
									"type": "object",
									"description": "Field key/pair values",
									"example": {
										"1": "Grethe",
										"2": "Doe"
									}
								}
							}
						}
					},
					"400": {
						"description": "Bad input",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"500": {
						"description": "Unexpected error",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			},
			"delete": {
				"summary": "Delete a contact person.",
				"description": "Delete a contact person.",
				"parameters": [
					{
						"name": "id",
						"in": "path",
						"description": "Unique identifier for contact person.",
						"required": true,
						"type": "integer"
					}
				],
				"tags": [
					"contact-persons"
				],
				"responses": {
					"200": {
						"description": "Contact person deleted.",
						"schema": {
							"type": "object",
							"properties": {
								"code": {
									"type": "integer",
									"example": 200
								},
								"message": {
									"type": "string",
									"example": "Contact person deleted"
								}
							}
						}
					},
					"400": {
						"description": "Bad input",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"500": {
						"description": "Unexpected error",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			}
		},
		"/contact-persons/bulk": {
			"post": {
				"summary": "Create a bulk operation.",
				"description": "Create a bulk action operation",
				"parameters": [
					{
						"name": "body",
						"in": "body",
						"description": "Contact persons bulk body.",
						"required": true,
						"schema": {
							"type": "object",
							"properties": {
								"actions": {
									"type": "array",
									"items": {
										"anyOf": [
											{
												"$ref": "#/definitions/ContactPersonBulkActionCreate"
											},
											{
												"$ref": "#/definitions/ContactPersonBulkActionUpdate"
											},
											{
												"$ref": "#/definitions/ContactPersonBulkActionDelete"
											}
										]
									}
								},
								"callback": {
									"type": "string",
									"description": "Callback URL for async processing",
									"example": "https://example.com/callback"
								}
							},
							"required": [
								"actions",
								"callback"
							]
						}
					}
				],
				"tags": [
					"contact-persons"
				],
				"responses": {
					"200": {
						"description": "Bulk action queued",
						"schema": {
							"type": "object",
							"properties": {
								"code": {
									"type": "integer",
									"example": 200
								},
								"status": {
									"type": "string",
									"example": "queued"
								}
							}
						}
					},
					"400": {
						"description": "Bad input",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"500": {
						"description": "Unexpected error",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"503": {
						"description": "Bulk action failed",
						"schema": {
							"type": "object",
							"properties": {
								"code": {
									"type": "integer",
									"example": 503
								},
								"status": {
									"type": "string",
									"example": "failed"
								}
							}
						}
					}
				}
			}
		},
		"/leads": {
			"get": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "Lead list",
				"description": "The lead endpoint returns information about the leads related to the authenticated user.\n",
				"parameters": [
					{
						"name": "fieldMappingId",
						"in": "query",
						"description": "The external field mapping ID",
						"required": false,
						"type": "integer"
					},
					{
						"name": "filters",
						"in": "query",
						"description": "Json encoded filter description. Valid filter properties include 'id','campaignId', 'lastUpdatedTime', 'lastContactedBy', 'status' and 'contactId'",
						"required": false,
						"type": "string"
					},
					{
						"name": "includeMeta",
						"in": "query",
						"description": "Boolean telling if the query needs to return extended info, like pagination.",
						"required": false,
						"type": "string"
					},
					{
						"name": "sortProperty",
						"in": "query",
						"description": "Name of the column the generated query will be sorted by",
						"required": false,
						"type": "string",
						"enum": [
							"id",
							"campaignId",
							"contactAttempts",
							"lastUpdatedTime",
							"nextContactTime",
							"lastContactedBy",
							"status",
							"active",
							"created",
							"updated",
							"contactId"
						]
					},
					{
						"name": "sortDirection",
						"in": "query",
						"description": "The direction we want to sort for the 'sortProperty'.",
						"required": false,
						"type": "string",
						"enum": [
							"ASC",
							"DESC"
						]
					},
					{
						"name": "pageSize",
						"in": "query",
						"description": "How many rows should be returned for each page.",
						"required": false,
						"type": "integer"
					},
					{
						"name": "page",
						"in": "query",
						"description": "What page is currently being viewed. If 'pageSize' have been defined and not 'page', 1 will be assumed.",
						"required": false,
						"type": "integer"
					}
				],
				"tags": [
					"leads"
				],
				"responses": {
					"200": {
						"description": "An array of leads",
						"schema": {
							"type": "object",
							"properties": {
								"leads": {
									"type": "array",
									"items": {
										"$ref": "#/definitions/leads"
									}
								}
							}
						}
					},
					"400": {
						"description": "Bad input",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"401": {
						"description": "Unauthorized",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"500": {
						"description": "Unexpected error",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			},
			"post": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "Create new lead",
				"parameters": [
					{
						"name": "body",
						"in": "body",
						"description": "Lead resource to be created",
						"required": true,
						"schema": {
							"$ref": "#/definitions/lead"
						}
					}
				],
				"description": "This endpoint creates a new lead.\n",
				"tags": [
					"leads"
				],
				"responses": {
					"200": {
						"description": "Returns lead id",
						"schema": {
							"$ref": "#/definitions/id"
						}
					},
					"400": {
						"description": "Bad input",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"401": {
						"description": "Unauthorized",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"500": {
						"description": "Unexpected error",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			}
		},
		"/leads/{id}": {
			"get": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "Specific lead",
				"parameters": [
					{
						"name": "id",
						"in": "path",
						"description": "Unique identifier for lead.",
						"required": true,
						"type": "string"
					},
					{
						"name": "fieldMappingId",
						"in": "query",
						"description": "The external field mapping ID",
						"required": false,
						"type": "integer"
					}
				],
				"description": "Returns information about a specific lead.\n",
				"tags": [
					"leads"
				],
				"responses": {
					"200": {
						"description": "An array of leads",
						"schema": {
							"type": "array",
							"items": {
								"$ref": "#/definitions/leads"
							}
						}
					},
					"400": {
						"description": "Bad input",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"401": {
						"description": "Unauthorized",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"403": {
						"description": "Forbidden",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"404": {
						"description": "Resource not found",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"500": {
						"description": "Unexpected error",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			},
			"delete": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "Deletes lead",
				"parameters": [
					{
						"name": "id",
						"in": "path",
						"description": "Unique identifier for lead.",
						"required": true,
						"type": "string"
					}
				],
				"description": "This endpoint deletes a single lead.\n",
				"tags": [
					"leads"
				],
				"responses": {
					"200": {
						"description": "Success message",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"400": {
						"description": "Bad input",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"401": {
						"description": "Unauthorized",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"403": {
						"description": "Forbidden",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"404": {
						"description": "Resource not found",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"500": {
						"description": "Unexpected error",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			},
			"put": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "Updates a lead",
				"parameters": [
					{
						"name": "id",
						"in": "path",
						"description": "Unique identifier for lead.",
						"required": true,
						"type": "string"
					},
					{
						"name": "data",
						"in": "body",
						"description": "Array with lead data",
						"required": true,
						"schema": {
							"$ref": "#/definitions/lead"
						}
					}
				],
				"description": "This endpoint updates a single lead.\n",
				"tags": [
					"leads"
				],
				"responses": {
					"200": {
						"description": "Success message",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"400": {
						"description": "Bad input",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"401": {
						"description": "Unauthorized",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"500": {
						"description": "Unexpected error",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			}
		},
		"/sessions": {
			"get": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "Session list",
				"description": "The lead endpoint returns information about the sessions related to the authenticated user.\n",
				"parameters": [
					{
						"name": "filters",
						"in": "query",
						"description": "JSON encoded parameters for filtering records. Valid filter properties include 'id', 'leadId', 'userId', 'campaignId', 'startTime', 'endTime', 'lastUpdatedTime' and 'status'",
						"required": false,
						"type": "string"
					},
					{
						"name": "page",
						"in": "query",
						"description": "Pagination page index",
						"required": false,
						"type": "integer"
					},
					{
						"name": "pageSize",
						"in": "query",
						"description": "Pagination page size",
						"required": false,
						"type": "integer"
					},
					{
						"name": "includeMeta",
						"in": "query",
						"description": "Include pagination information in the generated response",
						"required": false,
						"type": "boolean"
					},
					{
						"name": "sortProperty",
						"in": "query",
						"description": "Property used for ordering records",
						"required": false,
						"type": "string",
						"enum": [
							"id",
							"userid",
							"leadid",
							"campaignId",
							"startTime",
							"endTime",
							"status",
							"lastUpdatedTime"
						]
					}
				],
				"tags": [
					"sessions"
				],
				"responses": {
					"200": {
						"description": "An array of sessions",
						"schema": {
							"type": "array",
							"items": {
								"$ref": "#/definitions/sessions"
							}
						}
					},
					"400": {
						"description": "Bad input",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"401": {
						"description": "Unauthorized",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"403": {
						"description": "Forbidden",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"404": {
						"description": "Resource not found",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"500": {
						"description": "Unexpected error",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			}
		},
		"/sessions/{id}": {
			"get": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "Specific session",
				"parameters": [
					{
						"name": "id",
						"in": "path",
						"description": "Unique identifier for session.",
						"required": true,
						"type": "string"
					}
				],
				"description": "Returns information about a specific session.\n",
				"tags": [
					"sessions"
				],
				"responses": {
					"200": {
						"description": "An array of sessions",
						"schema": {
							"type": "array",
							"items": {
								"$ref": "#/definitions/sessions"
							}
						}
					},
					"400": {
						"description": "Bad input",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"401": {
						"description": "Unauthorized",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"403": {
						"description": "Forbidden",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"404": {
						"description": "Resource not found",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"500": {
						"description": "Unexpected error",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			}
		},
		"/users": {
			"get": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "User list",
				"description": "The user endpoint returns information about all the users related to the authenticated user. The response includes the display name\nand other details about each user.\n",
				"parameters": [
					{
						"name": "filters",
						"in": "query",
						"description": "Json encoded filter description. Valid filter properties include 'name', 'email', 'phone' and 'userGroup'",
						"required": false,
						"type": "string"
					},
					{
						"name": "includeMeta",
						"in": "query",
						"description": "Boolean telling if the query needs to return extended info, like pagination.",
						"required": false,
						"type": "string"
					},
					{
						"name": "includeUserFields",
						"in": "query",
						"description": "Boolean telling if the query needs to return custom user data, default is false.",
						"required": false,
						"type": "string"
					},
					{
						"name": "sortProperty",
						"in": "query",
						"description": "Name of the column the generated query will be sorted by",
						"required": false,
						"type": "string",
						"enum": [
							"name",
							"email",
							"phone",
							"user_group"
						]
					},
					{
						"name": "sortDirection",
						"in": "query",
						"description": "The direction we want to sort for the 'sortProperty'.",
						"required": false,
						"type": "string",
						"enum": [
							"ASC",
							"DESC"
						]
					},
					{
						"name": "pageSize",
						"in": "query",
						"description": "How many rows should be returned for each page.",
						"required": false,
						"type": "integer"
					},
					{
						"name": "page",
						"in": "query",
						"description": "What page is currently being viewed. If 'pageSize' have been defined and not 'page', 1 will be assumed.",
						"required": false,
						"type": "integer"
					}
				],
				"tags": [
					"users"
				],
				"responses": {
					"200": {
						"description": "An array of users",
						"schema": {
							"type": "object",
							"properties": {
								"users": {
									"type": "array",
									"items": {
										"$ref": "#/definitions/users"
									}
								}
							}
						}
					},
					"401": {
						"description": "Unauthorized",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"500": {
						"description": "Unexpected error",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			},
			"post": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "Create a user belonging to the authenticated client",
				"description": "Create a regular (aka. internal) user belonging to the authenticated client.",
				"tags": [
					"users"
				],
				"parameters": [
					{
						"name": "body",
						"in": "body",
						"description": "User resource to be created",
						"required": true,
						"schema": {
							"$ref": "#/definitions/create-user"
						}
					}
				],
				"responses": {
					"201": {
						"description": "The user was succesfully created and the created resource is returned along with the unique identifier created for the user",
						"schema": {
							"$ref": "#/definitions/users"
						}
					},
					"400": {
						"description": "Bad request. In particular this will occur if the username already exists or if either the username, phone or locale is not correctly formatted",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"401": {
						"description": "Unauthorized",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"500": {
						"description": "Unexpected error",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			}
		},
		"/users/{id}": {
			"get": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "Specific user",
				"description": "The user endpoint returns information about a particular user. The response includes the display name\nand other details about each user.\n",
				"parameters": [
					{
						"name": "id",
						"in": "path",
						"description": "Unique identifier for user.",
						"required": true,
						"type": "string"
					},
					{
						"name": "includeUserFields",
						"in": "query",
						"description": "Boolean telling if the query needs to return custom user data, default is false.",
						"required": false,
						"type": "string"
					}
				],
				"tags": [
					"users"
				],
				"responses": {
					"200": {
						"description": "An array of users",
						"schema": {
							"type": "array",
							"items": {
								"$ref": "#/definitions/users"
							}
						}
					},
					"401": {
						"description": "Unauthorized",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"500": {
						"description": "Unexpected error",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			},
			"delete": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "Specific user",
				"description": "Deactivates the user with the specified id.",
				"parameters": [
					{
						"name": "id",
						"in": "path",
						"description": "Unique identifier for user.",
						"required": true,
						"type": "string"
					}
				],
				"tags": [
					"users"
				],
				"responses": {
					"200": {
						"description": "The user was successfully deleted"
					},
					"404": {
						"description": "The user could not be found",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			},
			"patch": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "Update a user belonging to the authenticated client",
				"description": "Updates a regular (aka. internal) user belonging to the authenticated client.",
				"tags": [
					"users"
				],
				"parameters": [
					{
						"name": "body",
						"in": "body",
						"description": "A partial user resource containing any properties that should be updated",
						"required": true,
						"schema": {
							"$ref": "#/definitions/user-partial"
						}
					},
					{
						"name": "id",
						"in": "path",
						"description": "Unique identifier for user resource to be updated",
						"required": true,
						"type": "integer"
					}
				],
				"responses": {
					"200": {
						"description": "The user was succesfully patched and the updated resource is returned along with the unique identifier created for the user",
						"schema": {
							"$ref": "#/definitions/users"
						}
					},
					"400": {
						"description": "Bad request. In particular this will occur if a new username is requested and that username already exists or if either the username, phone or locale is not correctly formatted",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"401": {
						"description": "Unauthorized",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"500": {
						"description": "Unexpected error",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			}
		},
		"/login-sessions": {
			"get": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "Get login session for a specific user",
				"parameters": [
					{
						"name": "filters",
						"in": "query",
						"description": "Json encoded parameters for filtering records. Valid filter properties include: 'timestamp', 'userId'",
						"required": false,
						"type": "string"
					},
					{
						"name": "includeMeta",
						"in": "query",
						"description": "Toggle pagination info.",
						"required": false,
						"type": "string"
					},
					{
						"name": "pageSize",
						"in": "query",
						"description": "How many rows should be returned for each page.",
						"required": false,
						"type": "integer"
					},
					{
						"name": "page",
						"in": "query",
						"description": "What page is currently being viewed. If 'pageSize' have been defined and not 'page', 1 will be assumed.",
						"required": false,
						"type": "integer"
					}
				],
				"description": "This endpoint is used for retrieving details on user login session",
				"tags": [
					"loginSessions"
				],
				"responses": {
					"200": {
						"description": "Returns user session data",
						"schema": {
							"type": "object",
							"properties": {
								"fromDate": {
									"description": "The date where the calculations starts",
									"type": "string",
									"example": "2026-01-12T00:00:00Z"
								},
								"toDate": {
									"description": "The date where til the calculations runs",
									"type": "string",
									"example": "2026-01-13T00:00:00Z"
								},
								"sessions": {
									"type": "array",
									"items": {
										"$ref": "#/definitions/loginsession"
									}
								}
							}
						}
					},
					"403": {
						"description": "API user doesn't have permission to acces the user object",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"404": {
						"description": "Data not found",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"500": {
						"description": "Unexpected error",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			}
		},
		"/teams": {
			"get": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "Teams",
				"description": "The teams endpoint returns a list of all teams created. Teams are used inside for controlling which campaigns can be accessed, and they can be assigned to a user using the memberOf property.",
				"parameters": [
					{
						"name": "includeMeta",
						"in": "query",
						"description": "Toggle pagination info.",
						"required": false,
						"type": "string"
					},
					{
						"name": "pageSize",
						"in": "query",
						"description": "How many rows should be returned for each page.",
						"required": false,
						"type": "integer"
					},
					{
						"name": "page",
						"in": "query",
						"description": "What page is currently being viewed. If 'pageSize' have been defined and not 'page', 1 will be assumed.",
						"required": false,
						"type": "integer"
					}
				],
				"tags": [
					"teams",
					"users"
				],
				"responses": {
					"200": {
						"description": "An array of teams",
						"schema": {
							"type": "object",
							"properties": {
								"teams": {
									"type": "array",
									"items": {
										"$ref": "#/definitions/team"
									}
								}
							}
						}
					},
					"401": {
						"description": "Unauthorized",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"500": {
						"description": "Unexpected error",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			}
		},
		"/groups": {
			"get": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "User groups",
				"description": "The groups endpoint returns a list of all user groups created. User groups are used inside for grouping multiple users in the analytics module.",
				"parameters": [
					{
						"name": "includeMeta",
						"in": "query",
						"description": "Toggle pagination info.",
						"required": false,
						"type": "string"
					},
					{
						"name": "pageSize",
						"in": "query",
						"description": "How many rows should be returned for each page.",
						"required": false,
						"type": "integer"
					},
					{
						"name": "page",
						"in": "query",
						"description": "What page is currently being viewed. If 'pageSize' have been defined and not 'page', 1 will be assumed.",
						"required": false,
						"type": "integer"
					}
				],
				"tags": [
					"groups",
					"users"
				],
				"responses": {
					"200": {
						"description": "An array of user groups",
						"schema": {
							"type": "object",
							"properties": {
								"groups": {
									"type": "array",
									"items": {
										"$ref": "#/definitions/group"
									}
								}
							}
						}
					},
					"401": {
						"description": "Unauthorized",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"500": {
						"description": "Unexpected error",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			}
		},
		"/roles": {
			"get": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "Roles",
				"description": "The roles endpoint returns a list of all roles created. Roles are currently known as permission groups inside Adversus and are used to assign a set of capabilities for a user.",
				"parameters": [
					{
						"name": "includeMeta",
						"in": "query",
						"description": "Toggle pagination info.",
						"required": false,
						"type": "string"
					},
					{
						"name": "pageSize",
						"in": "query",
						"description": "How many rows should be returned for each page.",
						"required": false,
						"type": "integer"
					},
					{
						"name": "page",
						"in": "query",
						"description": "What page is currently being viewed. If 'pageSize' have been defined and not 'page', 1 will be assumed.",
						"required": false,
						"type": "integer"
					}
				],
				"tags": [
					"roles",
					"users"
				],
				"responses": {
					"200": {
						"description": "An array of roles",
						"schema": {
							"type": "object",
							"properties": {
								"roles": {
									"type": "array",
									"items": {
										"$ref": "#/definitions/role"
									}
								}
							}
						}
					},
					"401": {
						"description": "Unauthorized",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"500": {
						"description": "Unexpected error",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			}
		},
		"/pools": {
			"get": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "Pool list",
				"description": "The pools endpoint returns information about all the lead pools related to the authenticated user. \n",
				"parameters": [
					{
						"name": "filters",
						"in": "query",
						"description": "Json encoded filter description. Valid filter properties include 'id', 'name' and 'createdTime'",
						"required": false,
						"type": "string"
					},
					{
						"name": "includeMeta",
						"in": "query",
						"description": "Boolean telling if the query needs to return extended info, like pagination.",
						"required": false,
						"type": "string"
					},
					{
						"name": "sortProperty",
						"in": "query",
						"description": "Name of the column the generated query will be sorted by",
						"required": false,
						"type": "string",
						"enum": [
							"name",
							"created"
						]
					},
					{
						"name": "sortDirection",
						"in": "query",
						"description": "The direction we want to sort for the 'sortProperty'.",
						"required": false,
						"type": "string",
						"enum": [
							"ASC",
							"DESC"
						]
					},
					{
						"name": "pageSize",
						"in": "query",
						"description": "How many rows should be returned for each page.",
						"required": false,
						"type": "integer"
					},
					{
						"name": "page",
						"in": "query",
						"description": "What page is currently being viewed. If 'pageSize' have been defined and not 'page', 1 will be assumed.",
						"required": false,
						"type": "integer"
					}
				],
				"tags": [
					"pools"
				],
				"responses": {
					"200": {
						"description": "An array of pools",
						"schema": {
							"type": "array",
							"items": {
								"$ref": "#/definitions/pools"
							}
						}
					},
					"401": {
						"description": "Unauthorized",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"500": {
						"description": "Unexpected error",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			},
			"post": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "Add a pool",
				"description": "Create a new lead pool belonging to the authenticated user. \n",
				"tags": [
					"pools"
				],
				"parameters": [
					{
						"name": "body",
						"in": "body",
						"description": "An object containing a \"name\" key",
						"required": true,
						"schema": {
							"type": "object",
							"required": [
								"name"
							],
							"properties": {
								"name": {
									"type": "string"
								}
							},
							"example": {
								"name": "Wonderland"
							}
						}
					}
				],
				"responses": {
					"200": {
						"description": "The pool was successfully added and the inserted resource is returned.",
						"schema": {
							"type": "object",
							"properties": {
								"id": {
									"type": "integer"
								},
								"name": {
									"type": "string"
								},
								"created": {
									"type": "string"
								}
							}
						}
					},
					"400": {
						"description": "Bad request. This error will occur if the name is not specified in the request body.",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"401": {
						"description": "Unauthorized",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"500": {
						"description": "Unexpected error",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			}
		},
		"/pools/{id}": {
			"get": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "Get a specific pool",
				"description": "Returns information about a pool. \n",
				"tags": [
					"pools"
				],
				"parameters": [
					{
						"name": "id",
						"in": "path",
						"description": "The pool ID",
						"required": true,
						"type": "integer"
					}
				],
				"responses": {
					"200": {
						"description": "An array of pools",
						"schema": {
							"type": "array",
							"items": {
								"$ref": "#/definitions/pools"
							}
						}
					},
					"401": {
						"description": "Unauthorized",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"500": {
						"description": "Unexpected error",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			}
		},
		"/appointments": {
			"get": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "Appointment list",
				"description": "The appointments endpoint returns information about all the appointments (bookings) related to the authenticated user. \n",
				"parameters": [
					{
						"name": "filters",
						"in": "query",
						"description": "Json encoded filter description. Valid filter properties include 'id', 'leadId', 'userId', 'consultantId', 'start', 'end', 'created', 'updated', 'status' and 'lastModifiedTime'",
						"required": false,
						"type": "string"
					},
					{
						"name": "includeMeta",
						"in": "query",
						"description": "Boolean telling if the query needs to return extended info, like pagination.",
						"required": false,
						"type": "string"
					},
					{
						"name": "sortProperty",
						"in": "query",
						"description": "Name of the column the generated query will be sorted by",
						"required": false,
						"type": "string",
						"enum": [
							"id",
							"leadId",
							"userId",
							"consultantId",
							"start",
							"end",
							"created",
							"updated",
							"status",
							"lastModifiedTime"
						]
					},
					{
						"name": "sortDirection",
						"in": "query",
						"description": "The direction we want to sort for the 'sortProperty'.",
						"required": false,
						"type": "string",
						"enum": [
							"ASC",
							"DESC"
						]
					},
					{
						"name": "pageSize",
						"in": "query",
						"description": "How many rows should be returned for each page.",
						"required": false,
						"type": "integer"
					},
					{
						"name": "page",
						"in": "query",
						"description": "What page is currently being viewed. If 'pageSize' have been defined and not 'page', 1 will be assumed.",
						"required": false,
						"type": "integer"
					}
				],
				"tags": [
					"appointments"
				],
				"responses": {
					"200": {
						"description": "An array of mail events",
						"schema": {
							"type": "array",
							"items": {
								"$ref": "#/definitions/appointments"
							}
						}
					},
					"400": {
						"description": "Bad input",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"401": {
						"description": "Unauthorized",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"500": {
						"description": "Unexpected error",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			}
		},
		"/mails/activity": {
			"get": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "Mail activity list",
				"description": "The mail activity endpoint returns information about all the mails sent. \n",
				"parameters": [
					{
						"name": "filters",
						"in": "query",
						"description": "Json encoded filter description. Valid filter properties include 'id', 'messageId', 'event', 'campaignId', 'leadId', 'userId', 'sender', 'receiver' and 'timestamp'",
						"required": false,
						"type": "string"
					},
					{
						"name": "includeMeta",
						"in": "query",
						"description": "Boolean telling if the query needs to return extended info, like pagination.",
						"required": false,
						"type": "string"
					},
					{
						"name": "sortProperty",
						"in": "query",
						"description": "Name of the column the generated query will be sorted by",
						"required": false,
						"type": "string",
						"enum": [
							"id",
							"messageId",
							"event",
							"campaignId",
							"leadId",
							"userId",
							"sender",
							"receiver",
							"timestamp"
						]
					},
					{
						"name": "sortDirection",
						"in": "query",
						"description": "The direction we want to sort for the 'sortProperty'.",
						"required": false,
						"type": "string",
						"enum": [
							"ASC",
							"DESC"
						]
					},
					{
						"name": "pageSize",
						"in": "query",
						"description": "How many rows should be returned for each page.",
						"required": false,
						"type": "integer"
					},
					{
						"name": "page",
						"in": "query",
						"description": "What page is currently being viewed. If 'pageSize' have been defined and not 'page', 1 will be assumed.",
						"required": false,
						"type": "integer"
					}
				],
				"tags": [
					"mails"
				],
				"responses": {
					"200": {
						"description": "An array of mail events",
						"schema": {
							"type": "array",
							"items": {
								"$ref": "#/definitions/mailActivity"
							}
						}
					},
					"400": {
						"description": "Bad input",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			}
		},
		"/fields": {
			"get": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "Fields list",
				"description": "The fields endpoint returns information about all the data fields related to the authenticated user. \n",
				"parameters": [
					{
						"name": "fieldMappingId",
						"in": "query",
						"description": "The external field mapping ID",
						"required": false,
						"type": "integer"
					},
					{
						"name": "filters",
						"in": "query",
						"description": "Json encoded filter description. Valid filter properties include 'id' and 'name'",
						"required": false,
						"type": "string"
					},
					{
						"name": "includeMeta",
						"in": "query",
						"description": "Boolean telling if the query needs to return extended info, like pagination.",
						"required": false,
						"type": "string"
					},
					{
						"name": "sortProperty",
						"in": "query",
						"description": "Name of the column the generated query will be sorted by",
						"required": false,
						"type": "string",
						"enum": [
							"id",
							"name"
						]
					},
					{
						"name": "sortDirection",
						"in": "query",
						"description": "The direction we want to sort for the 'sortProperty'.",
						"required": false,
						"type": "string",
						"enum": [
							"ASC",
							"DESC"
						]
					},
					{
						"name": "pageSize",
						"in": "query",
						"description": "How many rows should be returned for each page.",
						"required": false,
						"type": "integer"
					},
					{
						"name": "page",
						"in": "query",
						"description": "What page is currently being viewed. If 'pageSize' have been defined and not 'page', 1 will be assumed.",
						"required": false,
						"type": "integer"
					}
				],
				"tags": [
					"fields"
				],
				"responses": {
					"200": {
						"description": "An array of fields",
						"schema": {
							"type": "array",
							"items": {
								"$ref": "#/definitions/fields"
							}
						}
					},
					"401": {
						"description": "Unauthorized",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"500": {
						"description": "Unexpected error",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			}
		},
		"/field-mappings": {
			"get": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "List of external field IDs mappings",
				"description": "Returns all the existing mappings of external field IDs. \n",
				"parameters": [
					{
						"name": "filters",
						"in": "query",
						"description": "Json encoded filter description. Valid filter properties include 'id' and 'lastUpdated'",
						"required": false,
						"type": "string"
					},
					{
						"name": "includeMeta",
						"in": "query",
						"description": "Boolean telling if the query needs to return extended info, like pagination.",
						"required": false,
						"type": "string"
					},
					{
						"name": "sortProperty",
						"in": "query",
						"description": "Name of the column the generated query will be sorted by",
						"required": false,
						"type": "string",
						"enum": [
							"id",
							"lastUpdated"
						]
					},
					{
						"name": "sortDirection",
						"in": "query",
						"description": "The direction we want to sort for the 'sortProperty'.",
						"required": false,
						"type": "string",
						"enum": [
							"ASC",
							"DESC"
						]
					},
					{
						"name": "pageSize",
						"in": "query",
						"description": "How many rows should be returned for each page.",
						"required": false,
						"type": "integer"
					},
					{
						"name": "page",
						"in": "query",
						"description": "What page is currently being viewed. If 'pageSize' have been defined and not 'page', 1 will be assumed.",
						"required": false,
						"type": "integer"
					}
				],
				"tags": [
					"fields"
				],
				"responses": {
					"200": {
						"description": "An array of field mappings",
						"schema": {
							"type": "array",
							"items": {
								"$ref": "#/definitions/fieldsMapping"
							}
						}
					},
					"400": {
						"description": "Bad Input",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"500": {
						"description": "Unexpected error",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			},
			"post": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "Create an external field IDs mapping",
				"description": "Create a new mapping between adversus field IDs and external IDs. The mappings can be used to return an external ID of a field instead of Adversus internal ID \n",
				"tags": [
					"fields"
				],
				"parameters": [
					{
						"name": "name",
						"in": "body",
						"description": "A name of the new field mapping",
						"required": true
					},
					{
						"name": "mappings",
						"in": "body",
						"description": "An object containing key value pairs where a key is an Adversus field ID and value is the external ID",
						"required": true
					}
				],
				"responses": {
					"200": {
						"description": "Returns an ID of a created fields mapping",
						"schema": {
							"type": "integer"
						}
					},
					"400": {
						"description": "Bad request. This error will occur if the request body is not provided, it's empty or some Adversus field IDs don't exist.",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"500": {
						"description": "Unexpected error",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			}
		},
		"/field-mappings/{id}": {
			"get": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "Get a specific external field IDs mapping",
				"description": "Returns the information about a specific fields mapping. \n",
				"parameters": [
					{
						"name": "id",
						"in": "path",
						"description": "The external field mapping ID",
						"required": true,
						"type": "integer"
					}
				],
				"tags": [
					"fields"
				],
				"responses": {
					"200": {
						"description": "A field IDs mapping",
						"schema": {
							"type": "object",
							"$ref": "#/definitions/fieldsMapping"
						}
					},
					"400": {
						"description": "Bad Input",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"500": {
						"description": "Unexpected error",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			},
			"put": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "Update an external field IDs mapping",
				"description": "Updates a field IDs mapping \n",
				"tags": [
					"fields"
				],
				"parameters": [
					{
						"name": "id",
						"in": "path",
						"description": "The external field mapping ID",
						"required": true,
						"type": "integer"
					},
					{
						"name": "name",
						"in": "body",
						"description": "A new name of the field mapping",
						"required": true
					},
					{
						"name": "mappings",
						"in": "body",
						"description": "An object containing key value pairs where a key is an Adversus field ID and value is the external ID",
						"required": true
					}
				],
				"responses": {
					"200": {
						"description": "Returns an ID of a created fields mapping",
						"schema": {
							"type": "integer",
							"example": 123
						}
					},
					"400": {
						"description": "Bad request. This error will occur if the request body is not provided, it's empty or some Adversus field IDs don't exist.",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"500": {
						"description": "Unexpected error",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			},
			"delete": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "Delete an external field IDs mapping",
				"description": "Deletes a field IDs mapping \n",
				"tags": [
					"fields"
				],
				"parameters": [
					{
						"name": "id",
						"in": "path",
						"description": "The external field mapping ID",
						"required": true,
						"type": "integer"
					}
				],
				"responses": {
					"200": {
						"description": "Returns an OK",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"400": {
						"description": "Bad request. This error will occur if the request body is not provided, it's empty or some Adversus field IDs don't exist.",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"500": {
						"description": "Unexpected error",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			}
		},
		"/webhooks": {
			"get": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "Webhook list",
				"description": "The webhooks endpoint returns information about all the webhooks related to the authenticated user. \n",
				"parameters": [
					{
						"name": "filters",
						"in": "query",
						"description": "Json encoded filter description. Valid filter properties include 'event', 'url','created' and 'updated'",
						"required": false,
						"type": "string"
					},
					{
						"name": "includeMeta",
						"in": "query",
						"description": "Boolean telling if the query needs to return extended info, like pagination.",
						"required": false,
						"type": "string"
					},
					{
						"name": "sortProperty",
						"in": "query",
						"description": "Name of the column the generated query will be sorted by",
						"required": false,
						"type": "string",
						"enum": [
							"event",
							"url",
							"created",
							"updated"
						]
					},
					{
						"name": "sortDirection",
						"in": "query",
						"description": "The direction we want to sort for the 'sortProperty'.",
						"required": false,
						"type": "string",
						"enum": [
							"ASC",
							"DESC"
						]
					},
					{
						"name": "pageSize",
						"in": "query",
						"description": "How many rows should be returned for each page.",
						"required": false,
						"type": "integer"
					},
					{
						"name": "page",
						"in": "query",
						"description": "What page is currently being viewed. If 'pageSize' have been defined and not 'page', 1 will be assumed.",
						"required": false,
						"type": "integer"
					}
				],
				"tags": [
					"webhooks"
				],
				"responses": {
					"200": {
						"description": "An array of webhooks",
						"schema": {
							"type": "array",
							"items": {
								"$ref": "#/definitions/webhooks"
							}
						}
					},
					"401": {
						"description": "Unauthorized",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"500": {
						"description": "Unexpected error",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			},
			"post": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "Create new webhook",
				"parameters": [
					{
						"name": "body",
						"in": "body",
						"description": "Webhook specification, including event and url.",
						"required": true,
						"schema": {
							"$ref": "#/definitions/webhook"
						}
					}
				],
				"description": "This endpoint creates a new webhook.\n\nFor certain events it is possible to extend the emitted webhook post body. This is done by specifying the **template** property on create with a json object containing the output data using merge-tags. The template will be merged with the lead-data when the webhook is emitted and the result will be contained within the output as the property **data**.\n\nMerge-tags are specified inside the json-template as substrings having the form **[fieldId]**. These will be substituted by the corresponding lead-data identified by the *fieldId*.\nCurrently only the webhook event **lead_saved** support the templating system.",
				"tags": [
					"webhooks"
				],
				"responses": {
					"200": {
						"description": "Returns webhook id",
						"schema": {
							"$ref": "#/definitions/id"
						}
					},
					"400": {
						"description": "Bad input",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"401": {
						"description": "Unauthorized",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"500": {
						"description": "Unexpected error",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			}
		},
		"/webhooks/{id}": {
			"get": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "Specific webhook",
				"parameters": [
					{
						"name": "id",
						"in": "path",
						"description": "Unique identifier for webhook.",
						"required": true,
						"type": "string"
					}
				],
				"description": "Returns information about a specific webhook.\n",
				"tags": [
					"webhooks"
				],
				"responses": {
					"200": {
						"description": "An array of webhooks",
						"schema": {
							"type": "array",
							"items": {
								"$ref": "#/definitions/webhooks"
							}
						}
					},
					"400": {
						"description": "Bad input",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"401": {
						"description": "Unauthorized",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"403": {
						"description": "Forbidden",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"404": {
						"description": "Resource not found",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"500": {
						"description": "Unexpected error",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			},
			"delete": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "Deletes a webhook",
				"parameters": [
					{
						"name": "id",
						"in": "path",
						"description": "Unique identifier for webhook.",
						"required": true,
						"type": "string"
					}
				],
				"description": "This endpoint deletes a single webhook.\n",
				"tags": [
					"webhooks"
				],
				"responses": {
					"200": {
						"description": "An array of webhooks",
						"schema": {
							"type": "array",
							"items": {
								"$ref": "#/definitions/webhooks"
							}
						}
					},
					"400": {
						"description": "Bad input",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"401": {
						"description": "Unauthorized",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"403": {
						"description": "Forbidden",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"404": {
						"description": "Resource not found",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"500": {
						"description": "Unexpected error",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			},
			"put": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "Updates a webhook",
				"parameters": [
					{
						"name": "id",
						"in": "path",
						"description": "Unique identifier for webhook.",
						"required": true,
						"type": "string"
					},
					{
						"name": "data",
						"in": "body",
						"description": "Array with webhook data",
						"required": true,
						"schema": {
							"$ref": "#/definitions/webhook"
						}
					}
				],
				"description": "This endpoint updates a single webhook.\n",
				"tags": [
					"webhooks"
				],
				"responses": {
					"200": {
						"description": "Returns webhook id",
						"schema": {
							"$ref": "#/definitions/id"
						}
					},
					"400": {
						"description": "Bad input",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"401": {
						"description": "Unauthorized",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"500": {
						"description": "Unexpected error",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			}
		},
		"/efficiency/{id}": {
			"get": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "Get user efficiency for the current date",
				"parameters": [
					{
						"name": "id",
						"in": "path",
						"description": "Unique id for user",
						"required": true,
						"type": "integer"
					}
				],
				"description": "This endpoint is used for retrieving details on user efficiency, e.g. time spend waiting for calls vs time spent in calls vs time spenting processing calls",
				"tags": [
					"users"
				],
				"responses": {
					"200": {
						"description": "Returns user efficiency for selected user",
						"schema": {
							"$ref": "#/definitions/efficiency"
						}
					},
					"404": {
						"description": "User not found",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"500": {
						"description": "Unexpected error",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			}
		},
		"/users/{id}/loginTime": {
			"get": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "Get login time for a specific user",
				"parameters": [
					{
						"name": "id",
						"in": "path",
						"description": "Unique id for user",
						"required": true,
						"type": "integer"
					},
					{
						"name": "filters",
						"in": "query",
						"description": "Json encoded filter description. Can be only be filtered by timestamp",
						"required": false,
						"type": "string"
					}
				],
				"description": "This endpoint is used for retrieving details on user efficiency, e.g. time spend waiting for calls vs time spent in calls vs time spenting processing calls",
				"tags": [
					"users"
				],
				"responses": {
					"200": {
						"description": "Returns user efficiency for selected user",
						"schema": {
							"$ref": "#/definitions/logintime"
						}
					},
					"403": {
						"description": "API user doesn't have permission to acces the user object",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"404": {
						"description": "User not found",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"500": {
						"description": "Unexpected error",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			}
		},
		"/cdr": {
			"get": {
				"deprecated": true,
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "List call detail records (deprecated — use GET /calls)",
				"parameters": [
					{
						"name": "filters",
						"in": "query",
						"description": "Json encoded parameters for filtering records. Valid filter properties include 'insertedTime','destination','durationSeconds','conversationSeconds','disposition','userId','leadId' and 'campaignId'",
						"required": false,
						"type": "string"
					},
					{
						"name": "page",
						"in": "query",
						"description": "Pagination page index",
						"required": false,
						"type": "integer"
					},
					{
						"name": "pageSize",
						"in": "query",
						"description": "Pagination page size",
						"required": false,
						"type": "integer"
					},
					{
						"name": "includeMeta",
						"in": "query",
						"description": "Include pagination information in the generated response",
						"required": false,
						"type": "boolean"
					},
					{
						"name": "sortProperty",
						"in": "query",
						"description": "Property used for ordering records",
						"required": false,
						"type": "string",
						"enum": [
							"insertedTime"
						]
					}
				],
				"description": "This endpoint is used for retrieving billing information about phone calls",
				"tags": [
					"cdr"
				],
				"responses": {
					"200": {
						"description": "Returns paginated response",
						"schema": {
							"$ref": "#/definitions/cdr"
						}
					},
					"400": {
						"description": "Bad request",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"401": {
						"description": "Unauthorized",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"500": {
						"description": "Unexpected error",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			}
		},
		"/cdr/{id}/recording": {
			"get": {
				"deprecated": true,
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "Get download link for recorded audio (deprecated — use GET /calls/{id}/recording)",
				"parameters": [
					{
						"name": "id",
						"in": "path",
						"description": "Unique identifier for call detail record.",
						"required": true,
						"type": "integer"
					}
				],
				"tags": [
					"cdr"
				],
				"description": "Endpoint for getting the recorded audio for a call. Deprecated — use GET /calls/{id}/recording instead.",
				"responses": {
					"307": {
						"description": "Http redirect for downloading the requested resource. The returned location is valid for no longer than 2 hours."
					},
					"404": {
						"description": "Call not found",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			}
		},
		"/calls": {
			"get": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "List call detail records",
				"description": "This endpoint is used for retrieving billing information about phone calls",
				"tags": [
					"calls"
				],
				"parameters": [
					{
						"name": "filters",
						"in": "query",
						"description": "Json encoded parameters for filtering records. Valid filter properties include 'campaignId', 'userId', 'start' and 'timestamp'",
						"required": false,
						"type": "string"
					},
					{
						"name": "includeMeta",
						"in": "query",
						"description": "Include pagination information in the generated response",
						"required": false,
						"type": "boolean"
					},
					{
						"name": "page",
						"in": "query",
						"description": "Pagination page index",
						"required": false,
						"type": "integer"
					},
					{
						"name": "pageSize",
						"in": "query",
						"description": "Pagination page size",
						"required": false,
						"type": "integer"
					},
					{
						"name": "sortProperty",
						"in": "query",
						"description": "Property used for ordering records",
						"required": false,
						"type": "string",
						"enum": [
							"timestamp",
							"start"
						]
					}
				],
				"responses": {
					"200": {
						"description": "Returns paginated response",
						"schema": {
							"type": "object",
							"properties": {
								"calls": {
									"type": "array",
									"items": {
										"$ref": "#/definitions/call-entry"
									}
								}
							}
						}
					},
					"400": {
						"description": "Bad request",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"401": {
						"description": "Unauthorized",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"500": {
						"description": "Unexpected error",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			}
		},
		"/calls/{id}/recording": {
			"get": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "Get download link for recorded audio",
				"description": "Endpoint for getting the recorded audio for a call",
				"tags": [
					"calls"
				],
				"parameters": [
					{
						"name": "id",
						"in": "path",
						"description": "Unique identifier for the call.",
						"required": true,
						"type": "integer"
					}
				],
				"responses": {
					"307": {
						"description": "HTTP redirect to the recording download URL. The returned location is valid for no longer than 2 hours."
					},
					"404": {
						"description": "Call or recording not found",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			}
		},
		"/projects": {
			"get": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "List projects",
				"description": "Endpoint for getting all projects for the authenticated client",
				"parameters": [
					{
						"name": "filters",
						"in": "query",
						"description": "Json encoded filter description. Valid filter property is 'name'",
						"required": false,
						"type": "string"
					},
					{
						"name": "includeMeta",
						"in": "query",
						"description": "Boolean telling if the query needs to return extended info, like pagination.",
						"required": false,
						"type": "string"
					},
					{
						"name": "sortProperty",
						"in": "query",
						"description": "Name of the column the generated query will be sorted by",
						"required": false,
						"type": "string",
						"enum": [
							"name"
						]
					},
					{
						"name": "sortDirection",
						"in": "query",
						"description": "The direction we want to sort for the 'sortProperty'.",
						"required": false,
						"type": "string",
						"enum": [
							"ASC",
							"DESC"
						]
					},
					{
						"name": "pageSize",
						"in": "query",
						"description": "How many rows should be returned for each page.",
						"required": false,
						"type": "integer"
					},
					{
						"name": "page",
						"in": "query",
						"description": "What page is currently being viewed. If 'pageSize' have been defined and not 'page', 1 will be assumed.",
						"required": false,
						"type": "integer"
					}
				],
				"tags": [
					"campaigns"
				],
				"responses": {
					"200": {
						"description": "Array of project records",
						"schema": {
							"$ref": "#/definitions/project-list"
						}
					}
				}
			}
		},
		"/projects/{id}": {
			"get": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"parameters": [
					{
						"name": "id",
						"in": "path",
						"description": "Unique identifier for the project.",
						"required": true,
						"type": "integer"
					}
				],
				"tags": [
					"campaigns"
				],
				"summary": "List projects",
				"description": "Endpoint for details about a particular project along with the associated campaigns",
				"responses": {
					"200": {
						"description": "Project details record",
						"schema": {
							"$ref": "#/definitions/project-details"
						}
					}
				}
			}
		},
		"/sales": {
			"get": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "Sales list.",
				"description": "Returns the list of sales",
				"tags": [
					"sales"
				],
				"parameters": [
					{
						"name": "filters",
						"in": "query",
						"description": "Json encoded filter description. Valid filters include: 'id', 'state', 'created', 'lastModifiedTime', 'userId', 'leadId' and 'campaign'.",
						"required": false,
						"type": "string"
					},
					{
						"name": "includeMeta",
						"in": "query",
						"description": "Boolean telling if the query needs to return extended info, like pagination.",
						"required": false,
						"type": "string"
					},
					{
						"name": "sortProperty",
						"in": "query",
						"description": "Name of the column the generated query will be sorted by",
						"required": false,
						"type": "string",
						"enum": [
							"name"
						]
					},
					{
						"name": "sortDirection",
						"in": "query",
						"description": "The direction we want to sort for the 'sortProperty'.",
						"required": false,
						"type": "string",
						"enum": [
							"ASC",
							"DESC"
						]
					},
					{
						"name": "pageSize",
						"in": "query",
						"description": "How many rows should be returned for each page.",
						"required": false,
						"type": "integer"
					},
					{
						"name": "page",
						"in": "query",
						"description": "What page is currently being viewed. If 'pageSize' have been defined and not 'page', 1 will be assumed.",
						"required": false,
						"type": "integer"
					}
				],
				"responses": {
					"200": {
						"description": "An array of sales.",
						"schema": {
							"type": "array",
							"items": {
								"$ref": "#/definitions/sales"
							}
						}
					},
					"401": {
						"description": "Unauthorized",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"500": {
						"description": "Unexpected error",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			}
		},
		"/sales/{id}": {
			"get": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "Specific sale",
				"description": "Returns information about a specific sale.",
				"parameters": [
					{
						"name": "id",
						"in": "path",
						"description": "Unique identifier for a sale.",
						"required": true,
						"type": "integer"
					}
				],
				"tags": [
					"sales"
				],
				"responses": {
					"200": {
						"description": "Sales object.",
						"schema": {
							"$ref": "#/definitions/sales"
						}
					},
					"400": {
						"description": "Bad input",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"401": {
						"description": "Unauthorized",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"403": {
						"description": "Forbidden",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"404": {
						"description": "Resource not found",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"500": {
						"description": "Unexpected error",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			}
		},
		"/products": {
			"get": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "Products list.",
				"description": "Returns a list of products for an authenticated client.",
				"parameters": [
					{
						"name": "filters",
						"in": "query",
						"description": "Json encoded filter description. Valid filter property is 'id', 'title' and 'unitPrice'",
						"required": false,
						"type": "string"
					},
					{
						"name": "includeMeta",
						"in": "query",
						"description": "Boolean telling if the query needs to return extended info, like pagination.",
						"required": false,
						"type": "string"
					},
					{
						"name": "sortProperty",
						"in": "query",
						"description": "Name of the column the generated query will be sorted by",
						"required": false,
						"type": "string",
						"enum": [
							"name"
						]
					},
					{
						"name": "sortDirection",
						"in": "query",
						"description": "The direction we want to sort for the 'sortProperty'.",
						"required": false,
						"type": "string",
						"enum": [
							"ASC",
							"DESC"
						]
					},
					{
						"name": "pageSize",
						"in": "query",
						"description": "How many rows should be returned for each page.",
						"required": false,
						"type": "integer"
					},
					{
						"name": "page",
						"in": "query",
						"description": "What page is currently being viewed. If 'pageSize' have been defined and not 'page', 1 will be assumed.",
						"required": false,
						"type": "integer"
					}
				],
				"tags": [
					"products"
				],
				"responses": {
					"200": {
						"description": "An array of products.",
						"schema": {
							"type": "array",
							"items": {
								"$ref": "#/definitions/products"
							}
						}
					},
					"401": {
						"description": "Unauthorized",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"500": {
						"description": "Unexpected error",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			},
			"post": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "Create product.",
				"description": "Create a new Product.",
				"parameters": [
					{
						"name": "title",
						"in": "query",
						"description": "Name of the new product.",
						"required": true,
						"type": "string"
					},
					{
						"name": "description",
						"in": "query",
						"description": "The description for the new product.",
						"required": false,
						"type": "string"
					},
					{
						"name": "unitPrice",
						"in": "query",
						"description": "The price for each unit of the new product.",
						"required": true,
						"type": "decimal"
					},
					{
						"name": "unit",
						"in": "query",
						"description": "Speification of the unit, m, kilograms, pounds, weeks, etc.",
						"required": false,
						"type": "string"
					},
					{
						"name": "minimumQuantity",
						"in": "query",
						"description": "the lowest amount of the product which can be sold at once.",
						"required": false,
						"type": "number"
					},
					{
						"name": "maximumQuantity",
						"in": "query",
						"description": "The highest amount of the product, which can be sold at once. Can't be lower than the amount set by minimumQuantity, if any.",
						"required": false,
						"type": "number"
					},
					{
						"name": "provision",
						"in": "query",
						"description": "The provision earned by the agent, from selling the specific product",
						"required": false,
						"type": "decimal"
					},
					{
						"name": "currency",
						"in": "query",
						"description": "The currency, which the price are listed in. Using 3 letters ISO format.",
						"required": true,
						"type": "string"
					},
					{
						"name": "externalId",
						"in": "query",
						"description": "If the product is connected to an external ID, it can be entered here.",
						"required": false,
						"type": "number"
					},
					{
						"name": "allowNote",
						"in": "query",
						"description": "If the agent are allowed to leave a note on the product during sale",
						"required": false,
						"type": "boolean"
					},
					{
						"name": "parentId",
						"in": "query",
						"description": "If the product should be an Addon, for an existing product. Note you can't add a product to another Addon.",
						"required": false,
						"type": "number"
					}
				],
				"tags": [
					"products"
				],
				"responses": {
					"201": {
						"description": "Product object.",
						"schema": {
							"$ref": "#/definitions/products_create"
						}
					},
					"400": {
						"description": "Bad input",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"401": {
						"description": "Unauthorized",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"403": {
						"description": "Forbidden",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"404": {
						"description": "Resource not found",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"500": {
						"description": "Unexpected error",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			}
		},
		"/products/{id}": {
			"get": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "Specific product.",
				"description": "Returns information about a specific product.",
				"parameters": [
					{
						"name": "id",
						"in": "path",
						"description": "Unique identifier for a product.",
						"required": true,
						"type": "integer"
					}
				],
				"tags": [
					"products"
				],
				"responses": {
					"200": {
						"description": "Product object.",
						"schema": {
							"$ref": "#/definitions/products"
						}
					},
					"400": {
						"description": "Bad input",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"401": {
						"description": "Unauthorized",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"403": {
						"description": "Forbidden",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"404": {
						"description": "Resource not found",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"500": {
						"description": "Unexpected error",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			},
			"patch": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "Update product.",
				"description": "Update an existing product.",
				"parameters": [
					{
						"name": "id",
						"in": "path",
						"description": "Unique identifier for a product.",
						"required": true,
						"type": "integer"
					},
					{
						"name": "title",
						"in": "query",
						"description": "Name of the new product.",
						"required": false,
						"type": "string"
					},
					{
						"name": "description",
						"in": "query",
						"description": "The description for the new product.",
						"required": false,
						"type": "string"
					},
					{
						"name": "unitPrice",
						"in": "query",
						"description": "The price of one unit of the product.",
						"required": false,
						"type": "decimal"
					},
					{
						"name": "unit",
						"in": "query",
						"description": "Type of unit the product is based in. E.g: months, litres, meters, feet",
						"required": false,
						"type": "number"
					},
					{
						"name": "minimumQuantity",
						"in": "query",
						"description": "the lowest amount of the product which can be sold at once.",
						"required": false,
						"type": "number"
					},
					{
						"name": "maximumQuantity",
						"in": "query",
						"description": "The highest amount of the product, which can be sold at once. Can't be lower than the amount set by minimumQuantity, if any.",
						"required": false,
						"type": "number"
					},
					{
						"name": "provision",
						"in": "query",
						"description": "The provision earned by the agent, from selling the specific product",
						"required": false,
						"type": "decimal"
					},
					{
						"name": "currency",
						"in": "query",
						"description": "The currency, which the price are listed in. Using 3 letters ISO format.",
						"required": false,
						"type": "string"
					},
					{
						"name": "externalId",
						"in": "query",
						"description": "If the product is connected to an external ID, it can be entered here.",
						"required": false,
						"type": "number"
					},
					{
						"name": "allowNote",
						"in": "query",
						"description": "If the agent are allowed to leave a note on the product during sale",
						"required": false,
						"type": "boolean"
					},
					{
						"name": "parentId",
						"in": "query",
						"description": "If the product should be an Addon, for an existing product. Note you can't add a product to another Addon.",
						"required": false,
						"type": "number"
					}
				],
				"tags": [
					"products"
				],
				"responses": {
					"201": {
						"description": "Product object.",
						"schema": {
							"$ref": "#/definitions/products_create"
						}
					},
					"400": {
						"description": "Bad input",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"401": {
						"description": "Unauthorized",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"403": {
						"description": "Forbidden",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"404": {
						"description": "Resource not found",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"500": {
						"description": "Unexpected error",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			},
			"delete": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "Delete product.",
				"description": "Deleting an existing product.\nCan't delete a product with an active addon.",
				"parameters": [
					{
						"name": "id",
						"in": "path",
						"description": "Unique identifier for a product.",
						"required": true,
						"type": "integer"
					}
				],
				"tags": [
					"products"
				],
				"responses": {
					"200": {
						"description": "Product object.",
						"schema": {
							"$ref": "#/definitions/product_deleted"
						}
					},
					"404": {
						"description": "Product not found",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"500": {
						"description": "Unexpected error",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			}
		},
		"/sms": {
			"get": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "List of SMS",
				"description": "Returns information of registered in- and outbound text messages, optionally filtered by a query parameter",
				"parameters": [
					{
						"name": "filters",
						"in": "query",
						"description": "JSON encoded parameters for filtering records. Valid filter properties include 'type', 'timestamp', 'sender', 'receiver', 'userId', 'leadId' and 'campaignId'",
						"required": false,
						"type": "string"
					},
					{
						"name": "page",
						"in": "query",
						"description": "Pagination page index",
						"required": false,
						"type": "integer"
					},
					{
						"name": "pageSize",
						"in": "query",
						"description": "Pagination page size",
						"required": false,
						"type": "integer"
					},
					{
						"name": "includeMeta",
						"in": "query",
						"description": "Include pagination information in the generated response",
						"required": false,
						"type": "boolean"
					},
					{
						"name": "sortProperty",
						"in": "query",
						"description": "Property used for ordering records",
						"required": false,
						"type": "string",
						"enum": [
							"id",
							"type",
							"timestamp",
							"sender",
							"receiver",
							"content",
							"units",
							"userId",
							"leadId",
							"campaignId",
							"status"
						]
					}
				],
				"tags": [
					"sms"
				],
				"responses": {
					"200": {
						"description": "SMS object",
						"schema": {
							"$ref": "#/definitions/sms"
						}
					},
					"400": {
						"description": "Bad input",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"401": {
						"description": "Unauthorized",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"403": {
						"description": "Forbidden",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"404": {
						"description": "Resource not found",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"500": {
						"description": "Unexpected error",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			}
		},
		"/sms/{id}": {
			"get": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "Specific SMS",
				"description": "Returns information of a specific text message",
				"parameters": [
					{
						"name": "id",
						"in": "path",
						"description": "Unique identifier for an SMS.",
						"required": true,
						"type": "integer"
					}
				],
				"tags": [
					"sms"
				],
				"responses": {
					"200": {
						"description": "SMS object",
						"schema": {
							"$ref": "#/definitions/sms"
						}
					},
					"400": {
						"description": "Bad input",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"401": {
						"description": "Unauthorized",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"403": {
						"description": "Forbidden",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"404": {
						"description": "Resource not found",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"500": {
						"description": "Unexpected error",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			}
		},
		"/notes": {
			"get": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "List of notes",
				"description": "Returns notes of the leads, optionally filtered and/or by a query parameter",
				"parameters": [
					{
						"name": "filters",
						"in": "query",
						"description": "JSON encoded parameters for filtering records. Valid filter properties include 'note', 'userid', 'leadid', 'timestamp', 'sessionid'",
						"required": false,
						"type": "string"
					},
					{
						"name": "page",
						"in": "query",
						"description": "Pagination page index",
						"required": false,
						"type": "integer"
					},
					{
						"name": "pageSize",
						"in": "query",
						"description": "Pagination page size",
						"required": false,
						"type": "integer"
					},
					{
						"name": "includeMeta",
						"in": "query",
						"description": "Include pagination information in the generated response",
						"required": false,
						"type": "boolean"
					},
					{
						"name": "sortProperty",
						"in": "query",
						"description": "Property used for ordering records",
						"required": false,
						"type": "string",
						"enum": [
							"note",
							"userid",
							"leadid",
							"timestamp",
							"sessionid"
						]
					}
				],
				"tags": [
					"notes"
				],
				"responses": {
					"200": {
						"description": "Note object",
						"schema": {
							"$ref": "#/definitions/note"
						}
					},
					"400": {
						"description": "Bad input",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			}
		},
		"/notes/{id}": {
			"get": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "Specific note",
				"description": "Returns information of a specific note",
				"parameters": [
					{
						"name": "id",
						"in": "path",
						"description": "Unique identifier for a note.",
						"required": true,
						"type": "integer"
					}
				],
				"tags": [
					"notes"
				],
				"responses": {
					"200": {
						"description": "Note object",
						"schema": {
							"$ref": "#/definitions/note"
						}
					},
					"404": {
						"description": "Resource not found",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			}
		},
		"/recordings": {
			"get": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "List of recordings",
				"description": "Returns recordings and recording-clips ordered by, and optionally filtered by upload time. This is the recommended way to export recordings to a media archive.",
				"parameters": [
					{
						"name": "filters",
						"in": "query",
						"description": "JSON encoded parameters for filtering records. Valid filter properties include 'timestamp'",
						"required": false,
						"type": "string"
					},
					{
						"name": "page",
						"in": "query",
						"description": "Pagination page index",
						"required": false,
						"type": "integer"
					},
					{
						"name": "pageSize",
						"in": "query",
						"description": "Pagination page size",
						"required": false,
						"type": "integer"
					},
					{
						"name": "includeMeta",
						"in": "query",
						"description": "Include pagination information in the generated response",
						"required": false,
						"type": "boolean"
					}
				],
				"tags": [
					"recordings"
				],
				"responses": {
					"200": {
						"description": "Response body",
						"schema": {
							"type": "object",
							"properties": {
								"recordings": {
									"type": "array",
									"items": {
										"type": "object",
										"$ref": "#/definitions/recording"
									}
								}
							}
						}
					}
				},
				"400": {
					"description": "Bad input",
					"schema": {
						"$ref": "#/definitions/error"
					}
				}
			}
		},
		"/recording-clips": {
			"get": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "List of recording clips",
				"description": "Returns recording-clips, optionally filtered by time.",
				"parameters": [
					{
						"name": "filters",
						"in": "query",
						"description": "JSON encoded parameters for filtering records. Valid filter properties include 'timestamp'",
						"required": false,
						"type": "string"
					},
					{
						"name": "page",
						"in": "query",
						"description": "Pagination page index",
						"required": false,
						"type": "integer"
					},
					{
						"name": "pageSize",
						"in": "query",
						"description": "Pagination page size",
						"required": false,
						"type": "integer"
					},
					{
						"name": "includeMeta",
						"in": "query",
						"description": "Include pagination information in the generated response",
						"required": false,
						"type": "boolean"
					}
				],
				"tags": [
					"recordings"
				],
				"responses": {
					"200": {
						"description": "Returns a list of recording clips",
						"produces": [
							"application/jsonl"
						],
						"schema": {
							"type": "object",
							"properties": {
								"recording-clips": {
									"type": "array",
									"items": {
										"type": "object",
										"$ref": "#/definitions/recording-clips"
									}
								}
							}
						}
					},
					"400": {
						"description": "Bad request",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			}
		},
		"/pause-reasons": {
			"get": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "Pause reason list",
				"description": "Returns the pause reasons configured for the authenticated client. Use this to resolve the pauseReasonId field returned by /workforce/buildReport into a human readable name.",
				"parameters": [
					{
						"name": "filters",
						"in": "query",
						"description": "Json encoded filter description. Valid filter properties include 'id', 'name', 'active', 'createdTime' and 'lastModifiedTime'",
						"required": false,
						"type": "string"
					},
					{
						"name": "includeMeta",
						"in": "query",
						"description": "Boolean telling if the query needs to return extended info, like pagination.",
						"required": false,
						"type": "string"
					},
					{
						"name": "sortProperty",
						"in": "query",
						"description": "Name of the column the generated query will be sorted by",
						"required": false,
						"type": "string",
						"enum": [
							"id",
							"name",
							"active",
							"createdTime",
							"lastModifiedTime"
						]
					},
					{
						"name": "sortDirection",
						"in": "query",
						"description": "The direction we want to sort for the 'sortProperty'.",
						"required": false,
						"type": "string",
						"enum": [
							"ASC",
							"DESC"
						]
					},
					{
						"name": "pageSize",
						"in": "query",
						"description": "How many rows should be returned for each page.",
						"required": false,
						"type": "integer"
					},
					{
						"name": "page",
						"in": "query",
						"description": "What page is currently being viewed. If 'pageSize' have been defined and not 'page', 1 will be assumed.",
						"required": false,
						"type": "integer"
					}
				],
				"tags": [
					"pause-reasons"
				],
				"responses": {
					"200": {
						"description": "The pause reasons for the authenticated client",
						"schema": {
							"type": "object",
							"properties": {
								"pauseReasons": {
									"type": "array",
									"items": {
										"$ref": "#/definitions/pauseReasons"
									}
								},
								"meta": {
									"type": "object",
									"description": "Only present when includeMeta is true"
								}
							}
						}
					},
					"401": {
						"description": "Unauthorized",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"500": {
						"description": "Unexpected error",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			}
		},
		"/workforce/buildReport": {
			"post": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "List user activity",
				"description": "Returns list of user activity in secounds based on events, users or campaigns",
				"parameters": [
					{
						"name": "start",
						"in": "body",
						"description": "Start timestamp for activities",
						"example": "2016-08-08T07:33:02Z",
						"required": true,
						"type": "date-time"
					},
					{
						"name": "end",
						"in": "body",
						"description": "End timestamp for activities",
						"example": "2016-08-08T07:38:43Z",
						"required": true,
						"type": "date-time"
					},
					{
						"name": "groupBy",
						"in": "body",
						"description": "Additional dimensions to group the report by, on top of campaign, user and activity. Accepts two kinds of values, which may be combined:\n- Time interval - one of 'hour', 'day', 'week', 'month' or 'year'. Buckets each row into that interval (evaluated in the 'tz' timezone) and adds a timestamp field marking the start of the bucket to each row. At most one time interval may be given.\n- 'pause-reason' - additionally groups by pause reason and adds a pauseReasonId field to each row (see /pause-reasons for the id-to-name mapping); pauseReasonId is null for rows whose activity isn't 'paused'.\n\nA single string is also accepted for backwards compatibility and is treated the same as a one-element array.",
						"required": false,
						"type": "array",
						"items": {
							"type": "string",
							"enum": [
								"hour",
								"day",
								"week",
								"month",
								"year",
								"pause-reason"
							]
						},
						"example": ["day", "pause-reason"]
					},
					{
						"name": "tz",
						"in": "body",
						"description": "Group time on a specific time zone",
						"required": false,
						"type": "string"
					}
				],
				"tags": [
					"workforce"
				],
				"responses": {
					"200": {
						"description": "returns new import request",
						"produces": [
							"application/jsonl"
						],
						"schema": {
							"type": "object",
							"example": [
								{
									"campaignid": null,
									"userid": 4,
									"activity": "online",
									"pauseReasonId": null,
									"duration": "420.20"
								},
								{
									"campaignid": 2,
									"userid": 4,
									"activity": "processing",
									"pauseReasonId": null,
									"duration": "13.337"
								},
								{
									"campaignid": 2,
									"userid": 6,
									"activity": "paused",
									"pauseReasonId": 3,
									"duration": "13.337"
								}
							]
						}
					},
					"400": {
						"description": "Bad request",
						"schema": {
							"$ref": "#/definitions/error"
						}
					},
					"500": {
						"description": "Unexpected error",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			}
		},
		"/transcription-summaries": {
			"get": {
				"security": [
					{
						"basicAuth": []
					}
				],
				"summary": "List of transcription summaries",
				"description": "Returns a list of transcription summaries",
				"parameters": [
					{
						"name": "filters",
						"in": "query",
						"description": "JSON encoded parameters for filtering records. Valid filter properties include 'timestamp' & 'leadId'",
						"required": false,
						"type": "string"
					},
					{
						"name": "page",
						"in": "query",
						"description": "Pagination page index",
						"required": false,
						"type": "integer"
					},
					{
						"name": "pageSize",
						"in": "query",
						"description": "Pagination page size",
						"required": false,
						"type": "integer"
					},
					{
						"name": "includeMeta",
						"in": "query",
						"description": "Include pagination information in the generated response",
						"required": false,
						"type": "boolean"
					}
				],
				"tags": [
					"transcription-summaries"
				],
				"responses": {
					"200": {
						"description": "Returns a list of transcription summaries",
						"produces": [
							"application/jsonl"
						],
						"schema": {
							"type": "object",
							"properties": {
								"summaries": {
									"type": "array",
									"items": {
										"type": "object",
										"$ref": "#/definitions/transcription-summary"
									}
								}
							}
						}
					},
					"400": {
						"description": "Bad request",
						"schema": {
							"$ref": "#/definitions/error"
						}
					}
				}
			}
		}
	},
	"definitions": {
		"workforce": {
			"type": "object",
			"properties": {
				"start ": {
					"type": "date-time",
					"example": "2022-07-21T17:32:28Z",
					"description": "Start timestamp for activities"
				},
				"end ": {
					"type": "date-time",
					"example": "2022-07-22T17:32:28Z",
					"description": "End timestamp for activities",
					"required": true
				},
				"groupBy": {
					"description": "Optional - group entries to time intervals",
					"type": "string",
					"enum": [
						"hour",
						"day",
						"week",
						"month",
						"year"
					],
					"required": true
				},
				"tz": {
					"description": "Optional - group time entries to specific time zone. Defaults to UTC",
					"type": "string",
					"example": "Europe/Copenhagen",
					"required": false
				}
			}
		},
		"imports": {
			"type": "object",
			"properties": {
				"poolId": {
					"type": "integer",
					"example": 3,
					"description": "Unique identifier representing a specific campaign"
				},
				"match": {
					"type": "object",
					"properties": {
						"fields": {
							"type": "array",
							"description": "Array of headerIds",
							"items": {
								"type": "integer",
								"example": "3, 5, 123"
							}
						},
						"blacklist": {
							"type": "array",
							"description": "Array of poolIds",
							"items": {
								"type": "integer",
								"example": "42, 42"
							}
						}
					}
				},
				"callbackUrl": {
					"type": "string",
					"description": "Redirect to this URL when imports finish || notify when finished",
					"example": "/bank-leads"
				},
				"updatefields": {
					"type": "array",
					"items": {
						"type": "integer",
						"description": "Merge data from these fields",
						"example": [
							5,
							4
						]
					}
				},
				"insert_key_value": {
					"type": "array",
					"items": {
						"type": "object",
						"properties": {
							"key": {
								"type": "integer",
								"example": 1432,
								"description": "Key for headingId"
							},
							"value": {
								"type": "string",
								"example": "John",
								"description": "Value matching the key"
							}
						}
					}
				},
				"resultFields": {
					"type": "array",
					"items": {
						"type": "object",
						"properties": {
							"id": {
								"type": "integer",
								"example": 1,
								"description": "id for created import request"
							},
							"state": {
								"type": "string",
								"example": "init || running || done",
								"description": "state of the import request"
							},
							"contacts": {
								"type": "integer",
								"example": 2,
								"description": "amount of contacts waiting for request to be executed"
							},
							"inserted": {
								"type": "integer",
								"example": 2,
								"description": "amount of contacts added to the import request"
							},
							"total": {
								"type": "integer",
								"example": 4,
								"description": "total amount of contacts in the import request"
							}
						}
					}
				}
			}
		},
		"campaigns": {
			"type": "object",
			"properties": {
				"id": {
					"type": "integer",
					"example": 123,
					"description": "Unique identifier representing a bankgroup id"
				},
				"settings": {
					"type": "object",
					"properties": {
						"name": {
							"type": "string",
							"example": "Campaign name",
							"description": "Campaign name"
						},
						"visible": {
							"example": true,
							"type": "boolean",
							"description": "Campaign visible in agents overview"
						},
						"record": {
							"example": false,
							"type": "boolean",
							"description": "Calls are recorded"
						},
						"active": {
							"example": true,
							"type": "boolean",
							"description": "Campaign is active"
						},
						"projectId": {
							"example": true,
							"type": "integer",
							"description": "Unique identifier for the project the campaign belongs to or null if the campaign is not associated with a project"
						}
					}
				},
				"masterFields": {
					"type": "array",
					"description": "masterData are releated to a specific data field",
					"items": {
						"type": "object",
						"properties": {
							"id": {
								"type": "integer",
								"example": 1,
								"description": "id for related data field"
							},
							"type": {
								"type": "string",
								"example": "text",
								"description": "Possible values; text, textarea"
							},
							"editable": {
								"type": "boolean",
								"example": true
							},
							"active": {
								"type": "boolean",
								"example": true
							}
						}
					}
				},
				"resultFields": {
					"type": "array",
					"items": {
						"type": "object",
						"properties": {
							"id": {
								"type": "integer",
								"example": 1,
								"description": "id for related data field"
							},
							"type": {
								"type": "string",
								"example": "select",
								"description": "text, textarea or select"
							},
							"active": {
								"type": "boolean",
								"example": true
							},
							"options": {
								"type": "array",
								"description": "If type is select",
								"items": {
									"type": "string",
									"example": "Option 1"
								}
							}
						}
					}
				},
				"campaignFields": {
					"type": "array",
					"items": {
						"type": "object",
						"properties": {
							"id": {
								"type": "integer",
								"example": 1,
								"description": "id for related data field"
							},
							"name": {
								"type": "string",
								"example": "Campaign field name",
								"description": "Campaign field name"
							},
							"value": {
								"type": "string",
								"example": "Field value",
								"description": "Value of a campaign field"
							}
						}
					}
				}
			}
		},
		"leads": {
			"type": "object",
			"properties": {
				"id": {
					"type": "integer",
					"example": 123,
					"description": "Unique identifier for lead"
				},
				"campaignId": {
					"type": "integer",
					"example": 456,
					"description": "Unique identifier for parent campaign"
				},
				"contactAttempts": {
					"type": "integer",
					"example": 2,
					"description": "Number of attempts to contact lead"
				},
				"lastModifiedTime": {
					"type": "string",
					"example": "2016-06-22T09:34:49Z",
					"description": "DateTime of last contact"
				},
				"nextContactTime": {
					"type": "string",
					"example": "2016-06-27T11:17:32Z",
					"description": "DateTime of next planned contact"
				},
				"importedTime": {
					"type": "string",
					"example": "2016-06-22T09:34:49Z",
					"description": "DateTime of import for contact"
				},
				"lastContactedBy": {
					"type": "integer",
					"example": 1823,
					"description": "User id of the agent who last contacted lead"
				},
				"status": {
					"type": "string",
					"example": "success",
					"description": "Lead closure status. Possible values are; new, success, notInterested, unqualified, invalid, automaticRedial, privateRedial, unknown"
				},
				"active": {
					"type": "boolean",
					"example": true,
					"description": "Lead is active"
				},
				"externalId": {
					"type": "integer",
					"example": "1",
					"description": "Id from another application"
				},
				"importId": {
					"type": "integer",
					"example": "1",
					"description": "The import id of the lead"
				},
				"masterData": {
					"type": "array",
					"items": {
						"type": "object",
						"properties": {
							"id": {
								"type": "integer",
								"example": 1
							},
							"value": {
								"type": "string",
								"example": "+45 86 3000 86"
							}
						}
					}
				},
				"resultData": {
					"type": "array",
					"items": {
						"type": "object",
						"properties": {
							"id": {
								"type": "integer",
								"example": 1
							},
							"value": {
								"type": "string",
								"example": "Option 2"
							}
						}
					}
				}
			}
		},
		"lead": {
			"type": "object",
			"properties": {
				"campaignId": {
					"type": "integer",
					"example": 456,
					"description": "Unique identifier for parent campaign"
				},
				"contactAttempts": {
					"type": "integer",
					"example": 1,
					"description": "Number of attempts to contact lead"
				},
				"lastModifiedTime": {
					"type": "string",
					"example": "2016-06-22T09:34:49Z",
					"description": "DateTime of last contact"
				},
				"nextContactTime": {
					"type": "string",
					"example": "2016-06-27T11:17:32Z",
					"description": "DateTime of next planned contact"
				},
				"lastContactedBy": {
					"type": "integer",
					"example": 1823,
					"description": "User id of the agent who last contacted lead"
				},
				"poolId": {
					"type": "integer",
					"example": 123,
					"description": "Lead pool id"
				},
				"status": {
					"type": "string",
					"example": "success",
					"description": "Lead closure status. Possible values are; new, success, notInterested, unqualified, invalid, automaticRedial, privateRedial, unknown"
				},
				"active": {
					"type": "boolean",
					"example": true,
					"description": "Lead is active"
				},
				"externalId": {
					"type": "integer",
					"example": "1",
					"description": "Id from another application"
				},
				"segmentId": {
					"description": "Unique identifier for the campaign segment. Can only be provided if the campaign's segment type is user or manual",
					"type": "integer"
				},
				"masterData": {
					"type": "array",
					"description": "masterData are releated to a specific data field",
					"items": {
						"type": "object",
						"properties": {
							"id": {
								"description": "Related field id",
								"type": "integer",
								"example": 1
							},
							"value": {
								"type": "string",
								"example": "+45 86 3000 86"
							}
						}
					}
				},
				"resultData": {
					"type": "array",
					"description": "resultData are releated to a specific data field",
					"items": {
						"type": "object",
						"properties": {
							"id": {
								"description": "Related field id",
								"type": "integer",
								"example": 1
							},
							"value": {
								"type": "string",
								"example": "Option 2"
							}
						}
					}
				}
			}
		},
		"sessions": {
			"type": "object",
			"properties": {
				"id": {
					"type": "integer",
					"description": "Unique identifier representing a specific sessions",
					"example": 129389
				},
				"leadId": {
					"type": "integer",
					"description": "Id of related lead",
					"example": 204179331
				},
				"userId": {
					"type": "integer",
					"description": "Id of related user",
					"example": 1923
				},
				"campaignId": {
					"type": "integer",
					"description": "Id of related campaign",
					"example": 6564
				},
				"startTime": {
					"type": "string",
					"description": "Start time of session",
					"example": "2016-08-08T07:33:02Z"
				},
				"endTime": {
					"type": "string",
					"description": "End time of session",
					"example": "2016-08-08T07:38:43Z"
				},
				"lastUpdatedTime": {
					"type": "string",
					"description": "Last updated timestamp for session",
					"example": "2016-08-08T07:38:43Z"
				},
				"status": {
					"type": "string",
					"description": "Session status. Possible values are; new, automaticRedial, privateRedial, notInterested, success, invalid, unqualified and unknown",
					"example": "automaticRedial"
				},
				"sessionSeconds": {
					"type": "integer",
					"description": "The duration of the session",
					"example": 42
				},
				"cdr": {
					"type": "object",
					"properties": {
						"destination": {
							"type": "integer",
							"example": "004586300086"
						},
						"startTime": {
							"type": "string",
							"example": "2016-08-08T07:38:43Z"
						},
						"answerTime": {
							"type": "string",
							"example": "2016-08-08T07:38:58Z"
						},
						"endTime": {
							"type": "string",
							"example": "2016-08-08T07:40:58Z"
						},
						"durationSeconds": {
							"type": "integer",
							"example": 120
						},
						"disposition": {
							"type": "string",
							"example": "answered",
							"description": "Possible values are; answered, noAnswer, busy, fail"
						}
					}
				}
			}
		},
		"create-user": {
			"type": "object",
			"properties": {
				"name": {
					"type": "string",
					"example": "Peter Petersen"
				},
				"displayName": {
					"type": "string",
					"example": "Peter"
				},
				"email": {
					"type": "string",
					"example": "support@adversus.dk"
				},
				"phone": {
					"type": "string",
					"example": 4586300086
				},
				"dialtone": {
					"type": "boolean",
					"example": true
				},
				"locale": {
					"type": "string",
					"enum": [
						"da_DK",
						"sv_SE"
					]
				}
			}
		},
		"user-partial": {
			"type": "object",
			"properties": {
				"name": {
					"type": "string",
					"example": "Peter Petersen"
				},
				"displayName": {
					"type": "string",
					"example": "Peter"
				},
				"email": {
					"type": "string",
					"example": "support@adversus.dk"
				},
				"phone": {
					"type": "string",
					"example": 4586300086
				},
				"locale": {
					"type": "string",
					"enum": [
						"da_DK",
						"sv_SE"
					]
				}
			}
		},
		"users": {
			"type": "object",
			"properties": {
				"id": {
					"type": "integer",
					"example": 123
				},
				"name": {
					"type": "string",
					"example": "Peter Petersen"
				},
				"displayName": {
					"type": "string",
					"example": "Peter"
				},
				"active": {
					"type": "boolean",
					"example": true
				},
				"admin": {
					"type": "boolean",
					"example": false
				},
				"phone": {
					"type": "string",
					"example": 4586300086
				},
				"email": {
					"type": "string",
					"example": "support@adversus.dk"
				},
				"locale": {
					"type": "string",
					"example": "da_DK"
				},
				"timezone": {
					"type": "string",
					"example": "Europe/Copenhagen"
				},
				"memberOf": {
					"type": "array",
					"items": {
						"$ref": "#/definitions/team"
					}
				},
				"role": {
					"$ref": "#/definitions/role"
				},
				"group": {
					"$ref": "#/definitions/group"
				},
				"profileUrl": {
					"type": "string",
					"example": "https://adversus.io/local-cloud/s3/adversus-profiles/image.png"
				}
			}
		},
		"team": {
			"type": "object",
			"properties": {
				"id": {
					"type": "integer",
					"example": 42
				},
				"name": {
					"type": "string",
					"example": "Team A"
				}
			}
		},
		"role": {
			"type": "object",
			"properties": {
				"id": {
					"type": "integer",
					"example": 42
				},
				"name": {
					"type": "string",
					"example": "Team leader"
				}
			}
		},
		"group": {
			"type": "object",
			"properties": {
				"id": {
					"type": "integer",
					"example": 42
				},
				"name": {
					"type": "string",
					"example": "Division B"
				}
			}
		},
		"pools": {
			"type": "object",
			"properties": {
				"id": {
					"type": "integer"
				},
				"name": {
					"type": "string"
				},
				"created": {
					"type": "string"
				},
				"active": {
					"type": "boolean"
				}
			}
		},
		"pauseReasons": {
			"type": "object",
			"properties": {
				"id": {
					"type": "integer",
					"example": 3
				},
				"name": {
					"type": "string",
					"example": "Lunch break"
				},
				"active": {
					"type": "boolean"
				},
				"createdTime": {
					"type": "string"
				},
				"lastModifiedTime": {
					"type": "string"
				}
			}
		},
		"appointments": {
			"type": "object",
			"properties": {
				"id": {
					"type": "integer",
					"example": 1
				},
				"leadId": {
					"type": "integer",
					"example": 203332081
				},
				"userId": {
					"type": "integer",
					"example": 3213
				},
				"consultantId": {
					"type": "integer",
					"example": 2323
				},
				"start": {
					"type": "string",
					"description": "Appointment start time",
					"example": "2016-08-08T07:00:00Z"
				},
				"end": {
					"type": "string",
					"description": "Appointment end time",
					"example": "2016-08-08T09:00:00Z"
				},
				"status": {
					"type": "string",
					"description": "Possible values are: 'none', 'held', 'postponed', 'cancelled'",
					"example": "held"
				}
			}
		},
		"mailActivity": {
			"type": "object",
			"properties": {
				"id": {
					"type": "integer",
					"example": 1
				},
				"messageId": {
					"type": "integer",
					"example": 2
				},
				"campaignId": {
					"type": "integer",
					"example": 3
				},
				"leadId": {
					"type": "integer",
					"example": 4
				},
				"userId": {
					"type": "integer",
					"example": 5
				},
				"event": {
					"type": "string",
					"description": "Email event. CFor example open, send, delivered, etc. ",
					"example": "send"
				},
				"sender": {
					"type": "string",
					"description": "The sender of the email",
					"example": "John Smith"
				},
				"received": {
					"type": "string",
					"description": "The sender of the email",
					"example": "Albert Einstein"
				},
				"subject": {
					"type": "string",
					"description": "The subject of the email. Only returned if the event of the email is 'send'",
					"example": "Subject"
				},
				"content": {
					"type": "string",
					"description": "The content of the email. Only returned if the event of the email is 'send'",
					"example": "Example of the content"
				},
				"timestamp": {
					"type": "string",
					"description": "Tiemstamp of when the action was performed in UTC format",
					"example": "2020-08-08T09:00:00Z"
				}
			}
		},
		"fields": {
			"type": "object",
			"properties": {
				"id": {
					"type": "integer"
				},
				"name": {
					"type": "string"
				},
				"type": {
					"type": "string",
					"description": "Possible values are: 'text', 'float', 'datetime'"
				}
			}
		},
		"fieldsMapping": {
			"type": "object",
			"properties": {
				"id": {
					"type": "integer"
				},
				"name": {
					"type": "string",
					"description": "The name of the field mapping"
				},
				"mappings": {
					"type": "object",
					"description": "An object of key value pairs where the key is the adversus field ID and the value is the external ID"
				}
			},
			"lastUpdated": {
				"type": "string",
				"example": "2016-08-08T09:10:00Z",
				"description": "The last time the fields mapping was updated in UTC format"
			}
		},
		"webhooks": {
			"type": "object",
			"properties": {
				"id": {
					"type": "integer"
				},
				"event": {
					"type": "string"
				},
				"template": {
					"type": "object"
				},
				"url": {
					"type": "string"
				},
				"authKey": {
					"type": "string"
				},
				"created": {
					"type": "string"
				},
				"updated": {
					"type": "string"
				}
			}
		},
		"webhook": {
			"type": "object",
			"properties": {
				"event": {
					"type": "string",
					"description": "Event type which the webhook is registered for.",
					"enum": [
						"lead_saved",
						"call_ended",
						"callAnswered",
						"leadClosedSuccess",
						"leadClosedAutomaticRedial",
						"leadClosedPrivateRedial",
						"leadClosedNotInterested",
						"leadClosedInvalid",
						"leadClosedUnqualified",
						"leadClosedSystem",
						"leads_deactivated",
						"leads_inserted",
						"mail_activity",
						"sms_sent",
						"sms_received",
						"appointment_added",
						"appointment_updated",
						"note_added"
					]
				},
				"url": {
					"type": "string",
					"description": "URL of webhook 'endpoint'"
				},
				"authKey": {
					"type": "string",
					"description": "AuthKey set as GET parameter in request"
				},
				"template": {
					"type": "object",
					"description": "Template definition for webhooks that are extendable\n\nTemplates are specified as json objects containing merge-tags. The template will be merged with the lead-data when the webhook is emitted and the result will be contained within the output as the property data.\n\nMerge-tags are specified inside the json-template as substrings having the form [fieldId]. These will be substituted by the corresponding lead-data identified by the fieldId.\nCurrently only the webhook event lead_saved support the templating system.",
					"example": {
						"event": "adversus-saved-lead",
						"integrationId": "[1337]"
					}
				}
			}
		},
		"cdr": {
			"type": "object",
			"properties": {
				"id": {
					"type": "integer",
					"description": "Unique identifier for the call detail record"
				},
				"sessionId": {
					"type": "string",
					"description": "Id for the session which the call belongs to"
				},
				"userId": {
					"type": "string",
					"description": "Id for the user who initiated or responded to the call"
				},
				"campaignId": {
					"type": "string",
					"description": "Id for the campaign which the call is associated with"
				},
				"leadId": {
					"type": "string",
					"description": "Id for the lead which the call is associated with"
				},
				"durationSeconds": {
					"type": "string",
					"description": "Total duration for the call including the time required to setup and dial"
				},
				"conversationSeconds": {
					"type": "string",
					"description": "Duration of the call from the time it was answered till the call ended"
				},
				"source": {
					"type": "string",
					"description": "The originating number associated with the call"
				},
				"destination": {
					"type": "string",
					"description": "The number associated with the called party"
				},
				"disposition": {
					"type": "string",
					"description": "Call disposition can be used to distinguish whether the call answered connected or why it could not be answered or failed to connect",
					"enum": [
						"answered",
						"busy",
						"noAnswer",
						"failed",
						"congestion"
					]
				},
				"hangupCause": {
					"type": "string",
					"description": "The reason for ending the call"
				},
				"insertedTime": {
					"type": "string",
					"example": "2016-08-08T09:00:00Z",
					"description": "The time at which the call was logged."
				},
				"startTime": {
					"type": "string",
					"example": "2016-08-08T09:00:00Z",
					"description": "The time at which the call was started"
				},
				"answerTime": {
					"type": "string",
					"example": "2016-08-08T09:00:10Z",
					"description": "The time at which the call was answered"
				},
				"endTime": {
					"type": "string",
					"example": "2016-08-08T09:10:00Z",
					"description": "The time at which the call was ended"
				},
				"links": {
					"type": "object",
					"properties": {
						"recording": {
							"type": "string",
							"description": "Endpoint for retrieving a recording of the call if one such is available"
						}
					}
				}
			}
		},
		"call-entry": {
			"type": "object",
			"properties": {
				"id": {
					"type": "integer",
					"description": "Unique identifier for the call"
				},
				"campaignId": {
					"type": "integer",
					"description": "Identifier for the campaign this call is associated with"
				},
				"leadId": {
					"type": "integer",
					"description": "Identifier for the lead this call is associated with"
				},
				"contactId": {
					"type": "integer",
					"description": "Identifier for the contact this call is associated with"
				},
				"userId": {
					"type": "integer",
					"description": "Identifier for the user who handled the call"
				},
				"disposition": {
					"type": "string",
					"description": "Call outcome as recorded in the PBX (e.g. answered, no-answer, busy, fail, congestion)",
					"enum": [
						"answered",
						"busy",
						"no-answer",
						"failed",
						"congestion"
					]
				},
				"byeCause": {
					"type": "string",
					"description": "SIP cancel cause for the call"
				},
				"start": {
					"type": "string",
					"example": "2016-08-08T09:00:00Z",
					"description": "Time at which the call started (ISO 8601)"
				},
				"answer": {
					"type": "string",
					"example": "2016-08-08T09:00:05Z",
					"description": "Time at which the call was answered (ISO 8601)"
				},
				"connect": {
					"type": "string",
					"example": "2016-08-08T09:00:08Z",
					"description": "Time at which the call was connected to an agent (ISO 8601)"
				},
				"end": {
					"type": "string",
					"example": "2016-08-08T09:10:00Z",
					"description": "Time at which the call ended (ISO 8601)"
				},
				"number": {
					"type": "string",
					"description": "The contact phone number"
				},
				"extension": {
					"type": "string",
					"description": "The agent extension or DID used for the call"
				},
				"duration": {
					"type": "integer",
					"description": "Total call duration in seconds"
				},
				"queued": {
					"type": "integer",
					"description": "Seconds spent in queue (answered to connected)"
				},
				"billable": {
					"type": "integer",
					"description": "Billable seconds for the call"
				},
				"dialing": {
					"type": "integer",
					"description": "Seconds spent dialing (start to answered)"
				},
				"conversation": {
					"type": "integer",
					"description": "Seconds spent in conversation (connected to end)"
				},
				"sip": {
					"type": "string",
					"description": "SIP response code"
				},
				"origin": {
					"type": "string",
					"enum": [
						"inbound",
						"outbound"
					],
					"description": "Whether the call was inbound or outbound"
				},
				"anonymous": {
					"type": "string",
					"description": "Whether the caller number was anonymous"
				}
			}
		},
		"error": {
			"type": "object",
			"properties": {
				"code": {
					"type": "integer",
					"format": "int32"
				},
				"message": {
					"type": "string"
				}
			}
		},
		"id": {
			"type": "object",
			"properties": {
				"id": {
					"type": "integer",
					"example": 206587501,
					"format": "int32"
				}
			}
		},
		"project-list": {
			"type": "array",
			"items": {
				"$ref": "#/definitions/project"
			}
		},
		"project": {
			"type": "object",
			"properties": {
				"id": {
					"description": "Unique identifier for the project.",
					"type": "integer"
				},
				"name": {
					"description": "The name given to the project.",
					"type": "string"
				}
			}
		},
		"project-details": {
			"type": "object",
			"properties": {
				"id": {
					"description": "Unique identifier for the project.",
					"type": "integer"
				},
				"name": {
					"description": "The name given to the project.",
					"type": "string"
				},
				"campaigns": {
					"description": "Array of campaign identifiers",
					"type": "array",
					"items": {
						"description": "Unique identifier for campaign",
						"type": "number"
					}
				}
			}
		},
		"campaign-add-contact": {
			"type": "object",
			"properties": {
				"contactId": {
					"description": "Unique identifier for the contact.",
					"type": "integer"
				},
				"status": {
					"description": "Campaign status.",
					"type": "string",
					"enum": [
						"new",
						"automaticRedial",
						"privateRedial",
						"notInterested",
						"success",
						"invalid",
						"unqualified"
					]
				},
				"nextContactTime": {
					"description": "Specifies a datetime for when the next redial should occur. Only used for when status is automaticRedial, privateRedial or new",
					"type": "string"
				},
				"segmentId": {
					"description": "Unique identifier for the campaign segment. Can only be provided if the campaign's segment type is user or manual",
					"type": "string"
				}
			}
		},
		"campaign-add-contacts": {
			"type": "array",
			"items": {
				"type": "object",
				"properties": {
					"contactId": {
						"description": "Unique identifier for the contact.",
						"type": "integer"
					},
					"status": {
						"description": "Campaign status.",
						"type": "string",
						"enum": [
							"new",
							"automaticRedial",
							"privateRedial",
							"notInterested",
							"success",
							"invalid",
							"unqualified"
						]
					},
					"nextContactTime": {
						"description": "Specifies a datetime for when the next redial should occur. Only used for when status is automaticRedial, privateRedial or new",
						"type": "string"
					},
					"segmentId": {
						"description": "Unique identifier for the campaign segment. Can only be provided if the campaign's segment type is user or manual",
						"type": "string"
					}
				}
			}
		},
		"campaign-field-post": {
			"description": "List of campagin fields",
			"type": "array",
			"items": {
				"$ref": "#/definitions/campaign-field"
			}
		},
		"campaign-field": {
			"type": "object",
			"properties": {
				"name": {
					"description": "Name for campaign field",
					"type": "string"
				},
				"type": {
					"description": "Field type",
					"type": "string",
					"enum": [
						"string",
						"number"
					]
				}
			}
		},
		"campaign-field-result": {
			"type": "object",
			"properties": {
				"id": {
					"description": "Unique identifier for the campaign field.",
					"type": "integer"
				},
				"name": {
					"description": "Name for campaign field",
					"type": "string"
				},
				"type": {
					"description": "Field type",
					"type": "string",
					"enum": [
						"string",
						"number"
					]
				}
			}
		},
		"user-field": {
			"type": "object",
			"properties": {
				"name": {
					"description": "Name for user field",
					"type": "string"
				},
				"type": {
					"description": "Field type",
					"type": "string",
					"enum": [
						"string",
						"number"
					]
				}
			}
		},
		"user-field-result": {
			"type": "object",
			"properties": {
				"id": {
					"description": "Unique identifier for the user field.",
					"type": "integer"
				},
				"name": {
					"description": "Name for user field",
					"type": "string"
				},
				"type": {
					"description": "Field type",
					"type": "string",
					"enum": [
						"string",
						"number"
					]
				}
			}
		},
		"efficiency": {
			"type": "object",
			"properties": {
				"userId": {
					"description": "User id",
					"type": "integer"
				},
				"totalConversationSeconds": {
					"description": "Total time spent in conversation.",
					"type": "integer"
				},
				"totalWaitingSeconds": {
					"description": "Total time spent waiting for a call to connect",
					"type": "integer"
				},
				"totalPauseSeconds": {
					"description": "Total time spent processing leads between dials",
					"type": "integer"
				}
			}
		},
		"logintime": {
			"type": "object",
			"properties": {
				"loginSeconds": {
					"description": "Amount of seconds that the user has been logged in",
					"type": "integer"
				},
				"userId": {
					"description": "The users unique ID",
					"type": "integer"
				},
				"fromDate": {
					"description": "The date where the calculations starts",
					"type": "integer"
				},
				"toDate": {
					"description": "The date where til the calculations runs",
					"type": "integer"
				}
			}
		},
		"loginsession": {
			"type": "object",
			"properties": {
				"userId": {
					"description": "The users unique ID",
					"type": "integer"
				},
				"timestamp": {
					"description": "The time the user logged in",
					"type": "string",
					"example": "2026-01-12 06:01:29"
				},
				"expirationTime": {
					"description": "The time the login session expires",
					"type": "string",
					"example": "2026-01-12 16:10:43"
				},
				"licenseType": {
					"description": "The license type of the user",
					"type": "string",
					"example": "agent"
				}
			}
		},
		"organization": {
			"type": "object",
			"properties": {
				"id": {
					"description": "The organization unique id",
					"type": "integer"
				},
				"name": {
					"description": "The organization name.",
					"type": "string"
				}
			},
			"example": {
				"id": "1337",
				"name": "Wonderland Inc."
			}
		},
		"sales": {
			"type": "object",
			"properties": {
				"id": {
					"description": "The unique id of the sale",
					"type": "integer"
				},
				"campaignId": {
					"description": "The unique id of the associated campaign of the sale.",
					"type": "integer"
				},
				"leadId": {
					"description": "The unique id of associated lead to the sale.",
					"type": "integer"
				},
				"currency": {
					"description": "The currency of the sale was made in.",
					"type": "string"
				},
				"totalPrice": {
					"description": "The total price of the sale.",
					"type": "number"
				},
				"totalDiscount": {
					"description": "The total discount of the sale.",
					"type": "number"
				},
				"totalNetPrice": {
					"description": "The total net price of the sale.",
					"type": "number"
				},
				"totalProvision": {
					"description": "The total provision of the sale.",
					"type": "number"
				},
				"state": {
					"description": "Name of the state the sale is in. This value is joined from the sales_status-table.",
					"type": "string"
				},
				"ownedBy": {
					"description": "The unique id of the user who owns the sale",
					"type": "string"
				},
				"createdBy": {
					"description": "The unique id of the user who created the sale",
					"type": "string"
				},
				"createdTime": {
					"format": "date-time",
					"description": "The date in UTC when the sale was created",
					"type": "string",
					"example": "2024-01-15T14:00:00Z"
				},
				"lines": {
					"description": "List of sales_products associated with the sale.",
					"type": "array",
					"items": {
						"$ref": "#/definitions/sales_products"
					}
				}
			},
			"example": {
				"id": 1,
				"campaignid": 1,
				"leadid": 1,
				"currency": "DKK",
				"totalPrice": 624,
				"totalDiscount": 0,
				"totalNetPrice": 624,
				"totalProvision": 19,
				"state": "created",
				"ownedBy": "2",
				"createdBy": "2",
				"createdTime": "2024-01-15T14:00:00Z",
				"lines": [
					{
						"linesId": 1,
						"productId": 1,
						"title": "Baking flower",
						"description": "Flower description",
						"quantity": "2",
						"unit": "kilograms",
						"unitPrice": 99.5,
						"totalPrice": 199,
						"totalDiscount": 0,
						"totalNetPrice": 199,
						"totalProvision": 9.5,
						"data": [
							{
								"id": 1,
								"name": "Product field name",
								"value": 100
							}
						]
					},
					{
						"linesId": 2,
						"productId": 2,
						"title": "Corn flower",
						"description": "Flower description",
						"quantity": "1",
						"unit": null,
						"unitPrice": 425,
						"totalPrice": 425,
						"totalDiscount": 0,
						"totalNetPrice": 425,
						"totalProvision": 0,
						"data": []
					}
				]
			}
		},
		"sales_products": {
			"type": "object",
			"properties": {
				"lineId": {
					"description": "The unique id of the line",
					"type": "integer"
				},
				"productId": {
					"description": "The unique product id.",
					"type": "integer"
				},
				"title": {
					"description": "Title of the product.",
					"type": "string"
				},
				"description": {
					"description": "Description of the product.",
					"type": "string"
				},
				"quantity": {
					"description": "Number of times the product was sold in a sale.",
					"type": "integer"
				},
				"unit": {
					"description": "Type of unit the product is based in. E.g: months, litres, meters, feet",
					"type": "string"
				},
				"unitPrice": {
					"description": "Price for each product unit.",
					"type": "number"
				},
				"totalPrice": {
					"description": "The total price of the product line.",
					"type": "number"
				},
				"totalDiscount": {
					"description": "The total discount of the product line.",
					"type": "number"
				},
				"totalNetPrice": {
					"description": "The total net price of the product line.",
					"type": "number"
				},
				"totalProvision": {
					"description": "The total provision of the product line.",
					"type": "number"
				},
				"data": {
					"description": "List of product_data associated with the sales line.",
					"type": "array",
					"items": {
						"$ref": "#/definitions/custom_product_data"
					}
				}
			},
			"example": {
				"lineId": 1,
				"productId": 1,
				"title": "Cake flower",
				"description": "Flower description",
				"quantity": 1,
				"unit": null,
				"totalPrice": 99.5,
				"totalDiscount": 0,
				"totalNetPrice": 99.5,
				"totalProvision": 9.5,
				"unitPrice": 99.5,
				"externalId": "42",
				"data": [
					{
						"id": 1,
						"name": "Product field name",
						"value": 100
					}
				]
			}
		},
		"custom_product_data": {
			"type": "object",
			"properties": {
				"id": {
					"description": "The id of the product data",
					"type": "integer"
				},
				"name": {
					"description": "The label of the product field",
					"type": "string"
				},
				"value": {
					"description": "The value of the product data",
					"type": "any"
				}
			},
			"example": [
				{
					"id": 1,
					"name": "Product field name",
					"value": 100
				}
			]
		},
		"products": {
			"type": "object",
			"properties": {
				"id": {
					"description": "The unique id of the product.",
					"type": "integer"
				},
				"title": {
					"description": "Title of the product.",
					"type": "string"
				},
				"description": {
					"description": "A description of the product.",
					"type": "string"
				},
				"unit": {
					"description": "Type of unit the product is based in. E.g: months, litres, meters, feet",
					"type": "string"
				},
				"unitPrice": {
					"description": "The price for one unit of the product.",
					"type": "number"
				},
				"min": {
					"description": "The minimum quantity of the product",
					"type": "number"
				},
				"max": {
					"description": "The maximum quantity of the product",
					"type": "number"
				},
				"provision": {
					"description": "The provision of the product",
					"type": "number"
				},
				"externalId": {
					"description": "The unique id of the product from another system",
					"type": "string"
				}
			},
			"example": {
				"id": 1,
				"title": "Subscription 1",
				"description": "This is a description of my subscription",
				"unit": "months",
				"unitPrice": 500,
				"min": 1,
				"max": 12,
				"provision": 5,
				"externalId": "42"
			}
		},
		"products_create": {
			"type": "object",
			"properties": {
				"code": {
					"description": "The status code."
				},
				"id": {
					"description": "The unique id of the product.",
					"type": "integer"
				}
			},
			"example": {
				"id": 1
			}
		},
		"product_updated": {
			"type": "object",
			"properties": {
				"code": {
					"description": "The status code."
				},
				"id": {
					"description": "The unique id of the product"
				}
			}
		},
		"product_deleted": {
			"type": "object",
			"properties": {
				"code": {
					"description": "The status code."
				}
			}
		},
		"contactsResponse": {
			"type": "object",
			"properties": {
				"id": {
					"description": "The unique id of the contact.",
					"type": "integer",
					"example": 1337
				},
				"importId": {
					"description": "Import ID for the contact - generated when it was uploaded and is the same on contacts from same upload.",
					"type": "integer",
					"example": 42
				},
				"poolId": {
					"description": "The unique id of the contact lead-pool.",
					"type": "integer",
					"example": 1234
				},
				"externalId": {
					"description": "The unique id of the lead from an other system",
					"type": "integer",
					"example": 4
				},
				"fields": {
					"description": "Array of b_data, indexed by b_heading id.",
					"$ref": "#/definitions/contactsResponseFields"
				}
			}
		},
		"contactsResponseFields": {
			"type": "object",
			"properties": {
				"1": {
					"type": "string",
					"example": "Hello"
				},
				"2": {
					"type": "string",
					"example": "world"
				},
				"3": {
					"type": "string",
					"example": null
				},
				"4": {
					"type": "string",
					"example": null
				}
			}
		},
		"onImportedAction": {
			"type": "object",
			"oneOf": [
				{
					"type": "object",
					"properties": {
						"type": {
							"type": "string",
							"enum": [
								"none"
							]
						},
						"required": [
							"type"
						]
					}
				},
				{
					"type": "object",
					"properties": {
						"type": {
							"type": "string",
							"enum": [
								"addToCampaign"
							]
						},
						"campaignId": {
							"type": "number"
						}
					},
					"required": [
						"type",
						"campaignId"
					]
				}
			]
		},
		"sms": {
			"type": "object",
			"properties": {
				"id": {
					"type": "integer",
					"example": 1337,
					"description": "Unique identifier representing a specific SMS"
				},
				"type": {
					"type": "string",
					"enum": [
						"outbound",
						"inbound"
					]
				},
				"timestamp": {
					"type": "string",
					"format": "date-time",
					"example": "2020-05-020T13:37:02Z",
					"description": "Date time notation in UTC"
				},
				"sender": {
					"type": "string",
					"example": "+4586300086",
					"description": "The phone number of the sending party"
				},
				"receiver": {
					"type": "string",
					"example": "+4586300086",
					"description": "The phone number of the receiving party"
				},
				"content": {
					"type": "string",
					"description": "Content of the SMS"
				},
				"userId": {
					"type": "integer",
					"example": 16,
					"description": "User ID"
				},
				"leadId": {
					"type": "integer",
					"example": 242,
					"description": "Lead ID"
				},
				"campaignId": {
					"type": "integer",
					"example": 96,
					"description": "Campaign ID"
				},
				"units": {
					"type": "integer",
					"example": 1,
					"description": "Number of units the contents of an SMS amounts to"
				},
				"status": {
					"type": "string",
					"enum": [
						"dispatched",
						"queued",
						"failed",
						"delivered"
					],
					"example": "delivered",
					"description": "The current status of the SMS"
				},
				"lastModifiedTime": {
					"type": "string",
					"format": "date-time",
					"example": "2020-05-020T13:37:02Z",
					"description": "Date time notation in UTC"
				}
			}
		},
		"note": {
			"type": "object",
			"properties": {
				"id": {
					"type": "integer",
					"example": 1337,
					"description": "Unique identifier representing a specific note"
				},
				"note": {
					"type": "string",
					"example": "Note example",
					"description": "The note text"
				},
				"leadId": {
					"type": "integer",
					"example": 123,
					"description": "Unique identifier of a lead that the note belongs to"
				},
				"userId": {
					"type": "integer",
					"example": 1337,
					"description": "Unique identifier of a user that created the note. If it's 0 then adversus created it (f.e. through journeys)"
				},
				"sessionId": {
					"type": "integer",
					"example": 1234,
					"description": "Unique identifier of a session in which the note was created"
				},
				"timestamp": {
					"type": "string",
					"format": "date-time",
					"example": "2020-05-020T13:37:02Z",
					"description": "Date time notation in UTC"
				}
			}
		},
		"import": {
			"type": "object",
			"properties": {
				"poolId": {
					"type": "integer",
					"example": 21,
					"description": "A contact pool id"
				},
				"match": {
					"type": "object",
					"properties": {
						"fields": {
							"type": "array",
							"items": {
								"type": "integer"
							},
							"description": "A list of ids referencing contact fields which will be used for detecting duplicate entries"
						},
						"blacklist": {
							"type": "array",
							"items": {
								"type": "integer"
							},
							"description": "A list of ids referencing contact pools which the import must be checked against for duplicates"
						}
					},
					"example": {
						"fields": [
							12,
							22
						],
						"blacklist": [
							123
						]
					}
				},
				"onImportedAction": {
					"type": "object",
					"example": {
						"type": "addToCampaign",
						"campaignId": 1337
					},
					"description": "If required the imported contacts can be added to a specific campaign once the import is completed"
				},
				"callbackUrl": {
					"type": "string",
					"description": "Once the import is complete Adversus will perform an http request to the callback url",
					"example": "https://your-custom-callback-url.dev"
				},
				"processing": {
					"type": "object",
					"description": "Processing options - only valid option currently is bloctel (feature is required)",
					"properties": {
						"bloctel": {
							"type": "boolean"
						}
					},
					"example": {
						"bloctel": true
					}
				}
			},
			"required": [
				"poolId"
			],
			"example": {
				"poolId": 21,
				"match": {
					"fields": [
						12,
						22
					],
					"blacklist": [
						123
					]
				},
				"onImportedAction": {
					"type": "addToCampaign",
					"campaignId": 1337
				},
				"updateFields": [
					55,
					34
				],
				"callbackUrl": "https://your-custom-callback-url.dev"
			}
		},
		"recording": {
			"type": "object",
			"properties": {
				"cdr": {
					"type": "object",
					"description": "Reference data for the call which the recording belongs to",
					"properties": {
						"id": {
							"type": "integer",
							"description": "Unique identifier for the call record"
						},
						"timestamp": {
							"type": "string",
							"description": "The timestamp for the call record"
						}
					}
				},
				"recording": {
					"type": "object",
					"description": "Data for the primary call recording",
					"properties": {
						"name": {
							"description": "The file name (machine generated)",
							"type": "string"
						},
						"download": {
							"description": "Temporary url for downloading the recording (may be null if operation is not allowed)",
							"type": "string"
						}
					}
				},
				"clips": {
					"description": "List of tagged recording clips (parts of the conversation marked by the agent)",
					"type": "array",
					"items": {
						"type": "object",
						"properties": {
							"id": {
								"description": "The unique id for the recording clip",
								"type": "integer"
							},
							"tagId": {
								"description": "The tag type for the recording clip",
								"type": "integer"
							},
							"download": {
								"description": "Temporary url for downloading the media for the recording clip.",
								"type": "string"
							}
						}
					}
				},
				"timestamp": {
					"description": "Timestamp for when the recording was uploaded. Use this as the cursor for only fetching recordings uploaded since last checked.",
					"type": "string"
				}
			}
		},
		"recording-clips": {
			"type": "object",
			"properties": {
				"id": {
					"type": "integer",
					"description": "The unique id for the recording clip",
					"example": 1
				},
				"tag": {
					"type": "object",
					"properties": {
						"id": {
							"type": "integer",
							"description": "The unique id for the tag type",
							"example": 1
						},
						"name": {
							"type": "string",
							"description": "The name for the tag type",
							"example": "test"
						}
					}
				},
				"campaignId": {
					"type": "integer",
					"description": "The unique id for the campaign",
					"example": 1
				},
				"leadId": {
					"type": "integer",
					"description": "The unique id for the lead",
					"example": 1
				},
				"sessionId": {
					"type": "integer",
					"description": "The unique id for the session",
					"example": 1
				},
				"state": {
					"type": "string",
					"description": "The state for the recording clip",
					"example": "pending",
					"enum": [
						"init",
						"recording",
						"queued",
						"processing",
						"ready",
						"failed",
						"scheduled-delete",
						"deleted"
					]
				},
				"timestamp": {
					"type": "string",
					"description": "The timestamp for the recording clip",
					"example": "2025-03-31T07:10:35Z"
				},
				"url": {
					"type": "string",
					"description": "The download url for the recording clip",
					"example": "https://media.adversus.io/recording-clips?ref=test"
				}
			}
		},
		"transcription-summary": {
			"type": "object",
			"properties": {
				"summaryId": {
					"type": "integer",
					"description": "Id of the summary",
					"example": "1"
				},
				"leadId": {
					"type": "integer",
					"description": "Id of the lead thats related to the transcription summary",
					"example": "1"
				},
				"cdrId": {
					"type": "integer",
					"description": "Id of the call thats related to the transcription summary",
					"example": "1"
				},
				"createdAt": {
					"type": "string",
					"description": "Timestamp of when the summary was created",
					"example": "2026-04-29T07:10:35Z"
				},
				"summary": {
					"type": "string",
					"description": "Summary of the transcription",
					"example": "Mr. Jacobs expressed concern about the value of a magazine given the abundance of free online cat content....."
				}
			}
		},
		"ContactPersonBulkActionCreate": {
			"type": "object",
			"properties": {
				"type": {
					"type": "string",
					"enum": [
						"create"
					],
					"example": "create"
				},
				"payload": {
					"type": "object",
					"properties": {
						"contactId": {
							"type": "integer",
							"description": "Contact ID for the new person",
							"example": 123
						},
						"data": {
							"type": "object",
							"description": "Field values to create",
							"example": {
								"2": "Grethe",
								"3": "Doe"
							}
						}
					},
					"required": [
						"id",
						"data"
					]
				}
			},
			"required": [
				"type",
				"payload"
			]
		},
		"ContactPersonBulkActionUpdate": {
			"type": "object",
			"properties": {
				"type": {
					"type": "string",
					"enum": [
						"update"
					],
					"example": "update"
				},
				"payload": {
					"type": "object",
					"properties": {
						"id": {
							"type": "integer",
							"description": "Contact person ID to update",
							"example": 456
						},
						"data": {
							"type": "object",
							"description": "Field values to update",
							"example": {
								"2": "Aruther",
								"3": "Doe"
							}
						}
					},
					"required": [
						"id",
						"data"
					]
				}
			},
			"required": [
				"type",
				"payload"
			]
		},
		"ContactPersonBulkActionDelete": {
			"type": "object",
			"properties": {
				"type": {
					"type": "string",
					"enum": [
						"delete"
					],
					"example": "delete"
				},
				"payload": {
					"type": "object",
					"properties": {
						"id": {
							"type": "integer",
							"description": "Contact person ID to delete",
							"example": 789
						}
					},
					"required": [
						"id"
					]
				}
			},
			"required": [
				"type",
				"payload"
			]
		}
	}
}
