Skip to content

Instantly share code, notes, and snippets.

@daimoniac
Last active March 13, 2024 18:25
Show Gist options
  • Save daimoniac/4c29160025dfaa88e6d30592a749cff8 to your computer and use it in GitHub Desktop.
Save daimoniac/4c29160025dfaa88e6d30592a749cff8 to your computer and use it in GitHub Desktop.
# API information
swagger: '2.0'
info:
title: SocialHub API2
description: SocialHub API Version 2 Specification
version: '2.0.0'
contact:
email: [email protected]
host: app.socialhub.io
basePath: /api2
externalDocs:
description: Product information (DE)
url: https://socialhubio.zendesk.com/hc/de
schemes:
- https
consumes:
- application/json
produces:
- application/json
securityDefinitions:
token:
type: apiKey
description: String of characters used to authenticate specific logged in users
name: accesstoken
in: query
security:
- token: []
# API Operation Groups
tags:
- name: general
description: Miscellaneous routes and operations
- name: accounts
description: Customer namespace
- name: users
description: Users of the customers account
- name: channels
description: Customers Social Media channels for Social Networks
- name: teams
description: Customers team management for grouping users and channels
- name: posts
description: Customers Content Planner posts
- name: approval workflow
description: Operations related to the posts approval workflow
- name: feed
description: Posts feed items such as system messages and comments
- name: link shortening
description: Operations related to shortening links with bitly
- name: media
description: Uploading and managing media files
- name: campaigns
description: Managing Content Campaigns
- name: facebook
description: Facebook specific routes
- name: instagram
description: Instagram specific routes
- name: twitter
description: Twitter specific routes
- name: linkedin
description: LinkedIn specific routes
- name: youtube
description: Youtube specific routes
- name: pinterest
description: Pinterest specific routes
- name: insights
description: Insights specific routes
- name: contacts
description: Customers mail contacts management route
- name: public
description: Public Ticket API routes
- name: logs
description: Loggin routes
- name: manifests
description: Manifest routes
- name: medialibrary
description: Media Library routes
- name: rules
description: Inbox Smart Rules
- name: templates
description: Inbox Templates
- name: searches
description: Monitoring searches
- name: fonts
description: Media editor fonts routes
- name: folders
description: Inbox Folders routes
- name: metrics
description: Analytics V2 metric routes
- name: dashboards
description: Analytics V2 dashboard routes
- name: categories
description: Inbox categories routes
- name: analytics
description: Analytics routes
- name: realtime
description: Realtime routes
# API Routes and Operations
paths:
# General
'/':
get:
summary: General purpose information about the authenticated user.
description: This route provides all the relevant information about the currently authenticated user. It describes which channels the user has access to based on the team he belongs to and which of them are currently active and can therefore be used. It also returns a list of permissions that the user has based on his role.
tags:
- general
responses:
200:
description: General purpose information about the authenticated user.
schema:
type: object
properties:
accountId:
$ref: '#/definitions/ObjectId'
userId:
$ref: '#/definitions/ObjectId'
locale:
type: string
enum: ['en', 'de', 'fr']
activeChannelIds:
type: array
items:
$ref: '#/definitions/ObjectId'
channelIds:
type: array
items:
$ref: '#/definitions/ObjectId'
permissions:
type: array
items:
type: string
pattern: '^[a-zA-Z]*$'
features:
type: object
description: Key/Value map of booleans indicating whether certain features are enabled.
expirationTime:
type: string
format: date-time
description: When the customers account is going to expire.
package:
type: string
description: The kind of account the customer is paying for.
enum: [TRIAL, AWESOME, PROFESSIONAL, ENTERPRISE]
accountName:
type: string
description: Name of the customers account.
userName:
type: string
description: The unique username of the authenticated user.
role:
type: string
description: Role of the authenticated user. USE PERMISSIONS FOR CHECKING WHAT A USER MAY OR MAY NOT DO.
enum: [ADMIN, SUPERADMIN, SMM, SMMWOI, CM, CMWOI, MANAGER, USER, ASSIGNER, REPORTER, OBSERVER, EDITOR]
lastLoginTime:
type: string
format: date-time
description: When the authenticated user last logged in.
readOnlyChannelIds:
type: array
items:
$ref: '#/definitions/ObjectId'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
406:
$ref: '#/responses/NotAcceptableError'
500:
$ref: '#/responses/InternalServerError'
# Analytics
'/analytics/emailreports':
get:
summary: Lists automated email report configs.
description: Returns a pagable list of all automated email report configurations belonging to the account given the user has permission (`EditEmailReports`) to request them.
tags:
- analytics
parameters:
- $ref: '#/parameters/pagingOffset'
- $ref: '#/parameters/pagingCount'
responses:
200:
description: List of email report configs of the account.
schema:
type: array
items:
$ref: '#/definitions/EmailReport'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
406:
$ref: '#/responses/NotAcceptableError'
500:
$ref: '#/responses/InternalServerError'
post:
summary: Creates a new automated email report config.
description: Creates a new automated email report configurations in the customers namespace given he has permission (`EditEmailReports`) to do so.
tags:
- analytics
parameters:
- name: body
in: body
description: The new EmailReport config. The field `_id` will be overridden with actual new Id.
required: true
schema:
$ref: '#/definitions/EmailReport'
responses:
200:
description: The newly created email report entity.
schema:
type: array
items:
$ref: '#/definitions/EmailReport'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
406:
$ref: '#/responses/NotAcceptableError'
500:
$ref: '#/responses/InternalServerError'
'/analytics/emailreports/{id}':
patch:
summary: Partially updates existing automated email report config.
description: Partially updates existing automated email report configurations in the customers namespace given he has permission (`EditEmailReports`) to do so.
tags:
- analytics
parameters:
- name: id
in: path
description: Id of the email report config to update.
required: true
type: string
pattern: '^[a-f0-9]{24}$'
- name: body
in: body
description: The updated EmailReport config. The field `_id` will be overridden with actual Id.
required: true
schema:
$ref: '#/definitions/EmailReport'
responses:
200:
description: The updated created email report entity.
schema:
type: array
items:
$ref: '#/definitions/EmailReport'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
406:
$ref: '#/responses/NotAcceptableError'
500:
$ref: '#/responses/InternalServerError'
delete:
summary: Deletes an email report config.
description: Deletes the specified automated email report configuration given it belongs to the users account and the user has persmission (`EditEmailReports`) to do so.
tags:
- analytics
parameters:
- name: id
in: path
description: Id of the email report config to delete.
required: true
type: string
pattern: '^[a-f0-9]{24}$'
responses:
204:
description: Empty response in case of success
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
406:
$ref: '#/responses/NotAcceptableError'
500:
$ref: '#/responses/InternalServerError'
'/analytics/emailreports/types':
get:
summary: Lists available email report types.
description: Returns available email report types that user can create. Requires EditEmailReports permission.
tags:
- analytics
responses:
200:
description: List of email report types.
schema:
type: array
items:
type: 'object'
properties:
type:
type: string
format:
type: string
enum: ['csv']
label:
type: string
description:
type: string
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/AccessDenied'
500:
$ref: '#/responses/InternalServerError'
'/analytics/emailreports/types/{type}/send':
post:
summary: Sends test email report.
description: Sends test email report for the given timerange to the provided emails. Requires EditEmailReports permission.
tags:
- analytics
parameters:
- name: type
in: path
description: Type of the email report.
required: true
type: string
enum:
- inbox_insights_general_csv
- inbox_insights_monitoring_csv
- inbox_categories_summary_csv
- cp_content_csv
- cp_analytics_channels_csv
- cp_analytics_tags_csv
- inbox_categories_tickets_csv
- user_permissions_csv
- name: body
in: body
required: true
schema:
type: object
properties:
from:
type: string
format: date-time
until:
type: string
format: date-time
emails:
type: array
minItems: 1
uniqueItems: true
items:
type: string
format: email
responses:
204:
description: Empty response in case of success.
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/AccessDenied'
500:
$ref: '#/responses/InternalServerError'
# Users
'/users/summary':
get:
summary: Lists the accounts users.
description: Returns a summary of ALL the users belonging to the account given they are in the same team. This route is intended to be fetched during initialization and does not have any form of pagination.
tags:
- users
responses:
200:
description: List of users of the account.
schema:
type: array
items:
$ref: '#/definitions/UserSummary'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
406:
$ref: '#/responses/NotAcceptableError'
500:
$ref: '#/responses/InternalServerError'
'/users/login':
post:
summary: Logins user.
description: Checks user name and password, generates a new accesstoken and returns it.
tags:
- users
parameters:
- name: type
in: query
description: Client type
required: false
type: string
enum:
- default
- mobile
- storyPublisher
- name: deviceId
in: query
description: Generated id of the device
required: false
type: string
- name: body
in: body
required: true
schema:
type: object
properties:
username:
type: string
password:
type: string
required: [username, password]
responses:
200:
description: Jwt to use for the 2fa
schema:
type: object
properties:
jwt:
type: string
secret:
type: string
description: Generated totp secret if it is in totp setup state
image:
type: string
description: Data url of the QR code with encoded totp secret if it is in totp setup state
status:
type: string
enum: ['TOTP_REQUIRED', 'TOTP_SETUP']
description: Whether the totp secret is required or is in setup state
204:
description: Empty response in case of success (2fa disabled)
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/AccessDenied'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
'/users/logout':
get:
summary: Logs out user
description: Unsets current user token.
tags:
- users
parameters:
- name: deviceId
in: query
description: Generated id of the device
required: false
type: string
responses:
204:
description: Empty response in case of success.
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/AccessDenied'
500:
$ref: '#/responses/InternalServerError'
'/users/activate':
post:
summary: Activates account and generates user token.
description: Activates account by username and account one time token, generates a new accesstoken for user and returns it.
tags:
- users
parameters:
- name: type
in: query
description: Client type
required: false
type: string
enum:
- default
- mobile
- name: body
in: body
required: true
schema:
type: object
properties:
username:
type: string
accountVerifyOneTimeToken:
type: string
required: [username, accountVerifyOneTimeToken]
responses:
200:
description: Object with the new access token for user and an array of available account products
schema:
type: 'object'
properties:
oneTimeToken:
type: string
accessToken:
type: string
products:
type: array
items:
type: string
enum:
- cp
- inbox
- ml
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/AccessDenied'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
'/users/{userId}':
patch:
summary: Partially updates a user
description: Users with the `EditUsers` permission are allowed to change other users. All users can update own name, email, settings, etc.
tags:
- users
parameters:
- name: userId
in: path
description: User ID of the user to update.
required: true
type: string
pattern: '^[a-f0-9]{24}$'
- name: body
in: body
required: true
schema:
type: object
properties:
email:
type: string
format: email
firstName:
type: string
minLength: 1
lastName:
type: string
minLength: 1
role:
type: string
enum: ['ADMIN', 'SMM', 'SMMWOI', 'CM', 'CMWOI', 'ASSIGNER', 'REPORTER', 'OBSERVER', 'EDITOR', 'SMMAA', 'ADVERT', 'CUSTOM']
locale:
type: string
password:
type: string
oldPassword:
type: string
description: required when user tries to update own password
settings:
type: object
readOnlyChannelIds:
type: array
description: id of channels user should have only read access to
items:
$ref: '#/definitions/ObjectId'
teams:
type: array
description: id of teams the user should be part of
items:
$ref: '#/definitions/ObjectId'
mobileDevice:
type: object
properties:
id:
type: string
maxLength: 512
description: mobile device id of the user to be updated
token:
type: string
maxLength: 512
description: token info of the mobile device
responses:
200:
description: Returns the updated user
schema:
$ref: '#/definitions/User'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/AccessDenied'
404:
$ref: '#/responses/NotFoundError'
409:
description: The request is not valid on this entity. May contain additional info why the update failed
schema:
type: object
properties:
code:
type: string
description: when the code is InvalidUserUpdate, our internal update validation has failed. body.data will contain further info on what fields caused the update to fail and why.
message:
type: string
data:
type: object
properties:
failed:
type: array
items:
type: object
properties:
key:
type: string
description: indicates a attribute that caused the update to fail
reason:
type: string
description: the reason why the attribute caused the update to fail
enum: [
'updatingOwnRole',
'updatingRoleAsNonAdmin',
'nonAdminMustBePartOfTeam',
'oldPasswordMissing',
'incorrectPassword',
'passwordSameAsOldPassword',
'invalidPassword',
'noReadOnlyChannelsForAdmins',
'cantUpdateOwnPermissions',
'channelDoesNotExist',
'updatingUserMissingWriteAccess',
'teamNotFound',
'userHasAssignedTickets',
'invalidRole'
]
500:
$ref: '#/responses/InternalServerError'
delete:
summary: Deletes a user
description: Deletes selected user. Requires `DeleteUsers` permission.
tags:
- users
parameters:
- name: userId
in: path
description: id of the user to be deleted.
required: true
type: string
pattern: '^[a-f0-9]{24}$'
responses:
204:
description: Empty response in case of success
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/AccessDenied'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
'/users/{userId}/permissions':
patch:
summary: Updates the users permissions and set the `CUSTOM` role for the user.
description: Users with the `EditUsers` permission are allowed to change the permissions of other users. Only defined and customizable permissions can be set where the account meets the permissions requirements (package, features, products). The role of the user is changed to `CUSTOM`. If the user was an Admin he is added to the default team (if teams feature is inactive) or to the provided teams (if teams feature is active)
tags:
- users
parameters:
- name: userId
in: path
description: User ID of the user I want to change the permissions.
required: true
type: string
pattern: '^[a-f0-9]{24}$'
- name: body
in: body
required: true
schema:
type: object
properties:
permissions:
type: array
items:
type: string
teams:
type: array
description: if the teams feature in the account of the user is active the `teams` are required for ADMIN users to ensure they are added to a team when the role changes to `CUSTOM`
items:
$ref: '#/definitions/ObjectId'
required: [permissions]
responses:
200:
description: Returns the updated user
schema:
$ref: '#/definitions/User'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/AccessDenied'
404:
$ref: '#/responses/NotFoundError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
'/users':
get:
summary: Returns account users.
description: Returns account user current user has access to.
tags:
- users
parameters:
- name: hasMobileDevice
in: query
description: A flag to fetch only the users who have mobile device information
required: false
type: boolean
- name: teamId
type: string
pattern: '^[a-f0-9]{24}$'
in: query
required: false
description: Team ObjectId. For now teamId query parameter can only be used along with hasMobileDevice
responses:
200:
description: Account users
schema:
type: array
items:
$ref: '#/definitions/User'
401:
$ref: '#/responses/AccessTokenInvalidError'
500:
$ref: '#/responses/InternalServerError'
post:
summary: Creates a new user for account.
description: Creates a new user for account and adds him to teams. Superadmin can create users for another accounts. Requires EditUsers and ViewAccountSettings permissions.
tags:
- users
parameters:
- name: body
in: body
required: true
schema:
type: object
properties:
userName:
type: string
role:
type: string
enum: ['ADMIN', 'SMM', 'SMMWOI', 'CM', 'CMWOI', 'ASSIGNER', 'REPORTER', 'OBSERVER', 'EDITOR', 'SMMAA', 'ADVERT', 'CUSTOM']
firstName:
type: string
lastName:
type: string
email:
type: string
format: email
phone:
type: string
password:
type: string
accountId:
$ref: '#/definitions/ObjectId'
locale:
type: string
teams:
type: array
description: if the teams feature in the account of the user is active the `teams` are required for ADMIN users to ensure they are added to a team when the role changes to `CUSTOM`
items:
$ref: '#/definitions/ObjectId'
required: ['userName', 'role', 'firstName', 'lastName', 'email', 'locale']
responses:
200:
description: Created user.
schema:
$ref: '#/definitions/User'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/AccessDenied'
404:
$ref: '#/responses/NotFoundError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
'/users/{userId}/mask':
post:
summary: Allows superadmins to mask as another user
description: Sets needed cookies to login as another user. Only allowed for users with SUPERADMIN role.
tags:
- users
parameters:
- name: userId
in: path
description: User ID of the user to mask as.
required: true
type: string
pattern: '^[a-f0-9]{24}$'
responses:
204:
description: Empty response in case of success.
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/AccessDenied'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
'/users/totp/generate':
post:
summary: Generated new totp secret for two factor authentication
description: Generated new totp secret for the user to use for the two factor authentication.
tags:
- users
responses:
200:
description: Object with totp secret and jwt token to verify the configuration
schema:
type: 'object'
properties:
jwt:
type: string
description: Json web token which should be used to verify the secret
secret:
type: string
description: Generated totp secret
image:
type: string
description: Data url of the QR code with encoded totp secret
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/AccessDenied'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
'/users/totp/verify':
post:
summary: Sets the totp secret for user
description: Verifies the totp secret and sets it for the user to use for the two factor authentication.
tags:
- users
parameters:
- name: body
in: body
required: true
schema:
type: object
properties:
code:
type: string
description: Authenticator code for the totp secret
jwt:
type: string
description: Json web token with encoded totp secret
required: ['jwt', 'code']
responses:
204:
description: Emtpy response in case of success
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/AccessDenied'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
'/users/totp/login':
post:
summary: Login user by the totp
description: Verifies the totp secret and sets authentication headers for the user. Jwt must be provided from the password based login route.
tags:
- users
parameters:
- name: body
in: body
required: true
schema:
type: object
properties:
code:
type: string
description: Authenticator code for the totp secret
remember:
type: boolean
required: ['code']
responses:
204:
description: Emtpy response in case of success
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/AccessDenied'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
'/users/{userId}/totp':
delete:
summary: Removes totp secret from user
description: Removes totp secret from user and disables two factor authentication.
tags:
- users
parameters:
- name: userId
in: path
description: User ID of the user to remove the totp secret for.
required: true
type: string
pattern: '^[a-f0-9]{24}$'
- name: code
in: query
type: string
description: Authenticator code of the user
required: true
responses:
204:
description: Empty response in case of success
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/AccessDenied'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
'/users/keycloak/{realm}/login':
get:
summary: Logs user in through keycloak.
description: exchanges code sent by keycloak for a keycloak user access token, generates a new accesstoken and redirects to socialhub.
tags:
- users
parameters:
- name: realm
in: path
description: Name of the realm the user account is linked to
required: true
type: string
- name: code
in: query
description: Keycloak one time code.
required: true
type: string
pattern: '^[a-f0-9-.]+$'
- name: session_state
in: query
description: Keycloak session state.
required: false
type: string
pattern: '^[a-f0-9-]+$'
responses:
302:
description: Redirection to socialhub in case of success
400:
$ref: '#/responses/BadRequestError'
403:
$ref: '#/responses/AccessDenied'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
'/users/password/reset':
post:
summary: Triggers password reset for a userName
description: Sends the password reset email for a user specified by its userName.
tags:
- users
parameters:
- name: body
in: body
required: true
schema:
type: object
properties:
userName:
type: string
description: userName of the user for which to send password reset email
required: ['userName']
responses:
204:
description: Emtpy response in case of success
400:
$ref: '#/responses/BadRequestError'
403:
$ref: '#/responses/AccessDenied'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
'/users/password':
post:
summary: sets the password of a user
description: Uses a one time token to set the password for a user. Possible special error codes `TokenExpired`, `PasswordCriteriaMismatch`, `PasswordIdentical`
tags:
- users
parameters:
- name: body
in: body
required: true
schema:
type: object
properties:
token:
type: string
description: one time token used to identify and authorize the user
password:
type: string
description: the new password for the user
required: ['token', 'password']
responses:
204:
description: Emtpy response in case of success
400:
$ref: '#/responses/BadRequestError'
403:
$ref: '#/responses/AccessDenied'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
# Channels
'/channels/counts':
get:
summary: Returns channels' counts for each network.
description: Returns counts of channels of each default network including Placholders network. Also, returns `needsAttention` count of channels which are either disabled or have expiring token (7 days until expiration). For each reusable manifest it returns a count. E.g. 41 for 'Manifest One' manifest. Returns `total` count which includes the sum of all counts except `needsAttention` one.
tags:
- channels
responses:
200:
description: Channels' count summary.
schema:
$ref: '#/definitions/ChannelsCounts'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/AccessDenied'
406:
$ref: '#/responses/NotAcceptableError'
500:
$ref: '#/responses/InternalServerError'
'/channels':
get:
summary: Lists the channels of default networks, placeholders and custom network channels.
description: Lists the channels of default networks, placeholders and custom network channels. This route has filters, sort options, etc. Also, it has a pagination.
tags:
- channels
parameters:
- $ref: '#/parameters/pagingOffset'
- $ref: '#/parameters/pagingCount'
- name: sortBy
in: query
description: Select the field or criteria to sort the results by. Either `name`, `network` (`socialNetwork`) or `createdTime`. Also, sorts by time until token expired, if there are multiple token it takes the smallest time to sort. Default is `createdTime`.
type: string
enum:
- name
- network
- createdTime
- expires
default: createdTime
- name: order
in: query
description: Sets the sort order of the results. Either `asc` or `desc`. Default is `desc`.
type: string
enum:
- asc
- desc
default: asc
- name: search
in: query
description: Filter channels by search term.
required: false
type: string
- name: network
in: query
description: Filter channels by social network or manifest network
required: false
type: string
- name: status
in: query
description: Filter channels by status
required: false
type: string
enum:
- active
- expiring
- expired
- disabled
- needsAttention
- name: tokenOwnerIds
in: query
description: Filter channels by token owner ids
required: false
type: array
items:
type: string
- name: teamIds
in: query
description: Filter channels by team ids
required: false
type: array
items:
type: string
pattern: '^[a-f0-9]{24}$'
- name: product
in: query
description: Filter channels by product
required: false
type: string
enum:
- inbox
- cp
- ml
- name: networks
in: query
description: Filter channels by array of social networks or manifest networks
required: false
type: array
items:
type: string
- name: includeInactive
in: query
description: Filter to include / exclude deactivated channels
required: false
type: boolean
default: true
- name: excludedNetworks
in: query
description: List of social networks to be excluded from the response
required: false
type: array
items:
type: string
responses:
200:
description: List of channels of the account.
schema:
$ref: '#/definitions/Channel'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/AccessDenied'
406:
$ref: '#/responses/NotAcceptableError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
'/channels/summary':
get:
summary: Lists the accounts Social Media channels.
description: Returns a summary of ALL the channels belonging to the account. This route is intended to be fetched during initialization and does not have any form of pagination.
tags:
- channels
parameters:
- name: network
in: query
description: Filters the returned channels by network types. For Content-Planner this filter should be set to `facebook`, `twitter`, `placeholders` and `instagram_business`.
required: false
type: array
items:
type: string
enum:
- facebook
- twitter
- youtube
- placeholders
- searches
- instagram_business
- pinterest
- tiktok
- name: teamIds
in: query
description: Filter the returned channels by team ids
required: false
type: array
items:
type: string
pattern: '^[a-f0-9]{24}$'
- name: includeInactive
in: query
description: Filter to include / exclude deactivated channels
required: false
type: boolean
default: true
- name: product
in: query
description: Filter channels by product
required: false
type: string
enum:
- inbox
- cp
- ml
- name: excludedNetworks
in: query
description: List of social networks to be excluded from the response
required: false
type: array
items:
type: string
responses:
200:
description: List of channels of the account.
schema:
type: array
items:
$ref: '#/definitions/ChannelSummary'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
406:
$ref: '#/responses/NotAcceptableError'
500:
$ref: '#/responses/InternalServerError'
'/channels/tokenOwners':
get:
summary: Returns all channels access tokens owners.
description: Returns owners of active and expired tokens of all channels user has access to. Requires ViewChannels permissions.
tags:
- channels
responses:
200:
description: List of token owners.
schema:
type: array
items:
type: object
properties:
userId:
type: string
userName:
type: string
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/AccessDenied'
500:
$ref: '#/responses/InternalServerError'
'/channels/id/bulk/getDetails':
post:
summary: Fetch details of specified channels.
description: Returns detailed Channel entities for the specified list of channel Ids. This route is intended to be used if more detailed channel information is needed than the summary route can provide. It will return an AccessDeniedError if the user does not have access to one or more of the requested channels.
tags:
- channels
parameters:
- name: body
in: body
description: An array of channel Ids to fetch the more detailed objects for.
required: true
schema:
type: array
items:
$ref: '#/definitions/ObjectId'
minItems: 1
maxItems: 50
uniqueItems: true
responses:
200:
description: List of channels of the account. Objects for Ids that could not be found will be missing.
schema:
type: array
items:
type: object
description: A customers Social Media channel, Placeholder or Search.
properties:
_id:
$ref: '#/definitions/ObjectId'
name:
description: Name of the channel as specified on the social network.
type: string
uniqueName:
description: Unique name containing more specific information about the channel.
type: string
socialNetwork:
type: string
enum: ['FACEBOOK', 'TWITTER', 'PLACEHOLDERS', 'INSTAGRAM_BUSINESS']
imageUrl:
description: URL to the channel image as specified by the social network.
type: string
format: uri
posts:
type: number
description: number of scheduled posts in the next 30 days for this channel or placeholder
fans:
type: number
description: number of fans this channel has on the social network
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/AccessDenied'
406:
$ref: '#/responses/NotAcceptableError'
500:
$ref: '#/responses/InternalServerError'
'/channels/facebook':
post:
summary: Creates or reactivates facebook channels.
description: Creates or reactivates facebook channels in account. `EditChannels` and `ViewAccountSettings` permissions are required.
tags:
- channels
parameters:
- name: body
in: body
required: true
schema:
type: array
minItems: 1
maxItems: 1000
items:
type: object
required: ['name', 'socialNetwork', 'endpoint', 'features']
properties:
name:
type: string
minLength: 1
maxLength: 1024
description: Human readable channel name.
description:
type: string
minLength: 1
maxLength: 1024
description: Human readable channel description.
socialNetwork:
type: string
description: Social network name this channel is managing. Defines the contents of the endpoint field object.
default: FACEBOOK
enum: ['FACEBOOK']
endpoint:
type: object
required: ['pageId', 'appId', 'accessToken', 'sourceObject']
description: Network specific authentication information. Contents depend on the network field.
properties:
pageId:
type: string
pattern: ^[0-9]+$
appId:
type: string
pattern: ^[0-9]+$
accessToken:
type: array
minItems: 1
maxItems: 1
uniqueItems: true
items:
type: object
required: ['accessToken', 'type', 'userId', 'user_name']
additionalProperties: false
properties:
accessToken:
type: string
pattern: ^[a-zA-Z0-9]+$
type:
type: string
enum: ['realtime']
userId:
type: string
pattern: ^[0-9]+$'
user_name:
type: string
minLength: 1
maxLength: 1024
mainPageAccessToken:
type: string
pattern: ^[a-zA-Z0-9]+$
mainPageId:
type: string
pattern: ^[0-9]+$
sourceObject:
type: 'object'
properties:
access_token:
type: string
pattern: ^[a-zA-Z0-9]+$
id:
type: string
pattern: ^[0-9]+$
is_published:
type: boolean
link:
type: string
format: url
name:
type: string
minLength: 1
maxLength: 1024
name_with_location_descriptor:
type: string
minLength: 1
maxLength: 1024
tasks:
type: array
uniqueItems: true
minItems: 0
maxItems: 50
items:
type: string
picture:
type: object
required: ['data']
additionalProperties: false
properties:
data:
type: 'object'
properties:
height:
type: integer
minimum: 0
width:
type: integer
minimum: 0
url:
type: string
format: url
is_silhouette:
type: boolean
store_location_descriptor:
type: string
minLength: 1
maxLength: 1024
features:
type: object
required: ['privateMessages']
description: List of all channel features.
properties:
privateMessages:
type: boolean
responses:
200:
description: Object with results for each channel
schema:
type: object
properties:
results:
type: object
properties:
ChannelName:
type: object
description: Result object for a channel with name 'ChannelName'
properties:
id:
$ref: '#/definitions/ObjectId'
created:
type: boolean
description: Flag showing that the channel was successfully added to the account
newChannel:
type: boolean
description: Flag showing if channel was created or reactivated
bhSetfromId:
$ref: '#/definitions/ObjectId'
bhSetfromName:
type: string
description: Name of the channel from which business hours were copied
error:
type: string
description: Type of the error occured while creating a channel
message:
type: string
description: Message of the error occured while creating a channel
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/AccessDenied'
406:
$ref: '#/responses/NotAcceptableError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
'/channels/facebook/refreshTokens':
post:
summary: Refreshes all accessTokens of a user.
description: refreshes the accessToken of all active channels (FB and IG) for the provided userToken.
tags:
- channels
parameters:
- name: body
in: body
required: true
schema:
type: object
properties:
userToken:
type: string
description: Facebook user token for which to refresh all releated accessTokens
required:
- userToken
responses:
200:
description: List of channels for which a accessToken was refreshed
schema:
type: object
properties:
channelIds:
type: array
items:
$ref: '#/definitions/ObjectId'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/AccessDenied'
500:
$ref: '#/responses/InternalServerError'
'/channels/instagram':
post:
summary: Creates Instagram Business channel
description: Creates a new or reactivates an existing Instagram Business (INSTAGRAM_BUSINESS) channel.
tags:
- channels
parameters:
- name: body
in: body
description: Instagram Business specific channel object.
required: true
schema:
type: object
description: A customers Social Media channel.
properties:
_id:
$ref: '#/definitions/ObjectId'
name:
description: Name of the channel.
type: string
uniqueName:
description: Unique name of the channel.
type: string
socialNetwork:
type: string
enum: ['INSTAGRAM_BUSINESS']
endpoint:
type: object
properties:
pageId:
description: The instagram_business_account id.
type: string
appId:
description: Id of the App the token belongs to.
type: string
sourceObject:
type: object
properties:
access_token:
description: Page access token.
type: string
user_token:
description: User access token.
type: string
token_owner_user_name:
description: Name of the access token owner.
type: string
responses:
200:
description: List of channels of the account. Objects for Ids that could not be found will be missing.
schema:
$ref: '#/definitions/Channel'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/AccessDenied'
406:
$ref: '#/responses/NotAcceptableError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
'/channels/linkedin':
post:
summary: Creates LinkedIn channel
description: Creates a new or reactivates an existing LinkedIn (LINKEDIN) channel.
tags:
- channels
parameters:
- name: body
in: body
description: LinkedIn specific channel object.
required: true
schema:
type: object
description: A customers Social Media channel.
properties:
_id:
$ref: '#/definitions/ObjectId'
name:
description: Name of the channel.
type: string
uniqueName:
description: Unique name of the channel.
type: string
socialNetwork:
type: string
enum: ['LINKEDIN']
imageUrl:
description: URL to the channel image.
type: string
format: uri
endpoint:
type: object
properties:
pageId:
description: The organizationalTarget id.
type: string
owner:
description: The roleAssignee id.
type: string
sourceObject:
type: object
properties:
access_token:
description: Page access token.
type: string
expiresIn:
description: Seconds until access token expiration.
type: number
refresh_token:
description: Token token refresh the main access token.
type: string
refresh_token_expiresIn:
description: Seconds until refresh token expiration.
type: number
responses:
200:
description: List of channels of the account. Objects for Ids that could not be found will be missing.
schema:
$ref: '#/definitions/Channel'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/AccessDenied'
406:
$ref: '#/responses/NotAcceptableError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
'/channels/linkedin/refreshTokens':
post:
summary: Refreshes accessTokens of LinkedIn channels.
description: Refreshes accessTokens of LinkedIn channels user has access to.
tags:
- channels
parameters:
- name: body
in: body
required: true
schema:
type: object
properties:
access_token:
description: LinkedIn access token.
type: string
expiresIn:
description: Seconds until access token expiration.
type: number
refresh_token:
description: Token to refresh the main access token.
type: string
refresh_token_expiresIn:
description: Seconds until refresh token expiration.
type: number
responses:
200:
description: List of channels ids for which a accessToken was refreshed
schema:
type: object
properties:
channelIds:
type: array
items:
$ref: '#/definitions/ObjectId'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/AccessDenied'
500:
$ref: '#/responses/InternalServerError'
'/channels/whatsapp':
post:
summary: Creates WhatsApp channel
description: Creates a new or reactivates an existing WhatsApp (WHATSAPP) channel.
tags:
- channels
parameters:
- name: teamIds
in: query
description: teams to add the channel to
type: string
pattern: '^[a-f0-9]{24}$'
- name: body
in: body
description: WhatsApp specific channel informration.
required: true
schema:
type: object
description: A customers Social Media channel information.
properties:
wabaId:
description: WhatsApp Business Account Id.
type: string
pageId:
description: WhatsApp phone number Id.
type: string
code:
description: Verification code to be exchanged for an access token.
type: string
responses:
200:
description: The created channel.
schema:
$ref: '#/definitions/Channel'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/AccessDenied'
406:
$ref: '#/responses/NotAcceptableError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
'/channels/wordpress':
post:
summary: Creates a wordpress channel
description: Creates a new wordpress channel or reactivates an existing one.
tags:
- channels
parameters:
- name: channelId
in: query
description: id of the channel to reactivate
type: string
pattern: '^[a-f0-9]{24}$'
- name: teamIds
in: query
description: teams to add the channel to
type: string
pattern: '^[a-f0-9]{24}$'
- name: body
in: body
description: Wordpress specific channel object.
required: true
schema:
type: object
description: A customers Social Media channel.
properties:
endpoint:
type: object
properties:
accessToken:
description: accesstoken to wordpress channel.
type: string
responses:
201:
description: created or reactivated channel object.
schema:
$ref: '#/definitions/Channel'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/AccessDenied'
404:
$ref: '#/responses/NotFoundError'
406:
$ref: '#/responses/NotAcceptableError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
'/channels/custom':
post:
summary: Creates custom channel for public tickets api
description: Creates a new or reactivates an existing custom channel.
tags:
- channels
parameters:
- name: channelId
in: query
description: id of the channel to reactivate
type: string
pattern: '^[a-f0-9]{24}$'
- name: teamIds
in: query
description: teams to add the channel to
type: string
pattern: '^[a-f0-9]{24}$'
- name: body
in: body
required: true
schema:
type: object
properties:
name:
description: Name of the channel.
type: string
uniqueName:
description: Unique name of the channel.
type: string
socialNetwork:
type: string
enum: ['CUSTOM']
imageUrl:
description: URL to the channel image.
type: string
format: uri
imageId:
description: Id of the channel image media.
type: string
pattern: '^[a-f0-9]{24}$'
responses:
201:
description: Successfully created custom channel entity.
schema:
$ref: '#/definitions/Channel'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/AccessDenied'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
'/channels/placeholder':
post:
summary: Creates or reactivates a placeholder channel
description: Creates a new placeholder channel or reactivates an existing one.
tags:
- channels
parameters:
- name: channelId
in: query
description: id of the placeholder channel to reactivate
type: string
pattern: '^[a-f0-9]{24}$'
- name: teamIds
in: query
description: teams to add the channel to
type: string
pattern: '^[a-f0-9]{24}$'
- name: body
in: body
description: placeholder specific channel object
required: true
schema:
type: object
description: the placeholder channel data
properties:
name:
type: string
maxLength: 50
imageUrl:
type: string
format: uri
imageId:
type: string
pattern: '^[a-f0-9]{24}$'
recipients:
type: array
uniqueItems: true
description: required if emailAdvance is set
items:
type: string
format: email
cc:
type: array
uniqueItems: true
items:
type: string
format: email
emailAdvance:
type: number
minimum: 0
maximum: 1440
description: required if at least on recipient is set
network:
type: string
enum: [
'INSTAGRAM',
'YOUTUBE',
'GOOGLEPLUS',
'WORDPRESS',
'LINKEDIN',
]
responses:
201:
description: created or reactivated placeholder channel
schema:
$ref: '#/definitions/Channel'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/AccessDenied'
404:
$ref: '#/responses/NotFoundError'
406:
$ref: '#/responses/NotAcceptableError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
'/channels/placeholder/{id}':
patch:
summary: updates an existing placeholder channel
description: Updates an existing placeholder channel
tags:
- channels
parameters:
- name: id
in: path
description: Id of the placeholder channel to update
required: true
type: string
pattern: '^[a-f0-9]{24}$'
- name: body
in: body
description: placeholder specific channel object
required: true
schema:
type: object
description: the placeholder channel data
properties:
name:
type: string
maxLength: 50
imageUrl:
type: string
format: uri
imageId:
type: string
pattern: '^[a-f0-9]{24}$'
endpoint:
type: object
properties:
recipients:
type: array
uniqueItems: true
description: required if emailAdvance is set
items:
type: string
format: email
cc:
type: array
uniqueItems: true
items:
type: string
format: email
emailAdvance:
type: number
minimum: 0
maximum: 1440
network:
type: string
enum: [
'INSTAGRAM',
'YOUTUBE',
'GOOGLEPLUS',
'WORDPRESS',
'LINKEDIN',
]
responses:
200:
description: updated placeholder channel
schema:
$ref: '#/definitions/Channel'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/AccessDenied'
404:
$ref: '#/responses/NotFoundError'
406:
$ref: '#/responses/NotAcceptableError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
'/channels/custom/{id}/reset':
post:
summary: Resets a custom channels token
description: Creates a new access token for the specified custom channel, invalidating the old one
tags:
- channels
parameters:
- name: id
in: path
description: Id of the channel to delete.
required: true
type: string
pattern: '^[a-f0-9]{24}$'
responses:
201:
description: Successfully created new access token, returns updated channel
schema:
$ref: '#/definitions/Channel'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/AccessDenied'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
'/channels/{id}':
get:
summary: Returns requested channel
description: Returns requested channel. Requires `ViewChannels` permission.
tags:
- channels
parameters:
- name: id
in: path
description: Id of the requested channel.
required: true
type: string
pattern: '^[a-f0-9]{24}$'
responses:
200:
description: Requested channel
schema:
$ref: '#/definitions/Channel'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/AccessDenied'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
delete:
summary: Deactivates / deletes a channel
description: Deactivate account channel. If fullDeletion param provided completly removes a channel.
tags:
- channels
parameters:
- name: id
in: path
description: Id of the channel to delete.
required: true
type: string
pattern: '^[a-f0-9]{24}$'
- name: fullDeletion
in: query
description: Completley delete channel from the system. Can be used only by superadmin.
required: false
default: false
type: boolean
responses:
204:
description: Empty response in case of success.
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/AccessDenied'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
patch:
summary: updates an existing channel
description: Updates an existing channel with new name or channel image
tags:
- channels
parameters:
- name: id
in: path
description: Id of the channel to update
required: true
type: string
pattern: '^[a-f0-9]{24}$'
- name: body
in: body
required: true
schema:
type: object
description: the channel data
properties:
name:
type: string
maxLength: 50
imageUrl:
type: string
format: uri
imageId:
type: string
pattern: '^[a-f0-9]{24}$'
responses:
200:
description: updated channel
schema:
$ref: '#/definitions/Channel'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/AccessDenied'
404:
$ref: '#/responses/NotFoundError'
406:
$ref: '#/responses/NotAcceptableError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
'/channels/{id}/token':
post:
summary: Adds access token for a channel
description: Adds or replaces access token for fb and ig channels. Needs EditChannels and ViewAccountSettings permissions.
tags:
- channels
parameters:
- name: id
in: path
description: Id of the channel to add.
required: true
type: string
pattern: '^[a-f0-9]{24}$'
- name: body
in: body
schema:
type: object
required: ['access_token']
properties:
access_token:
description: New page access token for a channel
type: string
user_token:
description: New user access token for ig channel.
type: string
user_name:
description: Name of the access token owner.
type: string
mainPageId:
description: Id of the main facebook page if channel represents page location
type: string
mainPageAccessToken:
description: Access token of the main facebook page if channel represents page location
type: string
responses:
204:
description: Empty response in case of success.
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/AccessDenied'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
'/channels/{id}/token/{userId}':
delete:
summary: Delete an active accessToken or expired token data
description: Deletes an active accessToken or the expired token data for certain network user. In case the last accessToken of a channel is removed the channel will be deactivated.
tags:
- channels
parameters:
- name: id
in: path
description: Id of the channel to delete expired token data.
required: true
type: string
pattern: '^[a-f0-9]{24}$'
- name: userId
in: path
description: A network id of the user which expired token should be deleted.
required: true
type: string
- name: from
in: query
description: Specifies if the token should be removed from the accessToken of the channel or the expired token
required: true
enum:
- accessToken
- expiredAccessToken
type: string
responses:
200:
description: Successfully deleted accessToken or expired token. Updated channel is returned.
schema:
$ref: '#/definitions/Channel'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/AccessDenied'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
# Public Tickets API
'/public':
get:
summary: Returns custom channel and it's manifest
description: Returns custom channel data and it's manifest. Needs Custom Channel Access Token.
tags:
- public
responses:
200:
description: 'Channel and manifest data'
schema:
type: object
properties:
channel:
$ref: '#/definitions/Channel'
manifest:
$ref: '#/definitions/Manifest'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/AccessDenied'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
'/public/manifest':
patch:
summary: Partially modifies channel manifest
description: Modifies CUSTOM channel manifest with the provided values. Needs Custom Channel Access Token.
tags:
- public
parameters:
- name: body
in: body
required: true
schema:
type: object
properties:
branding:
type: object
properties:
icon:
description: 'HTTPS URL to Network icon (eg. Twitter Bird)'
type: string
format: uri
pattern: '^https://'
fallback:
description: 'HTTPS URL to fallback icon (eg. shown for ticket interactors without avatar)'
type: string
format: uri
pattern: '^https://'
color:
description: 'HTML Hex color code for Network branding (eg. Facebook blue for Ticket borders)'
type: string
pattern: '^#[0-9a-f]{3,6}$'
webhook:
type: object
required: [url, secret]
properties:
url:
description: Url of the webhook.
type: string
format: uri
pattern: '^https://'
secret:
description: Secret to sign webhook requests with.
type: string
minLength: 32
maxLength: 512
inbox:
type: object
properties:
ticketActions:
type: array
items:
type: object
required: ['id', 'type', 'label']
properties:
type:
type: string
id:
type: string
label:
type: object
properties:
en:
type: string
de:
type: string
fr:
type: string
required: [en, de, fr]
config:
type: object
properties:
approvalProcess:
type: boolean
templates:
type: object
properties:
url:
type: string
format: url
timeout:
type: object
properties:
duration:
type: string
example: '24h'
after:
type: string
enum: ['networkCreationTime']
required:
- duration
- after
forceTagging:
type: boolean
attachments:
type: object
properties:
noText:
type: boolean
default: false
options:
type: array
items:
type: object
required: ['id', 'label']
properties:
id:
type: string
pattern: ^[a-zA-Z0-9-_]{1,256}$
label:
type: object
properties:
en:
type: string
de:
type: string
fr:
type: string
required: [en, de, fr]
description:
type: string
minLength: 1
maxLength: 256
rightSidebar:
type: array
required: ['id', 'label', 'treeBuilder']
items:
type: object
properties:
id:
type: string
label:
type: object
properties:
en:
type: string
de:
type: string
fr:
type: string
required: [en, de, fr]
treeBuilder:
type: string
enum: ['flatListWithoutRoot', 'flatListWithRoot']
callbacks:
type: object
properties:
channelCreation:
type: string
format: uri
responses:
200:
description: Modified channel manifest.
schema:
$ref: '#/definitions/Manifest'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/AccessDenied'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
'/public/channel':
patch:
summary: Updates a channel by its jwt
description: Partially updates a channel. Channel jwt is required.
tags:
- public
parameters:
- name: body
in: body
required: true
schema:
type: object
properties:
name:
description: Name of the channel.
type: string
uniqueName:
description: Unique name of the channel.
type: string
imageUrl:
description: URL to the channel image.
type: string
format: uri
endpoint:
type: object
properties:
expirationTime:
type: string
format: date-time
user:
type: object
properties:
id:
type: string
name:
type: string
profileUrl:
type: string
format: uri
profileImage:
type: string
format: uri
pattern: '^https://'
responses:
200:
description: Updated custom channel entity.
schema:
$ref: '#/definitions/Channel'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/AccessDenied'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
delete:
summary: Deativates a channel by its jwt
tags:
- public
parameters:
- name: reason
in: query
description: The reason of channel deactivation
type: string
responses:
204:
description: Empty response in case of success.
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/AccessDenied'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
'/public/channels':
post:
summary: Creates a new channel based on reusable manifest
description: Creates or updates a channel based on reusable manifest. Temporary jwt is required.
tags:
- public
parameters:
- name: body
in: body
required: true
schema:
type: object
properties:
name:
description: Name of the channel.
type: string
uniqueName:
description: Unique name of the channel.
type: string
imageUrl:
description: URL to the channel image.
type: string
format: uri
endpoint:
type: object
properties:
networkId:
description: id of the channel on network
type: string
expirationTime:
type: string
format: date-time
description: expiration time of channel token
user:
type: object
properties:
id:
type: string
name:
type: string
profileUrl:
type: string
format: uri
profileImage:
type: string
format: uri
pattern: '^https://'
responses:
201:
description: Successfully created custom channel entity.
schema:
$ref: '#/definitions/Channel'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/AccessDenied'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
'/public/inbox/tickets':
post:
summary: Creates a Ticket for Custom Channels
description: Creates a Ticket of type TICKET for CUSTOM Channels. Needs Custom Channel Access Token.
tags:
- public
parameters:
- name: body
in: body
required: true
schema:
type: object
properties:
interaction:
type: object
properties:
root:
type: object
properties:
rootId:
type: string
pattern: '^[a-zA-Z0-9\/|@&$!?\()[\]{}+*~,;.:=_-]{6,256}$'
type:
description: Ticket type (only available for reusable Manifests)
type: string
default: TICKET
enum: [POST, COMMENT, THREAD, MESSAGE, RATING, ALBUM, PHOTO, MENTION, DM, MEDIA, VIDEO, TWEET, REVIEW, WEB, NEWS, BLOG, FORUM, TICKET, ADPOST]
message:
description: Ticket Interaction message.
type: string
createdTime:
description: Timestamp of the Interactions creation on the network.
type: string
format: date-time
networkItemId:
description: Unique identifier of the Interaction on the network. Will error with 409 Conflict if there's already a Ticket with the same ID on the same custom channel.
type: string
pattern: '^[a-zA-Z0-9\/|@&$!?\()[\]{}+*~,;.:=_-]{6,256}$'
url:
description: A Link to the Interaction on the network.
type: string
format: uri
link:
description: Link shared on the Interaction.
type: string
format: uri
pictures:
type: array
items:
type: object
properties:
small:
type: string
format: uri
large:
type: string
format: uri
required: ['small']
attachments:
type: array
items:
type: object
properties:
url:
type: string
format: uri
size:
type: number
minimum: 0
name:
type: string
mimeType:
type: string
required: ['url']
interactor:
type: object
properties:
interactorId:
type: string
minLength: 3
description: id of the ticket interactor on network
name:
type: string
url:
type: string
format: url
picture:
type: string
format: url
required: ['interactorId']
rating:
type: object
properties:
value:
type: number
minimum: 0
scale:
type: number
minimum: 0
maximum: 100
responses:
201:
description: Successfully created ticket.
schema:
$ref: '#/definitions/Ticket'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/AccessDenied'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
'/public/inbox/tickets/{id}':
patch:
summary: Updates a Ticket for Custom Channels
description: Partially updates a Ticket for CUSTOM Channels. Needs Custom Channel Access Token.
tags:
- public
parameters:
- name: id
in: path
description: Id of the ticket to update
required: true
type: string
pattern: '^[a-f0-9]{24}$'
- name: reset
in: query
description: Moves ticket back to inbox in addition to updating the data if it was already archived. Defaults to false.
required: false
type: boolean
- name: body
in: body
required: true
schema:
type: object
properties:
interaction:
type: object
properties:
message:
description: Ticket Interaction message.
type: string
updatedTime:
description: Timestamp of when the Interaction was updated on the network.
type: string
format: date-time
url:
description: A Link to the Interaction on the network.
type: string
format: uri
link:
description: Link shared on the Interaction.
type: string
format: uri
pictures:
type: array
items:
type: object
properties:
small:
type: string
format: uri
large:
type: string
format: uri
required: ['small']
attachments:
type: array
items:
type: object
properties:
url:
type: string
format: uri
size:
type: number
minimum: 0
name:
type: string
mimeType:
type: string
required: ['url']
interactor:
type: object
properties:
name:
type: string
url:
type: string
format: url
picture:
type: string
format: url
rating:
type: object
properties:
value:
type: number
minimum: 0
scale:
type: number
minimum: 0
maximum: 100
responses:
200:
description: Successfully updated ticket.
schema:
$ref: '#/definitions/Ticket'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/AccessDenied'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
'/public/inbox/tickets/{id}/reset/{aid}':
post:
summary: Resets ticket actions.
description: Resets ticket actions of CUSTOM channels. Needs Custom Channel Access Token.
tags:
- public
parameters:
- name: id
in: path
description: Id of the ticket to reset
required: true
type: string
pattern: '^[a-f0-9]{24}$'
- name: aid
in: path
description: Id of the ticket action to reset
required: true
type: string
pattern: '^[a-zA-Z0-9-_]{1,256}$'
- name: body
in: body
required: true
schema:
type: object
properties:
followupId:
type: string
description: Id of the reply followup that caused the reset
reason:
type: string
description: Reason of the reset, e.g. network error message
responses:
201:
description: Updated ticket.
schema:
$ref: '#/definitions/Ticket'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/AccessDenied'
500:
$ref: '#/responses/InternalServerError'
501:
$ref: '#/responses/NotImplementedError'
'/public/inbox/tickets/{id}/replies/{rid}/success':
post:
summary: Creates context ticket for reply action.
description: Creates context ticket for reply actions of CUSTOM channels. Needs Custom Channel Access Token.
tags:
- public
parameters:
- name: id
in: path
description: Id of the parent ticket
required: true
type: string
pattern: '^[a-f0-9]{24}$'
- name: rid
in: path
description: Id of the ticket reply followup
required: true
type: string
format: 'uuid'
- name: body
in: body
required: true
schema:
type: object
properties:
interaction:
type: object
properties:
networkItemId:
type: string
pattern: '^[a-zA-Z0-9/_-]{6,256}$'
type:
description: Ticket type (only available for reusable Manifests)
type: string
default: TICKET
enum: [POST, COMMENT, THREAD, MESSAGE, RATING, ALBUM, PHOTO, MENTION, DM, MEDIA, VIDEO, TWEET, REVIEW, WEB, NEWS, BLOG, FORUM, TICKET, ADPOST]
url:
type: string
format: 'url'
createdTime:
type: string
format: date-time
required: ['networkItemId']
required: ['interaction']
responses:
201:
description: Created context ticket.
schema:
$ref: '#/definitions/Ticket'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/AccessDenied'
404:
$ref: '#/responses/NotFoundError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
# Teams
'/teams':
get:
summary: Lists the teams of an account
description: Get a list of all teams of an account
tags:
- teams
responses:
200:
description: List of teams.
schema:
type: array
items:
$ref: '#/definitions/Team'
401:
$ref: '#/responses/AccessTokenInvalidError'
500:
$ref: '#/responses/InternalServerError'
post:
summary: Create a team
description: Create a team with given name.
tags:
- teams
parameters:
- name: body
in: body
description: The team entity properties.
required: true
schema:
type: object
properties:
name:
type: string
description: Name of the team
responses:
200:
description: Created team entity
schema:
$ref: '#/definitions/Team'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
'/teams/{id}':
patch:
summary: Update a team
description: Update a team entity with given properties. Requires ViewTeams and ViewAccountSettings permissions.
tags:
- teams
parameters:
- name: id
in: path
description: Id of the postGroup to delete.
required: true
type: string
pattern: '^[a-f0-9]{24}$'
- name: body
in: body
description: The team entity properties
required: true
schema:
type: object
properties:
name:
type: string
description: Name of the team
admins:
type: array
items:
$ref: '#/definitions/ObjectId'
description: Ids of admins who will be admin of this team
responses:
200:
description: Updated team entity
schema:
$ref: '#/definitions/Team'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
406:
$ref: '#/responses/NotAcceptableError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
delete:
summary: Deletes a team.
description: Deletes a team and its related data. Requires 'ViewTeams' and 'ViewAccountSettings' permissions.
tags:
- teams
parameters:
- name: id
in: path
description: Id of the postGroup to delete.
required: true
type: string
pattern: '^[a-f0-9]{24}$'
responses:
204:
description: Empty response in case of success.
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
'/teams/summary':
get:
summary: Lists the accounts teams.
description: Returns a summary of ALL the Teams the user belongs to. This route is intended to be fetched during initialization and does not have any form of pagination.
tags:
- teams
responses:
200:
description: List of teams of the account.
schema:
type: array
items:
$ref: '#/definitions/TeamSummary'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
406:
$ref: '#/responses/NotAcceptableError'
500:
$ref: '#/responses/InternalServerError'
'/teams/{id}/channel/{channelId}':
delete:
summary: Remove channel from the team
description: 'Needed permissions: EditChannels, ViewAccountSettings, EditTeamChannels. NOTE: User should be superadmin or team admin in order to remove channel from the team'
tags:
- teams
parameters:
- name: id
in: path
description: Id of the team
required: true
type: string
pattern: '^[a-f0-9]{24}$'
- name: channelId
in: path
description: Id of the channel to be removed
required: true
type: string
pattern: '^[a-f0-9]{24}$'
responses:
200:
description: Empty response in case of success.
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
description: "If the provided team or channel can not be found"
schema:
$ref: '#/definitions/Error'
406:
$ref: '#/responses/NotAcceptableError'
409:
description: This error is returned if the channel does not belong to any other team.
schema:
$ref: '#/definitions/Error'
500:
$ref: '#/responses/InternalServerError'
'/teams/{id}/users':
post:
summary: Add users to the team.
description: Add users to the team and return updated team.
tags:
- teams
parameters:
- name: id
in: path
description: Id of the team.
required: true
type: string
pattern: '^[a-f0-9]{24}$'
- name: body
in: body
description: The user ids that we want to add to the team.
required: true
schema:
type: object
required:
- userIds
properties:
userIds:
type: array
items:
$ref: '#/definitions/ObjectId'
responses:
200:
description: Updated team entity
schema:
$ref: '#/definitions/Team'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
'/teams/{id}/channels':
post:
summary: Add channels to the team.
description: Add channels to the team and return updated team.
tags:
- teams
parameters:
- name: id
in: path
description: Id of the team.
required: true
type: string
pattern: '^[a-f0-9]{24}$'
- name: body
in: body
description: The channel ids that we want to add to the team.
required: true
schema:
type: object
required:
- channelIds
properties:
channelIds:
type: array
items:
$ref: '#/definitions/ObjectId'
responses:
200:
description: Updated team entity
schema:
$ref: '#/definitions/Team'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
'/teams/{id}/users/{userId}':
delete:
summary: Remove user from the team
description: Remove user from the team, update a team entity and return it.
tags:
- teams
parameters:
- name: id
in: path
description: Id of the team
required: true
type: string
pattern: '^[a-f0-9]{24}$'
- name: userId
in: path
description: Id of the user to be removed
required: true
type: string
pattern: '^[a-f0-9]{24}$'
responses:
200:
description: Updated team entity
schema:
$ref: '#/definitions/Team'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
404:
$ref: '#/responses/NotFoundError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
# PostGroups
'/cp/postGroups':
post:
summary: Creates a new postGroup.
description: 'Creates a new postGroup and empty posts within the postGroup for each channel provided. Also creates the necessary feedItems for the posts. If an error occured while creating posts, feedItems and postGroup the route will try to delete already created Items and return an error. Needed permissions: `EditPosts`'
tags:
- posts
parameters:
- name: body
in: body
description: The title of the new postGroup as well as a list of channel Ids for which to create empty posts within the group.
required: true
schema:
type: object
required:
- channelIds
properties:
channelIds:
type: array
items:
$ref: '#/definitions/ObjectId'
publishTime:
type: string
format: date-time
publishTimeZone:
type: string
description: Timezone name of the `publishTime` field. Valid values are the timezone names specified by momentjs (`moment.tz.names()`).
responses:
201:
description: The newly created postGroup entity.
schema:
$ref: '#/definitions/PostGroup'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
description: This error will be returned in case at least one of the channels is not available, deactive or user has no access to it.
schema:
$ref: '#/definitions/Error'
406:
$ref: '#/responses/NotAcceptableError'
409:
description: This error is returned if the user already has a postGroup with posts in preDraft state.
schema:
$ref: '#/definitions/Error'
500:
$ref: '#/responses/InternalServerError'
'/cp/ai/generateText':
post:
summary: Returns a AI generated text with hashtags based on a prompt in specified language
description: Returns a AI generated text with hashtags based on a prompt in specified language
tags:
- ai
parameters:
- name: body
in: body
required: true
schema:
type: object
required: ['prompt' ]
properties:
prompt:
type: string
description: 'prompt to generate text'
minLength: 10
language:
type: string
enum: ['english', 'german', 'french']
description: 'language of the generated text'
hashtags:
type: number
minimum: 0
default: 5
maximum: 30
description: 'number of hashtags to be included within the generated text'
characterLimit:
description: 'number of characters long of the generated text'
type: number
minimum: 10
default: 270
maximum: 500
responses:
200:
description: 'generated post'
schema:
type: object
properties:
result:
type: string
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
'/cp/postGroups/{id}':
delete:
summary: Deletes a postGroup.
description: 'Deletes the specified postGroup as well as all posts and feedItems of the postGroup (alpha). Images, videos, shortlinks etc. belonging to the posts should also be deleted (beta). Needed permissions: `EditPosts`'
tags:
- posts
parameters:
- name: id
in: path
description: Id of the postGroup to delete.
required: true
type: string
pattern: '^[a-f0-9]{24}$'
responses:
204:
description: Empty response in case of success.
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
description: "If the provided postGroupId can not be found"
schema:
$ref: '#/definitions/Error'
406:
$ref: '#/responses/NotAcceptableError'
409:
description: This error is returned if the there are posts from other users within the postGroup or there are already non preDraft posts.
schema:
$ref: '#/definitions/Error'
500:
$ref: '#/responses/InternalServerError'
'/cp/postGroups/{id}/duplicate':
post:
summary: Duplicate a postGroup
description: 'Creates a new postGroup by duplicating the posts of the specified one. The publishing options of the duplicated posts will be reset and their state will be that of a draft. Needed Permissions: `EditPosts`'
tags:
- posts
parameters:
- name: id
in: path
description: Id of the postGroup to duplicate.
required: true
type: string
pattern: '^[a-f0-9]{24}$'
responses:
201:
description: The duplicated postGroup entity.
schema:
type: object
properties:
postGroup:
$ref: '#/definitions/PostGroup'
results:
type: array
items:
type: object
properties:
postId:
description: id of the post in new post group
type: string
pattern: '^[a-f0-9]{24}$'
sourcePostId:
description: id of the post from source post group
type: string
pattern: '^[a-f0-9]{24}$'
success:
description: result of the duplication
type: boolean
notCopied:
description: array of the not copied entites
type: array
items:
type: string
enum: [ externalImages, externalVideos, externalAnimations ]
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
406:
$ref: '#/responses/NotAcceptableError'
500:
$ref: '#/responses/InternalServerError'
'/cp/posts/{id}/media/convert':
post:
summary: Converts some of the post's media to be complient with social network limits
description: 'Triggers a lambda function to created a copy of the media with updated metas, such as bitrate, to be complient with the post type and social network'
tags:
- posts
parameters:
- name: id
in: path
description: Id of the post
required: true
type: string
pattern: '^[a-f0-9]{24}$'
- name: body
in: body
description: A list of media Ids to convert.
required: true
schema:
type: object
required:
- mediaIds
properties:
mediaIds:
type: array
items:
$ref: '#/definitions/ObjectId'
responses:
200:
description: Contains the updated post object
schema:
$ref: '#/definitions/Post'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
406:
$ref: '#/responses/NotAcceptableError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
'/cp/posts/{id}/duplicate':
post:
summary: Creates duplicates of a post for each specified channel
description: 'For each of the specified channels a new post is created and then the contents from the specified post are copied (best-effort) onto the blank posts. Needed permissions: `EditPosts`. The user needs to have access to all specified channels (teams feature).'
tags:
- posts
parameters:
- name: id
in: path
description: Id of the post to duplicate
required: true
type: string
pattern: '^[a-f0-9]{24}$'
- name: body
in: body
description: A list of channel Ids for which to create duplicates for.
required: true
schema:
type: object
required:
- channelIds
properties:
channelIds:
type: array
items:
$ref: '#/definitions/ObjectId'
responses:
201:
description: Returns PostGroup of duplicated posts and result information of the best-effort copying process
schema:
type: object
properties:
postGroupId:
type: string
description: ID of the PostGroup where all duplicated posts can be found
results:
type: array
items:
type: object
properties:
postId:
type: string
description: id of the post
success:
type: boolean
description: was copy successfully executed
notCopied:
type: array
description: if copy was successfull may contain attributes that could not be copied
items:
type: string
enum: [ type, text, images, animations, videos, links, publishTime, tags ]
reason:
type: string
description: if copy fails contains the reason for it
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
406:
$ref: '#/responses/NotAcceptableError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
'/cp/posts/{id}/retweet':
post:
summary: Add retweet to the post
description: 'Specify a tweet that should be retweeted as part of a Twitter post.'
tags:
- posts
parameters:
- name: id
in: path
description: Id of the post to add retweet
required: true
type: string
pattern: '^[a-f0-9]{24}$'
- name: body
in: body
description: Url of tweet that should be retweeted
required: true
schema:
type: object
required:
- url
properties:
url:
type: string
responses:
200:
description: OK
schema:
$ref: '#/definitions/Post'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
406:
$ref: '#/responses/NotAcceptableError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
delete:
summary: Deletes retweet data from a post.
description: Deletes retweet data from a post.
tags:
- posts
parameters:
- name: id
in: path
description: Id of the post that has the retweet data.
required: true
type: string
responses:
200:
description: OK
schema:
$ref: '#/definitions/Post'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
409:
description: This error will be returned if the post is not a preDraft.
schema:
$ref: '#/definitions/Error'
500:
$ref: '#/responses/InternalServerError'
'/cp/postGroups/{id}/suggest':
post:
summary: Sets needsApproval status for posts of postGroup.
description: 'Updates all posts of the specified postGroup with status needsApproval. Removes *needsAttention* flag. Needed permissions: `EditPosts`'
tags:
- posts
- approval workflow
parameters:
- name: id
in: path
description: Id of the postGroup for which all posts should be updated.
required: true
type: string
pattern: '^[a-f0-9]{24}$'
responses:
200:
description: Empty response in case of success.
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
406:
$ref: '#/responses/NotAcceptableError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
'/cp/postGroups/{id}/posts':
patch:
summary: Updates all postGroups posts.
description: 'Allows to partially update all posts belonging to the specified postGroup. Needed Permissions: `EditPosts`'
tags:
- posts
parameters:
- name: id
in: path
description: Id of the postGroup to update posts of.
required: true
type: string
pattern: '^[a-f0-9]{24}$'
- name: body
in: body
required: true
description: Fields of the postGroup entity to update. The `_id` field will be ignored even if it is specified in the request body.
schema:
$ref: '#/definitions/Post'
responses:
200:
description: OK
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
406:
$ref: '#/responses/NotAcceptableError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
'/cp/postGroups/{id}/posts/copy':
post:
summary: Updates all postGroups posts.
description: 'Allows to partially update all posts belonging to the specified postGroup. In body defined fields will be copied from the specified post in the query parameters. Needed Permissions: `EditPosts`'
tags:
- posts
parameters:
- name: id
in: path
description: Id of the postGroup to update posts of.
required: true
type: string
pattern: '^[a-f0-9]{24}$'
- name: body
in: body
required: true
description: Fields of the postGroup entity to update. Currently `type`, `text`, `images`, `animations`, `videos`, `links`, `publishTime` and `tags` are allowed.
schema:
type: array
items:
type: string
enum: [ type, text, images, animations, videos, links, publishTime, tags ]
- name: postId
in: query
description: Id of the post to get the values from.
required: true
type: string
pattern: '^[a-f0-9]{24}$'
responses:
200:
description: resultes for all posts to which content was copied
schema:
type: array
items:
type: object
properties:
postId:
type: string
description: id of the post
success:
type: boolean
description: was copy successfully executed
notCopied:
type: array
description: if copy was successfull may contain attributes that could not be copied
items:
type: string
enum: [ type, text, images, animations, videos, links, publishTime, tags, externalImages, externalVideos, externalAnimations ]
reason:
type: string
description: if copy fails contains the reason for it
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
406:
$ref: '#/responses/NotAcceptableError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
'/cp/posts':
get:
summary: Lists the posts
description: 'Returns a pagable list of all posts belonging to the account according to specified filters. Needed Permission: `ViewPosts`'
tags:
- posts
parameters:
- $ref: '#/parameters/pagingOffset'
- $ref: '#/parameters/pagingCount'
- name: postGroupId
in: query
description: Filter posts by postGroup Id (alpha). If this parameter is set the route will also return posts of inactive channels as well as posts of channels the user does not have access to.
required: false
type: string
- name: status
in: query
description: Filter posts by status (The param could be an array or string)
required: false
type: array
items:
type: string
enum:
- preDraft
- draft
- scheduled
- publishing
- published
- failedToPublish
- needsApproval
- name: needsAttention
in: query
description: Filter posts by needsAttention flag
type: boolean
- name: imported
in: query
description: Filter posts by imported flag
type: boolean
- name: viaPublisherApp
in: query
description: Filter posts by viaPublisherApp
type: boolean
- name: promoted
in: query
description: Filter posts by promoted flag
type: boolean
- name: channelIds
in: query
description: Filter posts by channel Ids
required: false
type: array
items:
type: string
- name: assignees
in: query
description: Filter posts by user Ids of assignees
required: false
type: array
items:
type: string
- name: tags
in: query
description: Filter posts by tag Ids (all tags in the account)
required: false
type: array
items:
type: string
- name: search
in: query
description: Filter posts by text searching the posts contents.
required: false
type: string
- name: since
in: query
description: Filter posts by date since the specified ISODate string. The date field used for this filter is determined by the `sortBy` parameter.
required: false
type: string
format: date-time
- name: until
in: query
description: Filter posts by date until the specified ISODate string. The date field used for this filter is determined by the `sortBy` parameter.
required: false
type: string
format: date-time
- name: sortBy
in: query
description: Select the field to sort the results by. Either `createdTime` or `publishTime`. Default is `createdTime`.
type: string
enum:
- createdTime
- publishTime
default: createdTime
- name: order
in: query
description: Sets the sort order of the results. Either `asc` or `desc`. Default is `desc`.
type: string
enum:
- asc
- desc
default: desc
- name: selectedPostId
in: query
description: Sets the post with the given id to the begining of response data. Will throw an error if postGroupId filter is not set.
type: string
required: false
- name: groupBy
in: query
description: Aggregate posts by some criteria. Only postGroup aggregations supported at the moment. Does not work with selectedPostId parameter.
type: string
enum: [postGroup]
- name: storyWorkaroundPublisher
in: query
description: Filter story workaround posts by publisher id (user object id)
required: false
type: string
- name: type
in: query
required: false
description: Filter posts based on type
type: string
enum: ['POST', 'CAROUSEL', 'SLIDESHOW', 'TWEET', 'MEDIA', 'STORY', 'IGTV', 'STORY_WORKAROUND', 'REEL']
responses:
200:
description: Paginated list of posts
schema:
type: object
properties:
count:
type: number
description: The overall amount of posts for the current filters (for pagination).
data:
type: array
items:
$ref: '#/definitions/Post'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
406:
$ref: '#/responses/NotAcceptableError'
500:
$ref: '#/responses/InternalServerError'
post:
summary: Lists the posts
description: 'Returns a pagable list of all posts belonging to the account according to specified filters. Needed Permission: `ViewPosts`'
tags:
- posts
parameters:
- name: body
in: body
required: true
description: body containing filters
schema:
type: object
properties:
offset:
description: How many entities to skip when returning a list.
type: integer
count:
description: How many entities to show when returning a list.
type: integer
postGroupId:
description: Filter posts by postGroup Id (alpha). If this parameter is set the route will also return posts of inactive channels as well as posts of channels the user does not have access to.
type: string
status:
description: Filter posts by status (The param could be an array or string)
type: array
items:
type: string
enum:
- preDraft
- draft
- scheduled
- publishing
- published
- failedToPublish
- needsApproval
needsAttention:
description: Filter posts by needsAttention flag
type: boolean
imported:
description: Filter posts by imported flag
type: boolean
viaPublisherApp:
description: Filter posts by viaPublisherApp
type: boolean
promoted:
description: Filter posts by promoted flag
type: boolean
channelIds:
description: Filter posts by channel Ids
type: array
items:
type: string
assignees:
description: Filter posts by user Ids of assignees
type: array
items:
type: string
tags:
description: Filter posts by tag Ids (all tags in the account)
type: array
items:
type: string
search:
description: Filter posts by text searching the posts contents.
type: string
since:
description: Filter posts by date since the specified ISODate string. The date field used for this filter is determined by the `sortBy` parameter.
type: string
format: date-time
until:
description: Filter posts by date until the specified ISODate string. The date field used for this filter is determined by the `sortBy` parameter.
type: string
format: date-time
sortBy:
description: Select the field to sort the results by. Either `createdTime` or `publishTime`. Default is `createdTime`.
type: string
enum:
- createdTime
- publishTime
default: createdTime
order:
description: Sets the sort order of the results. Either `asc` or `desc`. Default is `desc`.
type: string
enum:
- asc
- desc
default: desc
selectedPostId:
description: Sets the post with the given id to the begining of response data. Will throw an error if postGroupId filter is not set.
type: string
groupBy:
description: Aggregate posts by some criteria. Only postGroup aggregations supported at the moment. Does not work with selectedPostId parameter.
type: string
enum: [postGroup]
storyWorkaroundPublisher:
description: Filter story workaround posts by publisher id (user object id)
type: string
useAndFilter:
description: Optional flag that when true would yeild AND results otherwise OR. The default value is false.
type: boolean
type:
description: Filter posts based on type
type: string
enum: ['POST', 'CAROUSEL', 'SLIDESHOW', 'TWEET', 'MEDIA', 'STORY', 'IGTV', 'STORY_WORKAROUND', 'REEL']
responses:
200:
description: Paginated list of posts
schema:
type: object
properties:
count:
type: number
description: The overall amount of posts for the current filters (for pagination).
data:
type: array
items:
$ref: '#/definitions/Post'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
406:
$ref: '#/responses/NotAcceptableError'
500:
$ref: '#/responses/InternalServerError'
'/cp/posts/exports/csv':
post:
summary: Exports the posts as CSV
description: 'Exports a list of all posts belonging to the account according to specified filters. Needed Permission: `ViewPosts`'
tags:
- posts
parameters:
- name: status
in: query
description: Filter posts by status
required: false
type: string
- name: needsAttention
in: query
description: Filter posts by needsAttention flag
type: boolean
- name: promoted
in: query
description: Filter posts by promoted flag
type: boolean
- name: body
in: body
required: true
description: body containing channelIds, teamIds and tags
schema:
type: object
properties:
channelIds:
type: array
items:
type: string
minItems: 10000
teamIds:
type: array
items:
type: string
minItems: 10000
assignees:
type: array
items:
type: string
minItems: 10000
- name: search
in: query
description: Filter posts by text searching the posts contents.
required: false
type: string
- name: since
in: query
description: Filter posts by date since the specified ISODate string. The date field used for this filter is determined by the `sortBy` parameter.
required: false
type: string
format: date-time
- name: until
in: query
description: Filter posts by date until the specified ISODate string. The date field used for this filter is determined by the `sortBy` parameter.
required: false
type: string
format: date-time
- name: sortBy
in: query
description: Select the field to sort the results by. Either `createdTime` or `publishTime`. Default is `createdTime`.
type: string
enum:
- createdTime
- publishTime
default: createdTime
- name: order
in: query
description: Sets the sort order of the results. Either `asc` or `desc`. Default is `desc`.
type: string
enum:
- asc
- desc
default: desc
responses:
200:
description: CSV file
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
406:
$ref: '#/responses/NotAcceptableError'
500:
$ref: '#/responses/InternalServerError'
'/cp/posts/export/pdf':
get:
summary: Exports content planner posts as PDF
description: 'Exports filtered list of posts in a PDF file. Needed Permission: `ViewPosts` and `ViewContentList`'
tags:
- posts
parameters:
- name: status
in: query
description: Filter posts by status
required: false
type: string
enum: ['draft', 'scheduled', 'publishing', 'published', 'failedToPublish', 'needsApproval']
- name: since
in: query
description: Filter posts by date since the specified ISODate string. The date field used for this filter is determined by the `sortBy` parameter.
required: false
type: string
format: date-time
- name: until
in: query
description: Filter posts by date until the specified ISODate string. The date field used for this filter is determined by the `sortBy` parameter.
required: false
type: string
format: date-time
- name: sortBy
in: query
description: Select the field to sort the results by. Either `createdTime` or `publishTime`. Default is `createdTime`.
type: string
enum:
- createdTime
- publishTime
default: createdTime
- name: order
in: query
description: Sets the sort order of the results. Either `asc` or `desc`. Default is `desc`.
type: string
enum:
- asc
- desc
default: desc
- name: needsAttention
in: query
description: Filter posts by needsAttention flag
type: boolean
- name: promoted
in: query
description: Filter posts by promoted flag
type: boolean
- name: channelIds
in: query
description: Filter posts by channel Ids
required: false
type: array
items:
type: string
- name: assignees
in: query
description: Filter posts by user Ids of assignees
required: false
type: array
items:
type: string
- name: search
in: query
description: Filter posts by text searching the posts contents
required: false
type: string
- name: tags
in: query
description: Filter posts by tag Ids
required: false
type: array
items:
type: string
- name: teamId
in: query
description: Filter posts by user team
required: false
type: string
- name: groupBy
in: query
description: Flag to group posts by weeks
required: false
type: string
enum: ['week']
- name: tz
in: query
description: Timezone to use for pdf generation
required: false
type: string
responses:
200:
description: PDF file
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
500:
$ref: '#/responses/InternalServerError'
post:
summary: Exports content planner posts as PDF
description: 'Exports filtered list of posts in a PDF file. Needed Permission: `ViewPosts` and `ViewContentList`'
tags:
- posts
parameters:
- name: status
in: query
description: Filter posts by status
required: false
type: string
enum: ['draft', 'scheduled', 'publishing', 'published', 'failedToPublish', 'needsApproval']
- name: since
in: query
description: Filter posts by date since the specified ISODate string. The date field used for this filter is determined by the `sortBy` parameter.
required: false
type: string
format: date-time
- name: until
in: query
description: Filter posts by date until the specified ISODate string. The date field used for this filter is determined by the `sortBy` parameter.
required: false
type: string
format: date-time
- name: sortBy
in: query
description: Select the field to sort the results by. Either `createdTime` or `publishTime`. Default is `createdTime`.
type: string
enum:
- createdTime
- publishTime
default: createdTime
- name: order
in: query
description: Sets the sort order of the results. Either `asc` or `desc`. Default is `desc`.
type: string
enum:
- asc
- desc
default: desc
- name: needsAttention
in: query
description: Filter posts by needsAttention flag
type: boolean
- name: promoted
in: query
description: Filter posts by promoted flag
type: boolean
- name: channelIds
in: query
description: Filter posts by channel Ids
required: false
type: array
items:
type: string
- name: assignees
in: query
description: Filter posts by user Ids of assignees
required: false
type: array
items:
type: string
- name: search
in: query
description: Filter posts by text searching the posts contents
required: false
type: string
- name: tags
in: query
description: Filter posts by tag Ids
required: false
type: array
items:
type: string
- name: teamId
in: query
description: Filter posts by user team
required: false
type: string
- name: groupBy
in: query
description: Flag to group posts by weeks
required: false
type: string
enum: ['week']
- name: tz
in: query
description: Timezone to use for pdf generation
required: false
type: string
responses:
200:
description: PDF file
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
500:
$ref: '#/responses/InternalServerError'
'/cp/posts/aggregates/day':
post:
summary: Aggregated Post information
description: 'Returns aggregated information about posts within the specified timerange on a daily basis. This is intended to be used for the Monthly Calendar view. Needed Permission: `ViewPosts`'
tags:
- posts
parameters:
- name: body
in: body
required: true
schema:
type: object
properties:
channelIds:
type: array
uniqueItems: true
maxItems: 10000
items:
type: string
format: objectId
example: [ 'id1', 'id2' ]
assignees:
type: array
uniqueItems: true
maxItems: 10000
items:
type: string
format: objectId
example: [ 'id3', 'id4' ]
tags:
type: array
uniqueItems: true
maxItems: 10000
items:
type: string
format: objectId
example: [ 'tag1', 'tag2' ]
since:
type: string
format: date-time
example: '2023-11-17T12:00:00Z'
until:
type: string
format: date-time
example: '2023-11-30T12:00:00Z'
tz:
type: string
default: 'Europe/Berlin'
enum:
- 'Europe/Berlin'
# Add other supported timezones here if needed
example: 'Europe/Berlin'
status:
type: array
maxItems: 7
items:
type: string
enum:
- 'preDraft'
- 'draft'
- 'scheduled'
- 'publishing'
- 'published'
- 'failedToPublish'
- 'needsApproval'
example: [ 'preDraft', 'scheduled' ]
type:
type: array
items:
type: string
enum:
- 'POST'
- 'CAROUSEL'
- 'SLIDESHOW'
- 'TWEET'
- 'MEDIA'
- 'STORY'
- 'IGTV'
- 'STORY_WORKAROUND'
- 'REEL'
- 'POST_WORKAROUND'
example: [ 'POST', 'MEDIA' ]
needsAttention:
type: boolean
example: true
viaPublisherApp:
type: boolean
example: false
imported:
type: boolean
example: false
required:
- since
- until
responses:
200:
description: List of post aggregates.
schema:
type: array
items:
$ref: '#/definitions/PostAggregate'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
406:
$ref: '#/responses/NotAcceptableError'
500:
$ref: '#/responses/InternalServerError'
'/cp/posts/aggregates/day/list':
post:
summary: Aggregated Post information
description: 'Returns aggregated information about posts within the specified timerange on a daily basis. This is intended to be used for the Monthly Calendar view. Needed Permission: `ViewPosts`'
tags:
- posts
parameters:
- name: since
in: query
description: Filter posts by (scheduled) publishTime since the specified ISODate string.
required: true
type: string
format: date-time
- name: until
in: query
description: Filter posts by (scheduled) publishTime until the specified ISODate string.
required: true
type: string
format: date-time
- name: tz
in: query
description: User timezone name (Europe/Berlin by default). Determines the start and end time of the days in the aggregates and should therefore be based on the client time.
type: string
default: Europe/Berlin
- name: body
in: body
required: true
description: body containing channelIds, teamIds and tags
schema:
type: object
properties:
channelIds:
type: array
items:
type: string
minItems: 10000
teamIds:
type: array
items:
type: string
minItems: 10000
tags:
type: array
items:
type: string
minItems: 10000
responses:
200:
description: List of post aggregates.
schema:
type: array
items:
$ref: '#/definitions/PostAggregate'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
406:
$ref: '#/responses/NotAcceptableError'
500:
$ref: '#/responses/InternalServerError'
'/cp/posts/{id}':
patch:
summary: Updates a post.
description: 'Allows partial updatees of the specified post. Needed permissions: `EditPosts`'
tags:
- posts
parameters:
- name: id
in: path
description: Id of the post.
required: true
type: string
- name: body
in: body
required: true
description: Fields of the post entity to update. The `_id` field will be ignored even if it is specified in the request body. We get the time zone offset from the publishTime and set it for publishTimeZone.
schema:
$ref: '#/definitions/Post'
responses:
200:
description: updated post
schema:
$ref: '#/definitions/Post'
400:
$ref: '#/responses/ValidationError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
406:
$ref: '#/responses/NotAcceptableError'
500:
$ref: '#/responses/InternalServerError'
delete:
summary: Deletes a post.
description: 'Deletes the specified Post and unused media and links. Only allowed for preDraft posts. Also the postGroup will be deleted if the post is the last one. Needed permissions `EditPosts`'
tags:
- posts
parameters:
- name: id
in: path
description: Id of the post that should be deleted.
required: true
type: string
- name: force
in: query
description: Delete post only from our system and skip deletion from network
required: false
default: false
type: boolean
responses:
204:
description: OK
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
406:
$ref: '#/responses/NotAcceptableError'
409:
description: This error will be returned if the post is not a preDraft.
schema:
$ref: '#/definitions/Error'
500:
$ref: '#/responses/InternalServerError'
'/cp/posts/{id}/approvalRequests':
get:
summary: Returns post for which approval was requested.
description: 'Returns the post. Authenticates user by json web token.'
tags:
- posts
- approval workflow
parameters:
- name: id
in: path
description: Id of the post.
required: true
type: string
- name: access_token
in: query
description: JSON web token that was created on approval request creation.
type: string
required: true
responses:
200:
description: Requested post
schema:
$ref: '#/definitions/Post'
400:
$ref: '#/responses/BadRequestError'
401:
description: JSON web token is not valid.
schema:
$ref: '#/definitions/Error'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
post:
summary: Creates post approval request for a given emails.
description: 'Changes the status of the specified post to `needsApproval`. Removes *needsAttention* flag. Needed permissions: `ApprovalRequest`'
tags:
- posts
- approval workflow
parameters:
- name: id
in: path
description: Id of the suggested post.
required: true
type: string
- name: body
in: body
required: true
description: body containing emails to send approval request to and optional note
schema:
type: object
properties:
emails:
type: array
items:
type: string
format: email
minItems: 1
note:
type: string
subject:
type: string
required: [emails]
responses:
201:
description: No Content
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
'/cp/posts/{id}/approvalRequests/approve':
post:
summary: Approves post by json web token.
description: 'Changes the status of the specified post to `scheduled`. Removes *needsAttention* flag.'
tags:
- posts
- approval workflow
parameters:
- name: id
in: path
description: Id of the suggested post.
required: true
type: string
- name: access_token
in: query
description: JSON web token that was created on approval request creation.
type: string
required: true
responses:
200:
description: Approved post
schema:
$ref: '#/definitions/Post'
400:
$ref: '#/responses/BadRequestError'
401:
description: JSON web token is not valid.
schema:
$ref: '#/definitions/Error'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
'/cp/posts/{id}/approvalRequests/reject':
post:
summary: Rejects post by json web token.
description: 'Changes the status of the specified post to `draft`. Sets *needsAttention* flag. Assignes post to suggestion author. Sends mail to suggestions author.'
tags:
- posts
- approval workflow
parameters:
- name: id
in: path
description: Id of the suggested post.
required: true
type: string
- name: access_token
in: query
description: JSON web token that was created on approval request creation.
type: string
required: true
- name: body
in: body
required: true
description: body containing a note with the reason of rejection
schema:
type: object
properties:
note:
type: string
minLength: 1
required: [note]
responses:
200:
description: Rejected post
schema:
$ref: '#/definitions/Post'
400:
$ref: '#/responses/BadRequestError'
401:
description: JSON web token is not valid.
schema:
$ref: '#/definitions/Error'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
'/cp/posts/{id}/links':
post:
summary: Gets preview to a link and adds link to post.
description: 'Requests a link preview from Facebook, creates a link object for the preview and adds the link to the specified post. Needed permissions: `EditPosts`'
tags:
- posts
parameters:
- name: id
in: path
description: Id of the post to which the link should be added.
required: true
type: string
- name: body
in: body
required: true
description: body containing the url that should be added to the specified post
schema:
type: object
properties:
url:
type: string
format: uri
scrape:
type: boolean
responses:
200:
description: updated post
schema:
$ref: '#/definitions/Post'
400:
description: This error will be returned if fetching the link data from Facebook failed.
schema:
$ref: '#/definitions/Error'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
'/cp/posts/{id}/suggest':
post:
summary: Moves status of post to `needsApproval`
description: 'Changes the status of the specified post to `needsApproval`. Removes *needsAttention* flag. Needed permissions: `EditPosts`'
tags:
- posts
- approval workflow
parameters:
- name: id
in: path
description: Id of the post that should be moved to `needsApproval`
required: true
type: string
responses:
200:
description: updated post
schema:
$ref: '#/definitions/Post'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
406:
$ref: '#/responses/NotAcceptableError'
409:
description: This error is returned if the post has the status `preDraft`.
schema:
$ref: '#/definitions/Error'
500:
$ref: '#/responses/InternalServerError'
'/cp/posts/{id}/approve':
post:
summary: Moves status of post to `scheduled`
description: 'Changes the status of the specified post to `scheduled`. Can obly be called for posts with status `needsApproval`. Removes *needsAttention* flag. Needed permissions: `ApprovePosts` or `ApproveOwnPosts` for own posts'
tags:
- posts
- approval workflow
parameters:
- name: id
in: path
description: Id of the post that should be approved
required: true
type: string
responses:
200:
description: updated post
schema:
$ref: '#/definitions/Post'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
406:
$ref: '#/responses/NotAcceptableError'
500:
$ref: '#/responses/InternalServerError'
'/cp/posts/{id}/reject':
post:
summary: Moves status of post to `draft`
description: 'Changes the status of the specified post to `draft`. Post will be assigned to suggestionAuthor. Also can add a new comment to feed of post. Sets *needsAttention* flag. Needed permissions: `RejectPost`'
tags:
- posts
- approval workflow
parameters:
- name: id
in: path
description: Id of the post that should be rejected
required: true
type: string
- name: body
in: body
description: Comment why the post was rejected
required: false
schema:
type: 'object'
properties:
message:
type: string
minLength: 1
responses:
200:
description: updated post
schema:
$ref: '#/definitions/Post'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
406:
$ref: '#/responses/NotAcceptableError'
500:
$ref: '#/responses/InternalServerError'
'/cp/posts/{id}/schedule':
post:
summary: Moves status of post to `scheduled`
description: 'Changes status of specified post to `scheduled`. Only works if post has publishTime set. Removes *needsAttention* flag. Needed permissions: `PublishPosts`'
tags:
- posts
parameters:
- name: id
in: path
description: Id of the post that should be scheduled
required: true
type: string
responses:
200:
description: updated post
schema:
$ref: '#/definitions/Post'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
406:
$ref: '#/responses/NotAcceptableError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
'/cp/posts/{id}/publish':
post:
summary: Moves status of post to `scheduled`
description: 'Changes status of specified post to `scheduled`. Only works if post has publishTime not yet set. Will set publishTime to now. Needed permissions: `PublishPosts`'
tags:
- posts
parameters:
- name: id
in: path
description: Id of the post that should be scheduled
required: true
type: string
responses:
200:
description: updated post
schema:
$ref: '#/definitions/Post'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
406:
$ref: '#/responses/NotAcceptableError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
'/cp/posts/{id}/published':
post:
summary: Mark Story workaround post as `published`
description: 'Changes status of specified story workaround post to `published`. Only works if post is type of workaround and user who is calling this endpoint is set as workaround post publisher'
tags:
- posts
parameters:
- name: id
in: path
description: Id of the post that should be marked as published
required: true
type: string
pattern: '^[a-f0-9]{24}$'
responses:
200:
description: updated post
schema:
$ref: '#/definitions/Post'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
406:
$ref: '#/responses/NotAcceptableError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
'/cp/posts/{id}/forcePublishFirstComment':
post:
summary: Force publish of first comment for Facebook, IG and LinkedIn (in case that auto comment publishing failed)
description: 'Force publish of first comment for Facebook, IG and LinkedIn (in case that auto comment publishing failed). Permission required: `PublishPosts`'
tags:
- posts
parameters:
- name: id
in: path
description: Id of the post that has failed publishing comment that should be published
required: true
type: string
pattern: '^[a-f0-9]{24}$'
responses:
200:
description: updated post
schema:
$ref: '#/definitions/Post'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
406:
$ref: '#/responses/NotAcceptableError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
'/cp/posts/{id}/channel':
put:
summary: Changes channel of the post
description: 'Changes channel of the post and removes unsupported content. Needed permissions: `EditPosts`'
tags:
- posts
parameters:
- name: id
in: path
description: Id of the post you want to change the channel for
required: true
type: string
- name: body
in: body
required: true
schema:
type: object
required: ['id']
properties:
id:
type: string
description: id of the channel to set
responses:
200:
description: updated post and array of not copied entities
schema:
type: object
properties:
notCopied:
type: array
description: Array of not copied entities
items:
type: string
post:
$ref: '#/definitions/Post'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
'/cp/postGroups/preDraft':
get:
summary: Returns current working postGroup
description: 'Searches for a post with status `preDraft` of the current user, loads the postGroup for it and returns the postGroup. If the user has no active preDraft HTTP 404 will be returned. Needed permissions:`ViewPosts`'
tags:
- posts
responses:
200:
description: current working postGroup of user
schema:
$ref: '#/definitions/PostGroup'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
'/cp/postGroups/{id}/saveAsDraft':
post:
summary: Moves status of all posts of postGroup to `draft`
description: 'Changes status of all posts within specified postGroup to `draft`. This can only be done for posts with status `preDraft` and were the user is author. If a preDraft post was already assigned to another person an email notification has to be sent at this point. Also feedItems will be created for saving posts as drafts and for assigning posts to another user. Needed permissions: `EditPosts`'
tags:
- posts
parameters:
- name: id
in: path
description: Id of the postGroup for which all posts should be saved as draft.
required: true
type: string
responses:
200:
description: OK
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
409:
description: This error is returned if the there are posts from other users within the postGroup or there are already non preDraft posts.
schema:
$ref: '#/definitions/Error'
500:
$ref: '#/responses/InternalServerError'
'/cp/postGroups/{id}/schedule':
post:
summary: Moves status of all post of postGroup to `scheduled`
description: 'Changes status of all posts the user has access to within specified postGroup to `scheduled`. This is only possible if all posts have publishTime set and if the user has access to all existing preDraft posts (if any exist). If a preDraft post was already assigned to another person an email notification has to be sent at this point. Removes *needsAttention* flag. Needed permissions: `PublishPosts`'
tags:
- posts
parameters:
- name: id
in: path
description: Id of the postGroup for which all posts should be scheduled.
required: true
type: string
responses:
200:
description: OK
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
409:
description: If at least one post has no publishTime set or if the user does not have access to at least one posts with status `preDraft`
schema:
$ref: '#/definitions/Error'
500:
$ref: '#/responses/InternalServerError'
'/cp/postGroups/{id}/publish':
post:
summary: Moves status of all post of postGroup to `scheduled`
description: 'Changes status of all posts the user has access to within specified postGroup to `scheduled`. This is only possible if no post has a publishTime set and if the user has access to all existing preDraft posts (if any exist). If a preDraft post was already assigned to another person an email notification has to be sent at this point. Needed permissions: `PublishPosts`'
tags:
- posts
parameters:
- name: id
in: path
description: Id of the postGroup for which all posts should be scheduled.
required: true
type: string
responses:
200:
description: OK
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
409:
description: If at least one post has publishTime set or if the user does not have access to at least one posts with status `preDraft`
schema:
$ref: '#/definitions/Error'
500:
$ref: '#/responses/InternalServerError'
'/cp/posts/counts':
get:
summary: Get a List of counts for post states
description: Returns an object containing counts of posts for several states. Intended for the left sidebar counts.
tags:
- posts
responses:
200:
description: Count object for each needed status a post can have.
schema:
type: object
properties:
draft:
type: number
needsApproval:
type: number
scheduled:
type: number
needsAttention:
type: number
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
500:
$ref: '#/responses/InternalServerError'
'/cp/posts/{id}/feed':
get:
summary: Lists feed items for a post
description: 'Returns a pagable list of all feed items belonging to the specified post. Needed permissions: `ViewCollaborationTab`, `EditPosts`'
tags:
- feed
- posts
parameters:
- name: id
in: path
description: Id of the post for which to return the feed items.
required: true
type: string
- $ref: '#/parameters/pagingOffset'
- $ref: '#/parameters/pagingCount'
responses:
200:
description: Paginated list of post feed items
schema:
type: object
properties:
count:
type: number
description: The overall amount of posts for the current filters (for pagination).
data:
type: array
items:
$ref: '#/definitions/FeedItem'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
post:
summary: Creating a new comment.
description: 'Creating a new comment and adding it to the feed of the specified post. Needed permissions: `CreateComment`'
tags:
- feed
- posts
parameters:
- name: id
in: path
description: Id of the post for which to return the feed items.
required: true
type: string
- name: body
in: body
description: Data for the new comment.
required: true
schema:
type: object
properties:
message:
type: string
mentions:
type: array
items:
$ref: '#/definitions/ObjectId'
responses:
201:
description: Created feed item.
schema:
$ref: '#/definitions/FeedItem'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
'/cp/posts/{id}/unschedule':
post:
summary: Moves a scheduled Post to draft status.
description: 'Updates a scheduled post and sets the status back to draft. Needed permissions: `PublishPosts`'
tags:
- posts
parameters:
- name: id
in: path
description: Id of the post for which to return the feed items.
required: true
type: string
responses:
200:
description: updated post
schema:
$ref: '#/definitions/Post'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
'/cp/postGroups/{id}/addPost':
post:
summary: Adds a new post to the existing postGroup
description: 'Creates a new post for the postGroup if the postGroup has no posts of different channels. Needed permissions: `EditPosts`'
tags:
- posts
parameters:
- name: id
in: path
description: Id of the postGroup you want to add a post for.
required: true
type: string
- name: channelId
in: query
description: Id of the channel to create a post for.
type: string
pattern: '^[a-f0-9]{24}$'
- name: postId
in: query
required: false
description: Id of the post to copy content from.
type: string
pattern: '^[a-f0-9]{24}$'
responses:
200:
description: created post
schema:
type: object
properties:
notCopied:
type: array
description: Array of not copied entities
items:
type: string
post:
$ref: '#/definitions/Post'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
# Fonts
'/fonts':
get:
summary: Returns all account fonts
description: Returns account fonts. Requires UseMediaEditor permission.
tags:
- fonts
responses:
200:
description: List of font documents with populated media
schema:
type: array
items:
$ref: '#/definitions/Font'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
500:
$ref: '#/responses/InternalServerError'
post:
summary: Creates a new font for account
description: Creates a new font. Requires UseMediaEditor permission.
tags:
- fonts
parameters:
- name: body
in: body
required: true
schema:
type: object
required: ['fontFamily', 'identifier', 'mediaIds']
properties:
fontFamily:
type: string
identifier:
type: string
styles:
type: object
properties:
fontWeight:
type: string
enum: ['normal', 'bold', 'lighter', 'bolder', '100', '200', '300', '400', '500', '600', '700', '800', '900']
fontStyle:
type: string
enum: ['normal', 'italic']
mediaIds:
type: array
minItems: 1
items:
type: string
pattern: '^[a-f0-9]{24}$'
responses:
201:
description: Created font document with populated media
schema:
$ref: '#/definitions/Font'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
'/fonts/{fontId}':
patch:
summary: Updates existing font
description: Updates account font. Requires UseMediaEditor permission.
tags:
- fonts
parameters:
- name: fontId
in: path
description: Id of the font to update
required: true
type: string
- name: body
in: body
required: true
schema:
type: object
properties:
fontFamily:
type: string
identifier:
type: string
styles:
type: object
properties:
fontWeight:
type: string
enum: ['normal', 'bold', 'lighter', 'bolder', '100', '200', '300', '400', '500', '600', '700', '800', '900']
fontStyle:
type: string
enum: ['normal', 'italic']
mediaIds:
type: array
minItems: 1
items:
type: string
pattern: '^[a-f0-9]{24}$'
responses:
200:
description: Updated font document with populated media
schema:
$ref: '#/definitions/Font'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
delete:
summary: Deletes a font
description: Deletes account font. Requires UseMediaEditor permission.
tags:
- fonts
parameters:
- name: fontId
in: path
description: Id of the font to delete
required: true
type: string
responses:
204:
description: Empty response in case of success
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
500:
$ref: '#/responses/InternalServerError'
# Folders
'/inbox/folders':
get:
summary: List of folders
description: Returns an array of folders by account
tags:
- folders
parameters:
- name: count
in: query
description: Max number of folders to return.
type: number
minimum: 0
maximum: 500
default: 25
- name: offset
in: query
description: folders offset.
type: number
minimum: 0
default: 0
responses:
200:
description: Folder that was created.
schema:
type: array
items:
$ref: '#/definitions/Folder'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
500:
$ref: '#/responses/InternalServerError'
post:
summary: Adds a folder
description: Creates a folder with a unique name
tags:
- folders
parameters:
- name: body
in: body
required: true
schema:
type: object
properties:
name:
description: name of folder to add
type: 'string'
maxLength: 255
filters:
type: object
properties:
channelIds:
description: channelIds of folder filters
type: array
items:
type: string
format: objectId
minLength: 1
maxLength: 1000
ticketTypes:
description: ticket types of folder filters
type: array
items:
type: string
enum: ['POST', 'COMMENT', 'MESSAGE', 'DM', 'RATING', 'DARKCOMMENT', 'MENTION']
responses:
201:
description: Folder that was created.
schema:
$ref: '#/definitions/Folder'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
'/inbox/folders/{id}':
patch:
summary: Changes name of a folder
description: Updates a folder's name with a unique name
tags:
- folders
parameters:
- name: id
in: path
description: ID of the folder to update.
required: true
type: string
- name: body
in: body
required: true
schema:
type: object
properties:
name:
description: new name of folder
type: 'string'
maxLength: 255
filters:
type: object
properties:
channelIds:
description: channelIds of folder filters
type: array
items:
type: string
format: objectId
minLength: 1
maxLength: 1000
ticketTypes:
description: ticket types of folder filters
type: array
items:
type: string
enum: ['POST', 'COMMENT', 'MESSAGE', 'DM', 'RATING', 'DARKCOMMENT', 'MENTION']
responses:
200:
description: Folder that was updated.
schema:
$ref: '#/definitions/Folder'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
delete:
summary: Deletes a folder
description: Deletes a folder
tags:
- folders
parameters:
- name: id
in: path
description: ID of the folder to delete.
required: true
type: string
responses:
204:
description: Empty response in case of success
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
'/inbox/folders/reorder':
post:
summary: Update a folder's index
description: Update a folder's index and reorder all folders
tags:
- folders
parameters:
- name: body
in: body
required: true
schema:
type: object
properties:
folderId:
description: id of folder to reorder
type: 'string'
format: objectId
index:
description: new index to set for the folder
type: number
minimum: 0
maximum: 9
responses:
204:
description: No Content
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
# Link shortening
'/shortlinks':
post:
summary: Shortens a list of links
description: Returns shortened links for an array of urls.
tags:
- link shortening
parameters:
- name: body
in: body
required: true
description: List of URLs to be shortened.
schema:
type: array
items:
type: string
format: uri
responses:
200:
description: List of shortlink documents
schema:
type: array
items:
$ref: '#/definitions/Shortlink'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
500:
$ref: '#/responses/InternalServerError'
# Media routes.
'/media':
post:
summary: Begin the creation of a new media
description: 'This route allows uploading media files that can be referenced in other SocialHub objects. It will return a list of URLs, the client needs to split the file the user wants to upload into multiple parts – for each URL one part. The client then does a PUT request to each of these URLs with the request body containing one chunk of the file to upload. After the client has finished uploading all parts, it will call the GET or PATCH route of the newly created media resource in order to obtain an URL the media can be reached from. Required permission: `EditPosts`'
tags:
- media
parameters:
- name: body
in: body
required: true
schema:
type: object
properties:
name:
description: The original filename
type: 'string'
pattern: '^[0-9a-zA-Z_\-. ]+$'
size:
description: The files size in bytes (the amount of parts will be determined by this)
type: 'number'
minimum: 1
expirationTime:
description: If set, the media will automatically be deleted after this date
type: 'string'
format: 'date-time'
required: ['name', 'size']
responses:
201:
description: The newly created media document AND a list of URLs to upload file parts to contained in the field `partUrls`.
schema:
$ref: '#/definitions/Media'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
406:
$ref: '#/responses/NotAcceptableError'
500:
$ref: '#/responses/InternalServerError'
'/media/{id}':
get:
summary: Returns media information
description: Returns all available information about the media. Note that fields like `thumbnails` and `image` take a few seconds to be created. You can not rely on the thumbnails field always being available, therefore there should be an automatic fallback to the original media file (`url` field). This route or the PATCH route must be called after uploading all file parts to signal the uploads completition and trigger the generation of thumbnails. If it is called before all parts are uploaded the `url` field will be missing.
tags:
- media
parameters:
- name: id
in: path
description: Id of the media
required: true
type: string
responses:
200:
description: Media object
schema:
$ref: '#/definitions/Media'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
406:
$ref: '#/responses/NotAcceptableError'
500:
$ref: '#/responses/InternalServerError'
patch:
summary: Partially update media information
description: 'You can use this route to rename a media file and to set an expiration date to automatically delete the media after the specified date. It is not allowed to change the file type, if renaming the media causes the mime-type to change the request will be rejected. The purpose of the `expirationTime` field is to prevent unusued media files: After all file parts are uploaded you can call this route to signal the completition and trigger the generation of thumbnails. Additionally you can set an expirationTime that ensures that if the user leaves the page without actually using the media, it will be automatically deleted after the specified date. If the user decided to actually use the media, this route should be called again setting the expirationTime to `null`. This route or the GET route must be called after uploading all file parts to signal the uploads completition and trigger the generation of thumbnails. If it is called before all parts are uploaded the `url` field will be missing from the response.'
tags:
- media
parameters:
- name: id
in: path
description: Id of the media
required: true
type: string
- name: body
in: body
required: false
schema:
type: object
properties:
name:
description: The media filename
type: 'string'
pattern: '^[0-9a-zA-Z_\-. ]+$'
expirationTime:
description: If set, the media will automatically be deleted after this date
type: 'string'
format: 'date-time'
responses:
201:
description: The updated media
schema:
$ref: '#/definitions/Media'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
406:
$ref: '#/responses/NotAcceptableError'
500:
$ref: '#/responses/InternalServerError'
delete:
summary: Deletes media files and aborts its upload
description: If this route is called before all parts of a file are uploaded the upload will be gracefully aborted (call this if the user decides to abort the upload). If this route is called for a file that has been uploaded successfully, the original file and all files associated to it (eg. thumbnails) will be deleted (call this if the user decides against using the media after uploading it).
tags:
- media
parameters:
- name: id
in: path
description: Id of the media
required: true
type: string
responses:
204:
description: No Content
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
406:
$ref: '#/responses/NotAcceptableError'
500:
$ref: '#/responses/InternalServerError'
'/media/proxy/{resource}/{id}':
get:
summary: Proxy route for expired network media
description: Updates the resource with fresh media urls and proxies selected one.
tags:
- media
parameters:
- name: resource
in: path
description: Resource the media belongs to
required: true
type: string
enum: ['ticket', 'post']
- name: id
in: path
description: Id of the resource the media belongs to
required: true
type: string
pattern: '^[a-f0-9]{24}$'
- name: mediaId
in: query
description: Id of the media to proxy.
type: string
pattern: '^[a-f0-9]{24}$'
responses:
302:
description: Redirects to requested media
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
# Facebook specfic routes.
'/cp/networks/facebook/targeting':
get:
summary: Loads targeting options from Facebook
description: 'Returns arrays of Facebook targeting options for the requested types in the query. Needed permissions: `SearchFacebookTargeting`'
tags:
- facebook
parameters:
- name: type
in: query
required: true
description: Defines which type of targeting options you want to request. Can be `adlocale`, `audienceinterest` or `adgeolocation`.
type: array
items:
type: string
enum: [ adlocale, audienceinterest, adgeolocation ]
- name: channelId
in: query
required: false
description: Defines which channels accessToken should be used to search for targeting options. Required if type `adgeolocations` is requested.
type: string
pattern: '^[a-f0-9]{24}$'
- name: country_code
in: query
description: Defines the country we want to search regions or cities for. This requires `adgeolocation` specified in `types` parameter and is required by `location_types` parameter
type: string
- name: location_types
in: query
description: Defines what you are looking for. Can be `country`, `country_group`, `region`, `city` or `zip`. Requires the parameters `q` and `adgeolocation` in `type` parameter
type: array
items:
type: string
enum:
- 'country'
- 'country_group'
- 'region'
- 'city'
- 'zip'
- name: q
in: query
description: Searches for options which contain the string. This will be used for all options defined in the `types` parameter
required: false
type: string
responses:
200:
description: Object of arrays for Facebook options for types
schema:
type: object
properties:
locales:
type: array
items:
type: object
properties:
name:
type: string
key:
type: number
countries:
type: array
items:
type: object
properties:
country_code:
type: string
name:
type: string
supports_region:
type: string
supports_city:
type: string
locations:
type: array
items:
type: object
properties:
key:
type: string
name:
type: string
type:
type: string
country_code:
type: string
country_name:
type: string
region:
type: string
region_id:
type: number
supports_region:
type: boolean
supports_city:
type: boolean
interests:
type: array
items:
type: object
properties:
id:
type: string
name:
type: string
audience_size_lower_bound:
type: number
audience_size_upper_bound:
type: number
path:
type: array
items:
type: string
description:
type: string
topic:
type: string
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
406:
$ref: '#/responses/NotAcceptableError'
500:
$ref: '#/responses/InternalServerError'
'/networks/facebook/mentions':
get:
summary: Searches for mentionable Facebook entities.
description: 'Returns array of Facebook pages (and later also users) for the provided query string.'
tags:
- facebook
parameters:
- name: q
in: query
description: Searches for Facebook entities that contain this string.
required: true
type: string
- name: channelId
in: query
description: For which channel the possible mentions should be searched.
required: true
type: string
responses:
200:
description: Array of mentionable Facebook entities.
schema:
type: array
items:
type: object
properties:
name:
type: string
description: Human readable name of the entity.
id:
type: string
description: Identifier of the entity.
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
500:
$ref: '#/responses/InternalServerError'
'/networks/facebook/pages':
get:
summary: Returns user pages from facebook.
description: Returns pages user has access to on facebook. Requires EditChannels and ViewAccountSettings permissions.
tags:
- facebook
parameters:
- name: limit
in: query
description: Max number of pages to return.
type: number
minimum: 0
maximum: 500
default: 150
- name: offset
in: query
description: Pages offset.
type: number
minimum: 0
default: 0
- name: fields
in: query
description: Type of fields to use in request.
type: string
enum: [all, facebook, instagram]
- name: after
in: query
description: After cursor for the request.
type: string
responses:
200:
description: Facebook API response. Depends on the type of requested fields. If page is already connected to account, object would have `status` field with `connected` value.
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
500:
$ref: '#/responses/InternalServerError'
'/networks/facebook/pages/{pageId}/locations':
get:
summary: Returns facebook page locations.
description: Returns locations of given facebook page. Requires EditChannels and ViewAccountSettings permissions.
tags:
- facebook
parameters:
- name: pageId
in: path
description: Id of the page to fetch locations for.
required: true
type: string
- name: limit
in: query
description: Max number of locations to return.
type: number
minimum: 0
maximum: 500
default: 25
- name: after
in: query
description: After cursor for the request.
type: string
responses:
200:
description: Facebook API response. If page is already connected to account, object would have `status` field with `connected` value.
schema:
type: object
properties:
data:
type: array
items:
type: object
properties:
picture:
type: object
properties:
data:
type: object
properties:
height:
type: number
width:
type: number
is_silhouette:
type: boolean
url:
type: string
access_token:
type: string
name:
type: string
link:
type: string
username:
type: string
name_with_location_descriptor:
type: string
store_location_descriptor:
type: string
is_published:
type: boolean
location:
type: object
properties:
city:
type: string
country:
type: string
latitude:
type: number
longitude:
type: number
street:
type: string
zip:
type: string
id:
type: string
status:
type: string
paging:
type: object
properties:
cursors:
type: object
properties:
before:
type: string
after:
type: string
previous:
type: string
next:
type: string
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
500:
$ref: '#/responses/InternalServerError'
'/networks/facebook/pages/{pageId}/settings':
get:
summary: Returns facebook page settings.
description: Returns settings of given facebook page. Requires EditChannels and ViewAccountSettings permissions.
tags:
- facebook
parameters:
- name: pageId
in: path
description: Id of the page to fetch settings for.
required: true
type: string
responses:
200:
description: Facebook API response.
schema:
type: object
properties:
data:
type: array
items:
type: object
properties:
setting:
type: string
value:
type: boolean
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
500:
$ref: '#/responses/InternalServerError'
'/networks/facebook/oauth/connect/{network}':
get:
summary: Initiates oauth process on facebook.
description: 'Initiates oauth process on facebook to get access token to connect channels/adaccounts'
tags:
- facebook
parameters:
- name: network
in: path
description: Network to get token for.
required: true
type: string
enum: ['facebook', 'instagram', 'adaccount']
- name: pageId
in: query
description: Network Page Id to get token for.
type: string
pattern: '^[0-9]+$'
- name: channelId
in: query
description: SocialHub channelId for which to add (or refresh) the accessToken.
type: string
pattern: '^[a-f0-9]{24}$'
- name: redirectSource
in: query
description: What action triggered the connect and defines handling on redirect back after connect. `addChannel` -> adding a new Channel. `addAccessToken` -> adding (or refreshing) the token for a single channel. `refreshTokens` -> refresh tokens of all active channels of the fb user.
type: string
enum:
- addChannel
- addAccessToken
- refreshTokens
responses:
302:
description: Redirects to facebook oauth page.
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
500:
$ref: '#/responses/InternalServerError'
'/networks/facebook/oauth/callback/{network}':
get:
summary: Facebook oauth callback route.
description: 'User gets redirected to this route once oauth process is finished on facebook'
tags:
- facebook
parameters:
- name: network
in: path
description: Network for wich token was requestsed.
required: true
type: string
enum: ['facebook', 'instagram', 'adaccount']
- name: code
in: query
description: Facebook code to exchange for accesstoken.
type: string
- name: state
in: query
description: State that was generated on oauth initialization
type: string
- name: error
in: query
description: Error that occured during oauth process
type: string
- name: error_code
in: query
description: Code of the occured error
type: string
- name: error_description
in: query
description: Description of the occured error
type: string
- name: error_reason
in: query
description: Reason of the occured error
type: string
- name: error_message
in: query
description: Message of the occured error
type: string
- name: pageId
in: query
description: Network Page Id to get token for
type: string
pattern: '^[0-9]+$'
responses:
302:
description: Redirects to the frontend with resulting data in the query.
400:
$ref: '#/responses/BadRequestError'
500:
$ref: '#/responses/InternalServerError'
'/networks/facebook/locations':
get:
summary: Searches for locations.
description: 'Returns array of locations for the provided query string.'
tags:
- facebook
parameters:
- name: q
in: query
description: Searches for locations that contain this string.
required: true
type: string
- name: channelId
in: query
description: For which channel the possible locations should be searched.
required: true
type: string
responses:
200:
description: Array of locations.
schema:
type: array
items:
type: object
properties:
name:
type: string
description: Human readable name of the location.
location:
type: object
description: further location information like city, country, coordinates, etc.
verification_status:
type: string
description: current verification status of the location on the social network
link:
type: string
description: direct link to the location on the social network (Facebook)
id:
type: string
description: Identifier of the location.
picture:
type: object
properties:
data:
type: object
properties:
url:
type: string
description: Page image url
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
500:
$ref: '#/responses/InternalServerError'
'/networks/facebook/users/picture':
get:
summary: Returns facebook user picture by user id.
description: Proxies requests to get user picture URLs from facebook and redirect to them while hiding channel access tokens
tags:
- facebook
parameters:
- name: userId
in: query
description: facebook id of the user to fetch the picture for
required: true
type: string
- name: channelId
in: query
description: id of the channel which token should be used for the request
required: true
type: string
- name: signature
in: query
description: signature to verify that the request is legit when no access token provided
required: false
type: string
responses:
200:
description: Redirect to the profile picture on Facebooks CDN
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
'/cp/networks/facebook/adCampaigns':
get:
summary: Returns a list of adCampaigns.
description: 'Returns an array of Facebook adcampaigns that belong to an adAccount. Required permission: `ViewAds`'
tags:
- facebook
- ads
parameters:
- name: adAccountId
in: query
description: id of the adAccount
required: true
type: string
- name: ids
in: query
description: ids of adCampaings to fetch
required: false
type: array
items:
type: string
- name: before
in: query
description: pagination filter, should be taken from previous response. This is mutually exclusive to `after`
required: false
type: string
- name: after
in: query
description: pagination filter, should be taken from previous response. This is mutually exclusive to `before`
required: false
type: string
- name: q
in: query
description: search term, only campaigns that contain this string are returned. Must be at least 3 characters long
required: false
type: string
responses:
200:
description: List of adCampaigns as well as paging data.
schema:
type: object
properties:
data:
type: array
items:
$ref: '#/definitions/FacebookAdCampaign'
paging:
type: object
properties:
before:
type: string
description: used for paginagion to get adCampaigns before the currently returned campaigns
after:
type: string
description: used for pagination to get adCampaigns after the currently returned campaigns
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
500:
$ref: '#/responses/InternalServerError'
'/cp/networks/facebook/adSets':
get:
summary: Returns a list of adSets.
description: 'Returns an array of Facebook adsets that belong to a specified adCampaign. Required permission: `ViewAds`'
tags:
- facebook
- ads
parameters:
- name: adCampaignId
in: query
description: id of the adCampaign
required: true
type: string
- name: before
in: query
description: pagination filter, should be taken from previous response. This is mutually exclusive to `after`
required: false
type: string
- name: after
in: query
description: pagination filter, should be taken from previous response. This is mutually exclusive to `before`
required: false
type: string
- name: q
in: query
description: search term, only adSets that contain this string are returned. Must be at least 3 characters long
required: false
type: string
responses:
200:
description: List of adSets as well as paging data.
schema:
type: object
properties:
data:
type: array
items:
$ref: '#/definitions/FacebookAdSet'
paging:
type: object
properties:
before:
type: string
description: used for paginagion to get adSets before the currently returned campaigns
after:
type: string
description: used for pagination to get adSets after the currently returned campaigns
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
500:
$ref: '#/responses/InternalServerError'
post:
summary: creates a new adSet on facebook.
description: 'Creates a new adSet on Facebook itself according to the provided specifications. Required permission: `EditAds`'
tags:
- facebook
- ads
parameters:
- name: adAccountId
in: query
description: socialHub object id of the adAccount with which to create the new adSet
required: true
type: string
- name: campaignId
in: query
description: network id of the campaign for which to create the new adSet
required: true
type: string
- name: body
in: body
required: true
schema:
type: object
properties:
name:
description: Name of the new adSet
type: 'string'
endTime:
description: End time of the adSet. If undefined or set to null the adSet will run idefinitely
type: 'string'
format: 'date-time'
startTime:
description: Start time of the adSet.
type: 'string'
format: 'date-time'
lifetimeBudget:
description: Lifetime budget of the adSet. Either this or `dailyBudget` should be set
type: 'number'
minimum: 0
dailyBudget:
description: Daily budget of the adSet. Either this or `lifetimeBudget` should be set
type: 'number'
minimum: 0
bidStrategy:
description: Bit strategy the adSet should use. LOWEST_COST_WITHOUT_CAP for automatic; LOWEST_COST_WITH_BID_CAP for manual.
type: 'string'
enum: ['LOWEST_COST_WITHOUT_CAP', 'LOWEST_COST_WITH_BID_CAP']
bidAmount:
description: bid cap for adSet. Should only be set for LOWEST_COST_WITH_BID_CAP as `bidStrategy`
type: 'number'
minimum: 0
optimizationGoal:
description: Goal for which the adSet should be optimized
type: 'string'
enum: ['NONE', 'APP_INSTALLS', 'BRAND_AWARENESS', 'AD_RECALL_LIFT', 'ENGAGED_USERS', 'EVENT_RESPONSES', 'IMPRESSIONS', 'LEAD_GENERATION', 'LINK_CLICKS', 'OFFER_CLAIMS', 'OFFSITE_CONVERSIONS', 'PAGE_ENGAGEMENT', 'PAGE_LIKES', 'POST_ENGAGEMENT', 'REACH', 'SOCIAL_IMPRESSIONS', 'THRUPLAY', 'APP_DOWNLOADS', 'LANDING_PAGE_VIEWS', 'VALUE', 'REPLIES']
billingEvent:
description: for what event the adAccount will be billed within this adSet
type: 'string'
enum: ['APP_INSTALLS', 'CLICKS', 'IMPRESSIONS', 'LINK_CLICKS', 'NONE', 'OFFER_CLAIMS', 'PAGE_LIKES', 'POST_ENGAGEMENT', 'THRUPLAY']
targeting:
type: object
properties:
devicePlatforms:
description: device placement of the adSet
type: 'array'
items:
type: 'string'
enum: ['mobile', 'desktop']
publisherPlatforms:
description: publisher platform placement of the adSet
type: 'array'
items:
type: 'string'
enum: ['facebook', 'instagram', 'messenger', 'audience_network']
facebookPositions:
description: placement positions on facebook for the adSet
type: 'array'
items:
type: 'string'
enum: ['feed', 'right_hand_column', 'marketplace']
instagramPositions:
description: placement positions on instagram for the adSet
type: 'array'
items:
type: 'string'
enum: ['stream', 'story']
audienceNetworkPositions:
description: placement positions on audience network for the adSet
type: 'array'
items:
type: 'string'
enum: ['classic', 'instream_video', 'rewarded_video']
messengerPositions:
description: placement positions on messenger for the adSet
type: 'array'
items:
type: 'string'
enum: ['messenger_home', 'sponsored_messages']
age_min:
type: number
minimum: 13
maximum: 65
age_max:
type: number
minimum: 13
maximum: 65
locales:
type: array
items:
type: number
minimum: 0
genders:
type: array
items:
type: number
minimum: 1
maximum: 2
locations:
type: array
items:
type: object
properties:
key:
type: string
type:
type: string
enum: [country_group, country, region, city, zip]
country_codes:
type: array
items:
type: string
interests:
type: array
items:
type: object
properties:
id:
type: number
minimum: 0
name:
type: string
responses:
201:
description: OK
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
'/cp/networks/facebook/adStatus':
post:
summary: Returns an object of postIds with their ad status on Facebook.
description: 'Returns an object of postIds with their ad status on Facebook. Required permission: `ViewPosts`'
tags:
- facebook
- ads
parameters:
- name: body
in: body
description: Array of PostIds.
required: true
schema:
type: array
items:
type: string
pattern: '^[a-f0-9]{24}$'
responses:
200:
description: Object of postIds with their ad statuses.
schema:
type: object
properties:
postId:
type: object
properties:
status:
type: string
description: The configured status of the ad.
effectiveStatus:
type: string
description: The effective status of the ad. The status could be effective either because of its own status, or the status of its parent units.
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
'/networks/facebook/me':
get:
summary: Returns summary of page.
description: 'Returns the summary of a page by requesting to Facebook API.'
tags:
- facebook
responses:
200:
description: Summary of the page.
schema:
type: object
properties:
id:
type: string
description: Network id of the page
name:
type: string
description: Network name of the page
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
500:
$ref: '#/responses/InternalServerError'
'/networks/facebook/adaccounts':
get:
summary: Returns info of the adaccounts.
description: 'Returns info of the adaccounts by requesting to Facebook API.'
tags:
- facebook
parameters:
- name: limit
in: query
description: Limiting the response results
required: false
type: number
default: 8
- name: before
in: query
description: Pagination perposes
required: false
type: string
- name: after
in: query
description: Pagination perposes
required: false
type: string
responses:
200:
description: Info of the adaccounts.
schema:
type: object
properties:
data:
type: array
description: Adaccounts info array
items:
type: object
properties:
account_id:
type: string
description: Id of the account
id:
type: string
description: Id of the adaccount
name:
type: string
description: Name of the adaccount
currency:
type: string
description: Currency of the adaccount
business:
type: object
description: Business manager info of the adaccount
paging:
type: object
description: Before and after pages
properties:
cursors:
type: object
description: Paging cursors
properties:
before:
type: string
description: Indicating before the page
after:
type: string
description: Indicating after the page
next:
type: string
description: Next page link
previous:
type: string
description: Previous page link
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
500:
$ref: '#/responses/InternalServerError'
# Instagram specific routes
'/networks/instagram/products':
get:
summary: Returns products of IG shop.
description: Returns all the products specific to the catalog shop
tags:
- instagram
parameters:
- name: channelId
in: query
description: id of the channel to search products for
required: true
type: string
pattern: '^[a-f0-9]{24}$'
- name: q
in: query
description: search term
required: false
type: string
- name: limit
in: query
description: max number of products to return
required: false
type: string
- name: after
in: query
description: pagination cursor
required: false
type: string
responses:
200:
description: List of products.
schema:
type: object
properties:
data:
type: array
items:
type: object
properties:
product_id:
type: string
description: product id
merchant_id:
type: string
description: id of the merchant
retailer_id:
type: string
description: id of the retailer
product_name:
type: string
description: product name
image_url:
type: string
description: product image
review_status:
type: string
is_checkout_flow:
type: boolean
paging:
type: object
properties:
cursors:
type: object
properties:
after:
type: string
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
404:
$ref: '#/responses/NotFoundError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
# Twitter specfic routes.
'/cp/networks/twitter/mentions':
get:
summary: Searches for Twitter users.
description: 'Returns array of Twitter users for the provided query string. Needed permissions: `EditPosts`'
tags:
- twitter
parameters:
- name: q
in: query
description: Searches for Twitter user that contain this string.
required: true
type: string
- name: channelId
in: query
description: For which channel the possible mentions should be searched
required: true
type: string
responses:
200:
description: Array of Twitter users. See https://dev.twitter.com/rest/reference/get/users/search for exact schema.
schema:
type: array
items:
type: object
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
'/networks/twitter/oauth/connect':
get:
summary: Initiates oauth process on twitter.
description: 'Initiates oauth process on twitter to get access token to connect channels'
tags:
- twitter
responses:
302:
description: Redirects to twitter oauth page.
401:
$ref: '#/responses/AccessTokenInvalidError'
500:
$ref: '#/responses/InternalServerError'
'/networks/twitter/oauth/callback':
get:
summary: Twitter oauth callback route.
description: 'User gets redirected to this route once oauth process is finished on twitter'
tags:
- twitter
parameters:
- name: oauth_verifier
in: query
description: Twitter code to exchange for accesstoken.
type: string
responses:
302:
description: Redirects to the frontend with resulting data in the query.
400:
$ref: '#/responses/BadRequestError'
500:
$ref: '#/responses/InternalServerError'
'/networks/pinterest/oauth/connect':
get:
summary: Initiates oauth process on Pinterest.
description: 'Initiates oauth process on Pinterest to get access token to connect channels'
tags:
- pinterest
responses:
302:
description: Redirects to Pinterest oauth page.
401:
$ref: '#/responses/AccessTokenInvalidError'
500:
$ref: '#/responses/InternalServerError'
'/networks/pinterest/oauth/callback':
get:
summary: Pinterest oauth callback route.
description: 'User gets redirected to this route once oauth process is finished on Pinterest'
tags:
- pinterest
parameters:
- name: code
in: query
description: Pinterest code to exchange for accesstoken.
type: string
responses:
302:
description: Redirects to the frontend with resulting data in the query.
500:
$ref: '#/responses/InternalServerError'
'/networks/tiktok/oauth/connect':
get:
summary: Initiates oauth process on Tiktok.
description: 'Initiates oauth process on Tiktok to get access token to connect channels'
tags:
- tiktok
responses:
302:
description: Redirects to Tiktok oauth page.
401:
$ref: '#/responses/AccessTokenInvalidError'
500:
$ref: '#/responses/InternalServerError'
'/networks/tiktok/oauth/callback':
get:
summary: Tiktok oauth callback route.
description: 'User gets redirected to this route once oauth process is finished on Tiktok'
tags:
- tiktok
parameters:
- name: code
in: query
description: Tiktok code to exchange for accesstoken.
type: string
responses:
302:
description: Redirects to the frontend with resulting data in the query.
500:
$ref: '#/responses/InternalServerError'
# LinkedIn specific routes.
'/cp/networks/linkedin/audience':
get:
summary: Loads targeting audience size from Linkedin
description: 'Returns counts of active and all targeted followers as well as a boolean indicating if the targeting has a large enough audience'
tags:
- linkedin
parameters:
- name: postId
in: query
required: true
description: Id of the post for which we want to fetch the targeting audience size
type: string
pattern: '^[a-f0-9]{24}$'
responses:
200:
description: Count of active and all targeted followers as well as a boolean indicating if the targeting has a large enough audience
schema:
type: object
properties:
active:
type: number
total:
type: number
targetOptionsAreValid:
type: boolean
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
500:
$ref: '#/responses/InternalServerError'
'/networks/linkedin/pages':
get:
summary: Returns a list of LinkedIn Company Pages
description: 'Returns result of /organizationAcls from the LinkedIn API for the given access token. Also requires user authentication token to prevent abuse.'
tags:
- linkedin
parameters:
- name: count
in: query
type: number
default: 100
description: "Paging parameter for API request: Amount of items to return"
- name: start
in: query
type: number
default: 0
description: "Paging parameter for API request: Page offset / amount of items to skip"
- name: bearerToken
in: query
type: string
required: true
description: "LinkedIn API Bearer Token from OAuthentication"
responses:
200:
description: Returns original response from LinkedIn API.
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
500:
$ref: '#/responses/InternalServerError'
'/networks/linkedin/mentions':
get:
summary: Returns a mentions data by provided string for LinkedIn Pages and People
description: Returns company and people data from LinkedIn for the post mention. Note - if search keyword length is less then 3, endpoint will search only for companies.
tags:
- linkedin
parameters:
- name: q
in: query
description: Searches for LinkedIn entities that match this string.
required: true
type: string
- name: channelId
in: query
description: For which channel the possible mentions should be searched.
required: true
type: string
responses:
200:
description: Array of mentionable LinkedIn entities.
schema:
type: array
items:
type: object
properties:
avatar:
type: string
description: Url of the entity logo
name:
type: string
description: Human readable name of the entity
vanityName:
type: string
description: Short name of the entity to use in the url
link:
type: string
description: Link to the entity on LinkedIn
id:
type: string
description: Identifier of the entity
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
'/networks/linkedin/oauth/connect':
get:
summary: Initiates oauth process on linkedin.
description: 'Initiates oauth process on linkedin to get access token to connect channels'
tags:
- linkedin
parameters:
- name: pageId
in: query
description: Network Page Id to get token for.
type: string
pattern: '^urn:li:(organization|organizationBrand):[0-9]+$'
- name: redirectSource
in: query
description: Defines the action which triggered the connect
type: string
enum: ['addChannel', 'reactivateChannel', 'refreshTokens']
responses:
302:
description: Redirects to linkedin oauth page.
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
500:
$ref: '#/responses/InternalServerError'
'/networks/linkedin/oauth/callback':
get:
summary: Linkedin oauth callback route.
description: 'User gets redirected to this route once oauth process is finished on linkedin'
tags:
- linkedin
parameters:
- name: code
in: query
description: Linkedin code to exchange for accesstoken.
type: string
- name: state
in: query
description: State that was generated on oauth initialization
type: string
- name: error
in: query
description: Error that occured during oauth process
type: string
- name: error_description
in: query
description: Description of the occured error
type: string
- name: redirectSource
in: query
description: Defines the action which triggered the connect
type: string
enum: ['addChannel', 'reactivateChannel', 'refreshTokens']
responses:
302:
description: Redirects to the frontend with resulting data in the query.
400:
$ref: '#/responses/BadRequestError'
500:
$ref: '#/responses/InternalServerError'
'/networks/pinterest/boards':
get:
summary: Returns all account boards and sections from pinterest
description: A route to fetch all available boards and sections for pinterest channel. Requires `EditPosts` permission
tags:
- pinterest
parameters:
- name: channelId
in: query
description: Pinterest channel id to fetch boards and sections for
type: string
responses:
200:
description: Pinterest boards and sections
schema:
type: array
items:
type: object
properties:
name:
type: string
id:
type: string
description:
type: string
owner:
type: object
properties:
username:
type: string
privacy:
type: string
sections:
type: array
items:
type: object
properties:
id:
type: string
name:
type: string
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
'/cp/networks/linkedin/targeting':
get:
summary: Loads targeting options from Linkdin
description: 'Returns arrays of Linkedin targeting options for the requested types in the query.'
tags:
- linkedin
parameters:
- name: type
in: query
required: true
description: Defines which type of targeting options you want to request. Can be `industries`, `geoLocations`, `jobFunctions` or `interfaceLocales`.
type: array
items:
type: string
enum: [ industries, geoLocations, jobFunctions, interfaceLocales ]
- name: channelId
in: query
required: true
description: Defines which channels accessToken should be used to search for targeting options.
type: string
pattern: '^[a-f0-9]{24}$'
- name: q
in: query
description: Searches for options which contain the string. This will be used for searching when provided type is geoLocations
required: false
type: string
responses:
200:
description: Object of arrays for Linkedin options for types
schema:
type: object
properties:
industries:
type: array
items:
type: object
properties:
name:
type: string
id:
type: string
jobFunctions:
type: array
items:
type: object
properties:
name:
type: string
id:
type: string
geoLocations:
type: array
items:
type: object
properties:
name:
type: string
id:
type: string
interfaceLocales:
type: array
items:
type: object
properties:
name:
type: string
id:
type: string
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
406:
$ref: '#/responses/NotAcceptableError'
500:
$ref: '#/responses/InternalServerError'
# Youtube specific routes.
'/networks/youtube/oauth/connect':
get:
summary: Initiates oauth process on youtube.
description: 'Initiates oauth process on youtube to get access token to connect channels'
tags:
- youtube
responses:
302:
description: Redirects to youtube oauth page.
401:
$ref: '#/responses/AccessTokenInvalidError'
500:
$ref: '#/responses/InternalServerError'
'/networks/youtube/oauth/callback':
get:
summary: Youtube oauth callback route.
description: 'User gets redirected to this route once oauth process is finished on youtube'
tags:
- youtube
parameters:
- name: code
in: query
description: Youtube code to exchange for accesstoken.
type: string
- name: state
in: query
description: State that was generated on oauth initialization
type: string
- name: error
in: query
description: Error that occured during oauth process
type: string
- name: scope
in: query
description: Requested token scope
type: string
responses:
302:
description: Redirects to the frontend with resulting data in the query.
400:
$ref: '#/responses/BadRequestError'
500:
$ref: '#/responses/InternalServerError'
# Bitly specific routes
'/networks/bitly':
get:
summary: Returns bitly accounts.
description: 'Returns array of bitly accounts (id and accountId) for the authenticated user.'
tags:
- bitly
responses:
200:
description: Array of bitly accounts
schema:
type: array
items:
type: object
properties:
id:
$ref: '#/definitions/ObjectId'
description: Identifier of the entity
accountId:
$ref: '#/definitions/ObjectId'
description: Identifier of the account related to the entity
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
500:
$ref: '#/responses/InternalServerError'
'/networks/bitly/{bitlyId}':
delete:
summary: Deletes bitly account
description: 'Deletes bitly account for the authenticated user.'
tags:
- bitly
parameters:
- name: bitlyId
in: path
description: Identifier of the entity to delete.
required: true
type: string
responses:
204:
description: Empty response in case of success.
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
'/networks/bitly/oauth/connect':
get:
summary: Initiates oauth process on bitly.
description: 'Initiates oauth process on bitly to get access token to connect account'
tags:
- bitly
responses:
302:
description: Redirects to facebook oauth page.
401:
$ref: '#/responses/AccessTokenInvalidError'
500:
$ref: '#/responses/InternalServerError'
'/networks/bitly/oauth/callback':
get:
summary: Bitly oauth callback route.
description: 'User gets redirected to this route once oauth process is finished on bitly'
tags:
- bitly
parameters:
- name: code
in: query
description: Bitly code to exchange for accesstoken.
type: string
- name: state
in: query
description: State that was generated on oauth initialization
type: string
responses:
302:
description: Redirects to facebook oauth page.
400:
$ref: '#/responses/BadRequestError'
500:
$ref: '#/responses/InternalServerError'
# Content Campaigns
'/cp/campaigns':
get:
summary: Lists active Content Campaigns.
description: 'Returns an array of Campaigns matching the specified criteria. Needed permissions: `ViewCampaigns`'
tags:
- campaigns
parameters:
- name: since
in: query
description: Filter campaigns that overlap with the specified ISODate string range (since -> until).
required: true
type: string
format: date-time
- name: until
in: query
description: Filter campaigns that overlap with the specified ISODate string range (since -> until).
required: true
type: string
format: date-time
responses:
200:
description: Array of Content Campaigns.
schema:
type: array
items:
$ref: '#/definitions/Campaign'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
500:
$ref: '#/responses/InternalServerError'
post:
summary: Creates a new Content Campaign.
description: 'Creates a new Campaign with the specified attributes. Needed permissions: `EditCampaigns`'
tags:
- campaigns
parameters:
- name: body
in: body
description: Should contain `name`, `startTime`, `endTime` and optionally the `description` and `colour` of the Campaign object.
required: true
schema:
$ref: '#/definitions/Campaign'
responses:
201:
description: The newly created Campaign entity.
schema:
$ref: '#/definitions/Campaign'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
406:
$ref: '#/responses/NotAcceptableError'
500:
$ref: '#/responses/InternalServerError'
'/inbox/insights/categories/stats/csv':
post:
summary: 'Exports a csv with categories stats'
description: 'Exports a csv with categories stats restricted by createdTime of tickets'
tags:
- insights
parameters:
- name: body
in: body
required: true
schema:
type: object
required: [start, end]
properties:
start:
type: string
format: date-time
description: 'Filter tickets by their createdTime since the specified ISODate string.'
end:
type: string
format: date-time
description: 'Filter tickets by their createdTime until the specified ISODate string.'
channelIds:
type: array
description: Filter tickets by given channelIds.
items:
$ref: '#/definitions/ObjectId'
debug:
type: boolean
description: Flag showing whether csv should include category ids.
responses:
201:
description: The created csv file.
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
'/inbox/insights/reports':
post:
summary: 'Returns insight reports for the specified channels within the timerange'
description: 'Returns raw insights reports as application/json stream for the specified channels within the specified time range. Requires `ViewAnalytics` permission.'
tags:
- insights
parameters:
- name: from
in: query
description: 'Filter reports by their range since the specified ISODate string.'
required: true
type: string
format: date-time
- name: until
in: query
description: 'Filter reports by their range until the specified ISODate string.'
required: true
type: string
format: date-time
- name: body
in: body
description: 'List of channelIds to filter the reports by. Invalid Ids will be ignored.'
required: true
schema:
type: array
items:
type: string
pattern: '^[a-f0-9]{24}$'
responses:
200:
description: A JSON stream of report objects within an array.
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
'/inbox/insights/reports/csv':
post:
summary: 'Returns csv file with the insights data for selected channel'
description: 'Streams the insights data for selected channel in the given time range as csv. Requires `ViewAnalytics` permission.'
tags:
- insights
parameters:
- name: aggregateBy
in: query
description: 'Time slice the data should be aggregated by'
type: string
enum: ['day', 'hour']
default: 'day'
- name: body
in: body
required: true
schema:
type: object
required: ['start', 'end']
properties:
start:
type: string
format: date-time
description: since when the analytics should be returned
end:
type: string
format: date-time
description: until when the analytics should be returned
channelIds:
type: array
description: array of channel ids
items:
type: string
pattern: '^[a-f0-9]{24}$'
responses:
200:
description: CSV stream in case of success
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
'/inbox/insights/reports/channels':
get:
summary: 'Returns a list of channels we generate insight reports for'
description: 'Returns a summary of ALL the channels that we generate insights report data for and the current user has access to. Requires `ViewAnalytics` permission.'
tags:
- insights
responses:
200:
description: List of channels for insights
schema:
type: array
items:
$ref: '#/definitions/ChannelSummary'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
406:
$ref: '#/responses/NotAcceptableError'
500:
$ref: '#/responses/InternalServerError'
'/inbox/categories':
get:
summary: Returns all categories of the account.
description: 'Returns an array of categories of the account'
tags:
- categories
responses:
200:
description: Array of Categories.
schema:
type: array
items:
$ref: '#/definitions/Categories'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
500:
$ref: '#/responses/InternalServerError'
post:
summary: 'Creates category'
description: 'Creates a category and updates parent if needed'
tags:
- categories
parameters:
- name: body
in: body
schema:
type: object
required: ['name']
properties:
name:
type: string
description: 'name of the category'
maxLength: 60
description:
type: string
description: 'description of the category'
maxLength: 300
parentId:
$ref: '#/definitions/ObjectId'
description: 'parent id of the created category'
responses:
201:
description: The created category.
schema:
$ref: '#/definitions/Category'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
'/inbox/categories/{categoryId}/ticketcount':
get:
summary: Return count of the tickets with that specific categoryId
description: given a categoryId, it will return the count of the tickets with that specific categoryId
tags:
- categories
parameters:
- name: categoryId
in: path
description: Category id to count
required: true
type: string
responses:
200:
description: Count of tickets with that specific categoryId
schema:
type: object
properties:
count:
type: number
400:
$ref: "#/responses/BadRequestError"
401:
$ref: "#/responses/AccessTokenInvalidError"
403:
$ref: "#/responses/InsufficientPermissions"
404:
$ref: "#/responses/NotFoundError"
500:
$ref: "#/responses/InternalServerError"
'/inbox/categories/{categoryId}':
patch:
summary: 'Updates category'
description: 'Updates name, description and visibility of a category'
tags:
- categories
parameters:
- name: categoryId
in: path
description: 'CategoryId for which to update category'
required: true
type: string
- name: body
in: body
description: 'Values to change in the category (name/description/hidden)'
required: true
schema:
type: object
properties:
name:
type: string
maxLength: 60
description: 'name of the category'
description:
type: string
maxLength: 300
description: 'description of the category'
hidden:
type: boolean
description: 'hide/unhide the category'
responses:
200:
description: Updated Category in case of success.
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
delete:
summary: Deletes category
description: Deletes category and updates the category tree accordingly
tags:
- categories
parameters:
- name: categoryId
in: path
description: ID of the category to delete.
required: true
type: string
responses:
204:
description: Empty response in case of success.
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
'/inbox/categories/import':
post:
summary: 'Imports categories'
description: 'Import array of objects of categories'
tags:
- categories
parameters:
- name: categories
in: body
description: 'Array of category objects'
required: true
schema:
type: array
items:
properties:
name:
type: string
minLength: 1
maxLength: 60
description:
type: string
minLength: 1
maxLength: 300
depth:
type: integer
minimum: 1
required: ['name', 'depth']
responses:
200:
description: Import categories successful.
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
'/inbox/categories/{categoryId}/reassign':
post:
summary: Reassigns tickets from one category to another
description: Removes category from tickets and assigns them a new one
tags:
- categories
parameters:
- name: categoryId
in: path
description: Category id to remove
required: true
type: string
- name: body
in: body
required: true
schema:
type: object
required: ['categoryId']
properties:
categoryId:
type: string
pattern: '^[a-f0-9]{24}$'
description: Category id to assign
responses:
200:
description: Updated Category in case of success.
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
'/inbox/categories/{categoryId}/move':
post:
summary: Change a Category's Parent
description: Change parent for a category and its children
tags:
- categories
parameters:
- name: categoryId
in: path
description: Identifies the category to move.
required: true
type: string
pattern: '^[a-f0-9]{24}$'
- name: body
in: body
required: true
schema:
type: object
required: ['updatedCategory']
properties:
updatedCategory:
type: object
required: ['parentId', 'weight']
properties:
parentId:
type: string
pattern: '^[a-f0-9]{24}$'
weight:
type: integer
minimum: 0
siblings:
type: array
items:
type: object
required: ['weight']
properties:
categoryId:
type: string
pattern: '^[a-f0-9]{24}$'
weight:
type: integer
minimum: 0
responses:
204:
description: Empty response in case of success.
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
'/inbox/channels/{cid}/interactors/{id}':
delete:
summary: 'Deletes interactor data for a channel.'
description: 'Creates a job to delete interactor data for a channel. Needed permissions: `AnonymizeInteractor`'
tags:
- channels
parameters:
- name: cid
in: path
description: Deletes the interactor for this channel.
required: true
type: string
- name: id
in: path
description: ID of the interactor to delete.
required: true
type: string
responses:
204:
description: Empty response in case of success.
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
'/inbox/channels/{cid}/businessHours':
patch:
summary: 'updates businessHours of a channel'
description: 'Updates the businesHours of the specified channel'
tags:
- channels
parameters:
- name: cid
in: path
description: ChannelId for which to update businessHours.
required: true
type: string
- name: body
in: body
description: 'businessHours values that should be updated in the channel'
required: true
schema:
type: object
properties:
businessHours:
type: object
properties:
timezone:
type: string
description: name of the timezone (from moment-timezone)
daysOfWeek:
type: array
items:
type: object
properties:
day:
type: integer
minimum: 0
maximum: 6
start:
type: integer
minimum: 0
maximum: 23
end:
type: integer
minimum: 0
maximum: 23
workday:
type: boolean
responses:
200:
description: channel with updated business hours.
schema:
$ref: '#/definitions/Channel'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
'/inbox/channels/businessHours':
post:
summary: 'Updates businessHours of all channels'
description: 'Updates businesHours of all channels in account. Requires `EditChannels` permission'
tags:
- channels
parameters:
- name: body
in: body
description: 'businessHours values that should be updated in the channels'
required: false
schema:
type: object
properties:
businessHours:
type: object
properties:
timezone:
type: string
description: name of the timezone (from moment-timezone)
daysOfWeek:
type: array
items:
type: object
properties:
day:
type: integer
minimum: 0
maximum: 6
start:
type: integer
minimum: 0
maximum: 23
end:
type: integer
minimum: 0
maximum: 23
workday:
type: boolean
responses:
200:
description: channels with updated business hours.
schema:
type: array
items:
$ref: '#/definitions/Channel'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
'/inbox/rules':
get:
summary: Returns account smart rules
description: Returns all existing account smart rules, requires EditRules and ViewAccountSettings permissions
tags:
- rules
responses:
200:
description: List of all the rules of the account
schema:
type: array
items:
$ref: '#/definitions/Rule'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
406:
$ref: '#/responses/NotAcceptableError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
patch:
summary: Updates weight of smart rules
description: Updates weight of given smart rules, requires EditRules and ViewAccountSettings permissions
tags:
- rules
parameters:
- name: body
in: body
required: true
schema:
type: array
minLength: 1
maxLength: 1000
items:
type: object
required: [id, weight]
properties:
id:
type: string
pattern: '^[a-f0-9]{24}$'
weight:
type: number
minimum: 0
responses:
200:
description: Empty response in case of success
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
406:
$ref: '#/responses/NotAcceptableError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
post:
summary: Creates a new smart rule
description: Creates a new smart rule, requires EditRules permission
tags:
- rules
parameters:
- name: body
in: body
required: true
schema:
type: object
required: ['name', 'active', 'weight', 'trigger', 'entity', 'conditions', 'actions']
properties:
name:
type: string
minLength: 1
maxLength: 50
description:
type: string
maxLength: 255
active:
type: boolean
weight:
type: number
minimum: 0
trigger:
type: string
enum: ['ticket_creation']
entity:
type: string
enum: ['ticket']
conditions:
type: array
items:
type: object
required: ['condition']
properties:
condition:
type: string
enum: [
'message_has_keyword',
'message_consists_of_mentions',
'message_has_mention',
'type',
'ticket_belongs_to_channel',
'ticket_from_user',
'ticket_belongs_to_network',
]
config:
type: object
properties:
channelIds:
type: array
items:
type: string
pattern: '^[a-f0-9]{24}$'
keywordList:
type: string
pattern: '^[a-f0-9]{24}$'
interactorList:
type: string
pattern: '^[a-f0-9]{24}$'
types:
type: array
items:
type: object
properties:
network:
type: string
type:
type: string
networks:
type: array
items:
type: string
actions:
type: array
items:
type: object
required: ['action']
properties:
action:
type: string
enum: [
'archive',
'mark_as_priority',
'assign',
'hide',
'delete',
'forward_by_mail',
'like',
'tag',
'sentiment',
]
config:
type: object
properties:
recipients:
type: array
items:
type: string
format: email
cc:
type: array
items:
type: string
format: email
context:
type: boolean
subject:
type: string
message:
type: string
replyTo:
type: string
format: email
categoryIds:
type: array
minItems: 1
maxItems: 1
items:
type: string
pattern: '^[a-f0-9]{24}$'
sentiment:
type: 'string'
enum: ['POSITIVE', 'NEUTRAL', 'NEGATIVE']
responses:
200:
description: Created rule entity
schema:
$ref: '#/definitions/Rule'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
'/inbox/rules/{id}':
get:
summary: Returns a single smart rule
description: Returns smart rule by its id, requires EditRules and ViewAccountSettings permissions
tags:
- rules
parameters:
- name: id
in: path
description: Id of the rule to return.
required: true
type: string
pattern: '^[a-f0-9]{24}$'
responses:
200:
description: List of all the rules of the account
schema:
$ref: '#/definitions/Rule'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
406:
$ref: '#/responses/NotAcceptableError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
patch:
summary: Updates smart rule
description: Updates and validates smart rule. Requires `EditRules` and `ViewAccountSettings` permissions.
tags:
- rules
parameters:
- name: id
in: path
description: Id of the rule to update.
required: true
type: string
pattern: '^[a-f0-9]{24}$'
- name: body
in: body
required: true
schema:
type: object
properties:
name:
type: string
minLength: 1
maxLength: 50
description:
type: string
maxLength: 255
active:
type: boolean
weight:
type: number
minimum: 0
trigger:
type: string
enum: ['ticket_creation']
entity:
type: string
enum: ['ticket']
conditions:
type: array
items:
type: object
required: ['condition']
properties:
condition:
type: string
enum: [
'message_has_keyword',
'message_consists_of_mentions',
'message_has_mention',
'type',
'ticket_belongs_to_channel',
'ticket_belongs_to_network',
]
config:
type: object
properties:
channelIds:
type: array
items:
type: string
pattern: '^[a-f0-9]{24}$'
keywordList:
type: string
pattern: '^[a-f0-9]{24}$'
types:
type: array
items:
type: object
properties:
network:
type: string
type:
type: string
networks:
type: array
items:
type: string
actions:
type: array
items:
type: object
required: ['action']
properties:
action:
type: string
enum: [
'archive',
'mark_as_priority',
'assign',
'hide',
'delete',
'forward_by_mail',
'like',
'tag',
'sentiment',
]
config:
type: object
properties:
recipients:
type: array
items:
type: string
format: email
cc:
type: array
items:
type: string
format: email
context:
type: boolean
subject:
type: string
message:
type: string
replyTo:
type: string
format: email
categoryIds:
type: array
minItems: 1
maxItems: 1
items:
type: string
pattern: '^[a-f0-9]{24}$'
sentiment:
type: 'string'
enum: ['POSITIVE', 'NEUTRAL', 'NEGATIVE']
responses:
200:
description: Updated rule entity
schema:
$ref: '#/definitions/Rule'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
delete:
summary: Deletes a single smart rule
description: Deletes smart rule by id, requires EditRules and ViewAccountSettings permissions
tags:
- rules
parameters:
- name: id
in: path
description: Id of the rule to delete.
required: true
type: string
pattern: '^[a-f0-9]{24}$'
responses:
204:
description: Empty response in case of success
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
406:
$ref: '#/responses/NotAcceptableError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
'/inbox/rules/keywordLists':
get:
summary: Returns keywordLists
description: Returns all keywordLists of an account in a summary format
tags:
- rules
- keywordLists
responses:
200:
description: List of all the keywordlists of the account
schema:
type: array
items:
$ref: '#/definitions/KeywordListSummary'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
406:
$ref: '#/responses/NotAcceptableError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
post:
summary: creates keywordList
description: creates and returns a new keywordList
tags:
- rules
- keywordLists
parameters:
- name: body
in: body
required: true
schema:
type: object
properties:
name:
type: string
keywords:
type: array
items:
type: string
required: ['name', 'keywords']
responses:
201:
description: the created keywordList
schema:
$ref: '#/definitions/KeywordList'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
406:
$ref: '#/responses/NotAcceptableError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
'/inbox/rules/keywordLists/{id}':
get:
summary: Returns a keywordList
description: Returns the specified keywordList
tags:
- rules
- keywordLists
parameters:
- name: id
in: path
description: id of the keywordList to return
required: true
type: string
pattern: '^[a-f0-9]{24}$'
responses:
200:
description: the specified keywordList
schema:
$ref: '#/definitions/KeywordList'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
406:
$ref: '#/responses/NotAcceptableError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
patch:
summary: updates keywordList
description: updates and returns the specified keywordList
tags:
- rules
- keywordLists
parameters:
- name: id
in: path
description: id of the keywordList to update
required: true
type: string
pattern: '^[a-f0-9]{24}$'
- name: body
in: body
required: true
schema:
type: object
properties:
name:
type: string
keywords:
type: array
items:
type: string
responses:
200:
description: the updated keywordList
schema:
$ref: '#/definitions/KeywordList'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
406:
$ref: '#/responses/NotAcceptableError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
delete:
summary: deletes keywordList
description: deletes the specified keywordList
tags:
- rules
- keywordLists
parameters:
- name: id
in: path
description: id of the keywordList to delete
required: true
type: string
pattern: '^[a-f0-9]{24}$'
responses:
204:
description: keywordList was successfully deleted
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
406:
$ref: '#/responses/NotAcceptableError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
'/inbox/rules/interactorLists':
get:
summary: Returns InteractorLists
description: Returns all InteractorLists of an account in a summary format
tags:
- rules
- interactorLists
responses:
200:
description: List of all the InteractorLists of the account
schema:
type: array
items:
$ref: '#/definitions/InteractorListSummary'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
406:
$ref: '#/responses/NotAcceptableError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
post:
summary: creates interactorList
description: creates and returns a new interactorList
tags:
- rules
- interactorLists
parameters:
- name: body
in: body
required: true
schema:
type: object
properties:
name:
type: string
list:
type: array
items:
type: object
properties:
channelId:
$ref: '#/definitions/ObjectId'
interactorId:
type: object
properties:
_id:
$ref: '#/definitions/ObjectId'
required: ['_id']
required: ['channelId', 'interactorId']
required: ['name', 'list']
responses:
201:
description: the created interactorList with detailed interactors
schema:
$ref: '#/definitions/InteractorList'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
406:
$ref: '#/responses/NotAcceptableError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
'/inbox/rules/interactorLists/interactors':
post:
summary: Insert interactor in interactorList
description: insert interactor in multiple interactor lists, requires AddInteractorToInteractorLists permission.
tags:
- rules
- interactorLists
parameters:
- name: body
in: body
required: true
schema:
type: object
properties:
interactorId:
$ref: '#/definitions/ObjectId'
channelId:
$ref: '#/definitions/ObjectId'
interactorLists:
type: array
uniqueItems: true
minItems: 1
maxItems: 1000
items:
$ref: '#/definitions/ObjectId'
required: ['interactorId', 'channelId', 'interactorLists']
responses:
200:
description: Empty response in case of success.
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
406:
$ref: '#/responses/NotAcceptableError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
'/inbox/rules/interactorLists/{id}':
get:
summary: Returns an interactorList
description: Returns the specified interactorList
tags:
- rules
- interactorLists
parameters:
- name: id
in: path
description: id of the interactorList to return
required: true
type: string
pattern: '^[a-f0-9]{24}$'
responses:
200:
description: Requested interactor list
schema:
$ref: '#/definitions/InteractorListPopulated'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
406:
$ref: '#/responses/NotAcceptableError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
patch:
summary: updates interactorList
description: updates and returns the specified interactorList
tags:
- rules
- interactorList
parameters:
- name: id
in: path
description: id of the interactorList to update
required: true
type: string
pattern: '^[a-f0-9]{24}$'
- name: body
in: body
required: true
schema:
type: object
properties:
name:
type: string
list:
type: array
items:
type: object
properties:
channelId:
$ref: '#/definitions/ObjectId'
interactorId:
type: object
properties:
_id:
$ref: '#/definitions/ObjectId'
required: ['_id']
required: ['channelId', 'interactorId']
responses:
200:
description: the updated interactorList
schema:
$ref: '#/definitions/InteractorListPopulated'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
406:
$ref: '#/responses/NotAcceptableError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
delete:
summary: Deletes an interactorList
description: Deletes the specified interactorList
tags:
- rules
- interactorLists
parameters:
- name: id
in: path
description: id of the interactorList to delete
required: true
type: string
pattern: '^[a-f0-9]{24}$'
responses:
204:
description: Empty response in case of success
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
406:
$ref: '#/responses/NotAcceptableError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
'/inbox/rules/interactorLists/interactors/{interactorId}/channel/{channelId}':
get:
summary: Returns InteractorLists
description: Returns all InteractorLists of an account with a belongsToList flag indicating if that interactor belongs to the list, requires EditRules and ViewAccountSettings
tags:
- rules
- interactorLists
parameters:
- name: interactorId
in: path
description: id of the interator
required: true
type: string
pattern: '^[a-f0-9]{24}$'
- name: channelId
in: path
description: id of the channel
required: true
type: string
pattern: '^[a-f0-9]{24}$'
responses:
200:
description: List of all the InteractorLists of the account, with the belongsToList flag
schema:
type: array
items:
type: object
description: InteractorList defining a list of interactors used in smart rules
properties:
_id:
type: string
pattern: '^[a-f0-9]{24}$'
name:
type: string
accountId:
type: string
pattern: '^[a-f0-9]{24}$'
createdTime:
type: string
format: date-time
updatedTime:
type: string
format: date-time
belongsToList:
type: boolean
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
406:
$ref: '#/responses/NotAcceptableError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
'/inbox/rules/interactorLists/interactors/search':
get:
summary: Returns interactors for channels by given search term to use in the interactor list
description: Returns a list of active channels of an network with found interactors searched by name, requires EditRules and ViewAccountSettings
tags:
- rules
- interactorLists
parameters:
- name: name
in: query
description: name of the interactor
required: true
type: string
minLength: 3
maxLength: 512
- name: socialNetwork
in: query
required: true
type: string
enum: ['FACEBOOK', 'TWITTER', 'YOUTUBE', 'INSTAGRAM_BUSINESS', 'WORDPRESS', 'LINKEDIN', 'CUSTOM', 'SEARCHES', 'WHATSAPP', 'GOOGLE_MY_BUSINESS']
responses:
200:
description: List of all the InteractorLists of the account, with the belongsToList flag
schema:
type: array
items:
type: object
description: InteractorList defining a list of interactors used in smart rules
properties:
channelId:
$ref: '#/definitions/ObjectId'
interactors:
type: array
items:
type: object
properties:
id:
$ref: '#/definitions/ObjectId'
url:
type: string
name:
type: string
picture:
type: string
format: url
socialNetworkUserId:
type: string
networkSpecific:
type: object
socialNetwork:
type: string
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
500:
$ref: '#/responses/InternalServerError'
'/inbox/templates':
get:
summary: Returns templates
description: Returns all the templates for the current account.
tags:
- templates
responses:
200:
description: List of all the templates of the account
schema:
type: array
items:
$ref: '#/definitions/Template'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
406:
$ref: '#/responses/NotAcceptableError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
post:
summary: Creates a template
description: Creates a template with given text and optional description fields.
tags:
- templates
parameters:
- name: body
in: body
required: true
schema:
type: object
properties:
text:
type: string
description:
type: string
responses:
201:
description: Created template entity
schema:
$ref: '#/definitions/Template'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
406:
$ref: '#/responses/NotAcceptableError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
'/inbox/templates/{id}':
patch:
summary: Updates template
description: Updates template. Requires `EditTemplates` permission.
tags:
- templates
parameters:
- name: id
in: path
description: Id of the template to update.
required: true
type: string
pattern: '^[a-f0-9]{24}$'
- name: body
in: body
required: true
schema:
type: object
properties:
text:
type: string
description:
type: string
responses:
200:
description: Updated template entity
schema:
$ref: '#/definitions/Template'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
406:
$ref: '#/responses/NotAcceptableError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
delete:
summary: Deletes a template.
description: 'Permanently deletes the specified Template entity.'
tags:
- templates
parameters:
- name: id
in: path
description: Id of the template.
required: true
type: string
pattern: '^[a-f0-9]{24}$'
responses:
204:
description: Empty response in case of success.
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
description: "If the provided Template can not be found"
schema:
$ref: '#/definitions/Error'
406:
$ref: '#/responses/NotAcceptableError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
'/logs':
post:
summary: Logs sent data
description: Logs data that was sent from the frontend to Kibana.
tags:
- logs
parameters:
- name: body
in: body
required: true
schema:
type: object
properties:
destination:
type: string
enum: ['elastic', 'amplitude']
default: elastic
level:
type: string
enum: ['debug', 'info', 'warn', 'error', 'fatal', 'stats']
key:
description: Stat key to use. Required for stats logging
type: string
message:
description: Message to log. Required for any log level except stats
type: string
data:
type: object
error:
description: Error object to log. Could be also a string
type: object
responses:
204:
description: Empty response in case of success.
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
500:
$ref: '#/responses/InternalServerError'
'/cp/campaigns/{id}':
patch:
summary: Updates an existing Content Campaign.
description: 'Partially updates an existing Campaign with the specified values. Needed permissions: `EditCampaigns`'
tags:
- campaigns
parameters:
- name: id
in: path
description: Id of the Campaign.
required: true
type: string
pattern: '^[a-f0-9]{24}$'
- name: body
in: body
description: May contain `name`, `description`, `colour`, `startTime` or `endTime` of the Campaign object.
required: true
schema:
$ref: '#/definitions/Campaign'
responses:
200:
description: The updated created Campaign entity.
schema:
$ref: '#/definitions/Campaign'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
406:
$ref: '#/responses/NotAcceptableError'
500:
$ref: '#/responses/InternalServerError'
delete:
summary: Deletes a Content Campaign.
description: 'Permanently deletes the specified Campaign entity. Needed permissions: `EditCampaigns`'
tags:
- campaigns
parameters:
- name: id
in: path
description: Id of the Campaign.
required: true
type: string
pattern: '^[a-f0-9]{24}$'
responses:
204:
description: Empty response in case of success.
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
description: "If the provided Campaign can not be found"
schema:
$ref: '#/definitions/Error'
406:
$ref: '#/responses/NotAcceptableError'
500:
$ref: '#/responses/InternalServerError'
'/accounts':
post:
summary: Creates a new account.
description: 'Creates a new account. Needed permissions: `EditAllAccounts`'
tags:
- accounts
parameters:
- name: body
in: body
required: true
schema:
type: object
properties:
name:
type: string
package:
type: string
enum:
- TRIAL
- AWESOME
- PROFESSIONAL
- ENTERPRISE
locale:
type: string
channelLimit:
type: number
userLimit:
type: number
monitoringResultLimit:
type: number
products:
type: object
properties:
inbox:
type: boolean
default: true
cp:
type: boolean
default: true
ml:
type: boolean
default: true
mlStorageLimit:
type: number
default: 1073741824
expirationTime:
$ref: '#/definitions/Date'
required: ['name', 'package', 'locale', 'monitoringResultLimit', 'products']
responses:
201:
description: Created account.
schema:
$ref: '#/definitions/Account'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
500:
$ref: '#/responses/InternalServerError'
get:
summary: Retrieves all accounts.
description: 'Retrieves all accounts with some additional data for `SUPERADMIN` and `SUPERADMINVIEWER` user, or current user account for basic user.'
tags:
- accounts
responses:
200:
description: List of accounts or just one account
schema:
type: array
items:
$ref: '#/definitions/Account'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
'/accounts/linked':
get:
summary: Returns linked accounts.
description: 'Returns channels of accounts linked to the current account.Required permission: AssignTicket'
tags:
- accounts
responses:
200:
description: Array of accounts with active channels.
schema:
type: array
items:
type: object
properties:
_id:
$ref: '#/definitions/ObjectId'
name:
type: string
channels:
type: array
items:
type: object
properties:
_id:
$ref: '#/definitions/ObjectId'
name:
type: string
imageUrl:
type: string
socialNetwork:
type: string
networkId:
type: string
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
500:
$ref: '#/responses/InternalServerError'
'/accounts/{id}':
get:
summary: Updates an existing account.
description: 'Retuns the specified account, for normal users can only return their own account. Needed permissions: `EditAccount`. Allows superadmin to request accounts of other users. Needed permissions `ViewAllAccounts`: `EditAccountSalesSettings`'
tags:
- accounts
parameters:
- name: id
in: path
description: Id of the Account.
required: true
type: string
pattern: '^[a-f0-9]{24}$'
responses:
200:
description: The requested account entity.
schema:
$ref: '#/definitions/Account'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
patch:
summary: Updates an existing account.
description: 'Partially updates an existing account with the specified values. Needed permissions: `EditAccount`. Allows superadmin to update accounts of other users. Needed permissions: `EditAllAccounts`. Allows superadmin to update the special sales settings like expirationTime, channelLimit etc. Needed permissions: `EditAccountSalesSettings`'
tags:
- accounts
parameters:
- name: id
in: path
description: Id of the Account.
required: true
type: string
pattern: '^[a-f0-9]{24}$'
- name: body
in: body
description: Contains the attributes that should be updated.
required: true
schema:
$ref: '#/definitions/Account'
responses:
200:
description: The updated account entity.
schema:
$ref: '#/definitions/Account'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
'/accounts/customTags/list':
get:
summary: Returns all custom tags variants from accounts.
description: 'Returns all existing custom tags from account documents. Needed permissions: `EditAccountSalesSettings`'
tags:
- accounts
responses:
200:
description: Array of custom tags.
schema:
type: array
items:
type: string
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
500:
$ref: '#/responses/InternalServerError'
'/accounts/updateAiThresholds':
post:
summary: Updates ai threshold values of the user account.
description: 'Updates ai threshold values of the user account. Needed permissions: `EditAccount`, `ViewAccountSettings`.'
tags:
- accounts
parameters:
- name: body
in: body
description: Contains the fields to be updated and the new value.
required: true
schema:
type: object
properties:
field:
type: string
minLength: 1
maxLength: 512
value:
type: number
minimum: 0.15
maximum: 0.99
required:
- field
- value
responses:
204:
description: Empty response in case of success.
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
'/accounts/register':
post:
summary: Registers a new account.
description: Registers a new account and creates a user for it.
tags:
- accounts
parameters:
- name: campaign
in: query
description: Name of the campaign. Will be added to the account custom tags.
required: false
type: string
- name: no-salesforce
in: query
description: If equals 'true', prevents lead creation on salesforce
required: false
type: string
- name: cp-only
in: query
description: If equals 'true', creates an account with only cp enabled. Company name, phone and password are not required in this case.
required: false
type: string
- name: code
in: query
required: false
type: string
description: Name of the code, which will be added to the accounts custom tags and could set different properties.
- name: body
in: body
required: true
schema:
type: object
properties:
firstName:
type: string
lastName:
type: string
password:
type: string
userName:
type: string
email:
type: string
locale:
type: string
company:
type: string
phone:
type: string
reCaptcha:
type: string
lead_source:
type: string
campaign_name:
type: string
utm_campaign:
type: string
utm_source:
type: string
utm_medium:
type: string
utm_content:
type: string
utm_term:
type: string
iqiqreferrer:
type: string
iqiqlandingpage:
type: string
iqiqclientip:
type: string
iqiqclientlanguage:
type: string
iqiqtimestamp:
type: string
required:
- firstName
- lastName
- password
- userName
- email
- locale
- company
- phone
- reCaptcha
responses:
201:
description: Created account object with the additional property `verificationLink`!
schema:
$ref: '#/definitions/Account'
400:
$ref: '#/responses/BadRequestError'
403:
$ref: '#/responses/AccessDenied'
500:
$ref: '#/responses/InternalServerError'
'/accounts/{accountId}/reactivate':
put:
summary: Reactivates an account.
description: Reactivates an account and its reports. Can be used only by superadmin.
tags:
- accounts
parameters:
- name: accountId
in: path
description: accountId which will be reactivated
required: true
type: string
responses:
201:
description: The reactivated account entity.
schema:
$ref: '#/definitions/Account'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/NotAuthorized'
404:
$ref: '#/responses/NotFoundError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
'/accounts/{accountId}/archive':
put:
summary: Archive tickets related to an account.
description: Archives tickets related to an account and, optionally, a channel. Can be used only by superadmin.
tags:
- accounts
parameters:
- name: accountId
in: path
description: accountId to which the tickets are related
required: true
type: string
- name: channelId
in: query
description: channelId to which the tickets are related
required: false
type: string
- name: until
in: query
description: date and time before which all tickets are archived
required: false
type: string
responses:
204:
description: Empty response in case of success
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/NotAuthorized'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
'/cp/analytics/channels':
post:
summary: returns the analytics object for channels.
description: 'Retuns the analytics object for the specified channels within the timeframe as well as values for comparison timefram. If we do not have data for all days within the timeframe incompleteDate will be set to true as well as ealriestDate will specify the first time we created analytics data for channels. Needed permissions `ViewAnalytics`'
tags:
- analytics
parameters:
- name: body
in: body
required: true
schema:
type: object
required: ['channelIds']
properties:
channelIds:
type: array
description: array of channel ids
maxItems: 50
minItems: 1
items:
type: string
pattern: '^[a-f0-9]{24}$'
- name: since
in: query
description: since when the channel analytics should be calculated
required: true
type: string
format: date-time
- name: until
in: query
description: until when the channel analytics should be calculated
required: true
type: string
format: date-time
- name: compareSince
in: query
description: start time of the comparison timeframe used for reach and engagement change calculations
required: true
type: string
format: date-time
- name: compareUntil
in: query
description: end time of the comparison timeframe used for reach and engagement change calculations
required: true
type: string
format: date-time
responses:
200:
description: analytics object.
schema:
$ref: '#/definitions/ChannelAnalytics'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
'/cp/analytics/posts':
post:
summary: returns the analytics object for posts.
description: 'Returns a sorted, paged list of analytics objects for posts. Needed permissions `ViewAnalytics`'
tags:
- analytics
parameters:
- name: since
in: query
description: since when the post analytics should be returned
required: true
type: string
format: date-time
- name: until
in: query
description: until when the post analytics should be returned
required: true
type: string
format: date-time
- name: sortBy
in: query
description: the attribute the returned post analytics are sorted by.
enum: ['date', 'engagement', 'reach', 'quotient', 'clicks']
required: true
type: string
- name: order
in: query
description: ascending or descending order of the returned post analytics
required: true
type: string
enum: ['asc', 'desc']
- $ref: '#/parameters/pagingOffset'
- $ref: '#/parameters/pagingCount'
- name: body
in: body
required: true
schema:
type: object
properties:
channelIds:
type: array
items:
type: string
pattern: '^[a-f0-9]{24}$'
responses:
200:
description: Paginated list of posts
schema:
type: object
properties:
count:
type: number
description: The overall amount of posts for the current filters (for pagination).
data:
type: array
items:
$ref: '#/definitions/PostAnalytics'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
'/cp/analytics/posts/av2':
post:
summary: returns the analytics object for posts.
description: 'Returns a sorted, paged list of analytics objects for posts. Needed permissions `ViewAnalytics`'
tags:
- metrics
parameters:
- name: since
in: query
description: since when the post analytics should be returned
required: true
type: string
format: date-time
- name: until
in: query
description: until when the post analytics should be returned
required: true
type: string
format: date-time
- name: sortBy
in: query
description: the attribute the returned post analytics are sorted by.
enum: ['date', 'engagement', 'reach', 'quotient', 'clicks', 'impressions']
required: true
type: string
- name: order
in: query
description: ascending or descending order of the returned post analytics
required: true
type: string
enum: ['asc', 'desc']
- $ref: '#/parameters/pagingOffset'
- $ref: '#/parameters/pagingCount'
- name: body
in: body
required: true
schema:
type: object
properties:
channelIds:
type: array
items:
type: string
pattern: '^[a-f0-9]{24}$'
tags:
type: array
description: array of tag ids the post must have
items:
type: string
pattern: '^[a-f0-9]{24}$'
tagsOperator:
type: string
enum: ['OR', 'AND']
description: Operator to use for the tags filter. Has effect only if `tags` filter is set explicitly. `OR` - ticket must have at least one of provided tags. `AND` - ticket must have all the provided tags. If not set, the default value is `AND`.
responses:
200:
description: Paginated list of posts
schema:
type: object
properties:
count:
type: number
description: The overall amount of posts for the current filters (for pagination).
data:
type: array
items:
$ref: '#/definitions/PostAnalytics'
warnings:
type: array
items:
type: object
properties:
key:
type: string
enum:
- incompleteData
data:
type: object
properties:
channels:
type: array
items:
$ref: '#/definitions/ObjectId'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
'/cp/analytics/export/csv':
post:
summary: returns the csv file with posts analytics.
description: 'Returns csv file with posts analytics by given filters. Needed permissions `ViewAnalytics`'
tags:
- analytics
parameters:
- name: body
in: body
required: true
schema:
type: object
required: ['start', 'end']
properties:
start:
type: string
format: date-time
description: since when the post analytics should be returned
end:
type: string
format: date-time
description: until when the post analytics should be returned
sortBy:
description: the attribute the returned post analytics are sorted by.
type: string
enum: ['date', 'engagement', 'reach', 'quotient', 'clicks']
order:
description: ascending or descending order of the returned post analytics
type: string
enum: ['asc', 'desc']
channelIds:
type: array
description: array of channel ids
items:
type: string
pattern: '^[a-f0-9]{24}$'
tags:
type: array
description: array of tag ids. Only posts that have all (-> AND connection) specified tags set are returned in csv file.
items:
type: string
pattern: '^[a-f0-9]{24}$'
responses:
200:
description: Created csv file.
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
'/cp/analytics/export/csv/channels':
post:
summary: returns the csv file with channels analytics.
description: 'Returns csv file with channels analytics by given filters. Needed permissions `ViewAnalytics`'
tags:
- analytics
parameters:
- name: body
in: body
required: true
schema:
type: object
required: [ 'start', 'end' ]
properties:
start:
type: string
format: date-time
description: since when the post analytics should be returned
end:
type: string
format: date-time
description: until when the post analytics should be returned
channelIds:
type: array
description: array of channel ids
items:
type: string
pattern: '^[a-f0-9]{24}$'
responses:
200:
description: Created csv file.
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
'/cp/analytics/tags/overview':
get:
summary: returns tag analytics summary.
description: 'Returns tag usage stats by given filters. Needed permissions `ViewAnalytics`'
tags:
- analytics
parameters:
- name: since
in: query
description: since when posts with tag were published
required: true
type: string
format: date-time
- name: until
in: query
description: until when posts with tag were published
required: true
type: string
format: date-time
- name: sortBy
in: query
description: the attribute the returned tags are sorted by.
enum: ['count', 'lastUsed']
required: false
default: count
type: string
- name: order
in: query
description: ascending or descending order of the returned tags overview
type: string
enum: ['asc', 'desc']
required: false
default: desc
- $ref: '#/parameters/pagingOffset'
- $ref: '#/parameters/pagingCount'
responses:
200:
description: Tag analytics overview.
schema:
type: object
properties:
count:
type: number
description: The overall amount of tags for the current filters (for pagination).
data:
type: array
items:
type: object
properties:
_id:
description: id of the tag
type: string
pattern: '^[a-f0-9]{24}$'
name:
description: the name of the tag
type: string
count:
description: the number of times a post was published with the tag
type: number
lastUsed:
description: the most recent publish time of a post with the tag
type: string
format: date-time
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
500:
$ref: '#/responses/InternalServerError'
'/cp/analytics/tags/{id}/summary':
get:
summary: returns analytics summary for a givent tag.
description: 'Returns summed post metrics for a given tag. Needed permissions `ViewAnalytics`'
tags:
- analytics
parameters:
- name: id
in: path
description: id of the tag.
required: true
type: string
pattern: '^[a-f0-9]{24}$'
- name: since
in: query
description: since when posts with tag were published
required: true
type: string
format: date-time
- name: until
in: query
description: until when posts with tag were published
required: true
type: string
format: date-time
- name: compareSince
in: query
description: since when posts with tag were published
required: true
type: string
format: date-time
- name: compareUntil
in: query
description: until when posts with tag were published
required: true
type: string
format: date-time
responses:
200:
description: Tag analytics summary.
schema:
type: object
properties:
clicks:
type: number
description: number of clicks on posts links
reach:
type: object
description: reach metrics
properties:
paid:
type: number
organic:
type: number
total:
type: number
engagement:
type: object
description: engagements metrics
properties:
comments:
type: number
likes:
type: number
shared:
type: number
total:
type: number
compare:
type: object
description: metrics for compare time range
properties:
clicks:
type: number
description: number of clicks on posts links
reach:
type: object
description: reach metrics
properties:
paid:
type: number
organic:
type: number
total:
type: number
engagement:
type: object
description: engagements metrics
properties:
comments:
type: number
likes:
type: number
shared:
type: number
total:
type: number
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
'/cp/analytics/tags/posts':
post:
summary: Returns posts and their metrics for tags
description: Retuns a sorted, paged list of posts with their metrics which are tagged with the specified tags. Needed permissions `ViewAnalytics`
tags:
- analytics
parameters:
- name: body
in: body
description: Ids of the tags you want post analytics for
required: true
schema:
type: array
items:
type: string
pattern: '^[a-f0-9]{24}$'
- name: since
in: query
description: since when the post analytics should be returned
required: true
type: string
format: date-time
- name: until
in: query
description: until when the post analytics should be returned
required: true
type: string
format: date-time
- name: sortBy
in: query
description: the attribute the returned post analytics are sorted by.
enum: ['clicks', 'engagement', 'publishTime']
required: false
type: string
- name: order
in: query
description: ascending or descending order of the returned post analytics
required: false
type: string
enum: ['asc', 'desc']
- $ref: '#/parameters/pagingOffset'
- $ref: '#/parameters/pagingCount'
responses:
200:
description: Paginated list of posts
schema:
type: object
properties:
count:
type: number
description: The overall amount of posts for the current filters (for pagination).
data:
type: array
items:
$ref: '#/definitions/PostAnalyticsRefactored'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
'/cp/analytics/tags/export/csv':
post:
summary: returns the csv file with posts analytics by tags.
description: 'Retuns csv file with posts analytics by given filters. Needed permissions `ViewAnalytics`'
tags:
- analytics
parameters:
- name: body
in: body
required: true
schema:
type: object
required: ['start', 'end']
properties:
start:
type: string
format: date-time
description: since when the post analytics should be returned
end:
type: string
format: date-time
description: until when the post analytics should be returned
sortBy:
description: the attribute the returned post analytics are sorted by.
type: string
enum: ['clicks', 'engagement', 'publishTime']
order:
description: ascending or descending order of the returned post analytics
type: string
enum: ['asc', 'desc']
channelIds:
type: array
description: array of channel ids
items:
type: string
pattern: '^[a-f0-9]{24}$'
tags:
type: array
items:
type: string
pattern: '^[a-f0-9]{24}$'
responses:
200:
description: Created csv file.
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
# Contacts
'/contacts':
get:
summary: Lists the customers contacts.
description: Returns a pagable list of all mail contacts belonging to the account given the user has permission (`ViewContacts`) to request them.
tags:
- contacts
parameters:
- $ref: '#/parameters/pagingOffset'
- $ref: '#/parameters/pagingCount'
responses:
200:
description: List of contacts of the account.
schema:
type: array
items:
$ref: '#/definitions/Contact'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
406:
$ref: '#/responses/NotAcceptableError'
500:
$ref: '#/responses/InternalServerError'
post:
summary: Creates a new contact.
description: Creates a new mail contact in the customers namespace given he has persmission (`EditContacts`) to do so.
tags:
- contacts
parameters:
- name: body
in: body
description: The new contacts contents. The field `_id` will be overridden with actual new Id.
required: true
schema:
$ref: '#/definitions/Contact'
responses:
200:
description: The newly created contact entity.
schema:
type: array
items:
$ref: '#/definitions/Contact'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
406:
$ref: '#/responses/NotAcceptableError'
500:
$ref: '#/responses/InternalServerError'
'/contacts/{id}':
delete:
summary: Deletes a contact.
description: Deletes the specified contact given he belongs to the users account and the user has persmission (`EditContacts`) to do so.
tags:
- contacts
parameters:
- name: id
in: path
description: Id of the contact to delete.
required: true
type: string
pattern: '^[a-f0-9]{24}$'
responses:
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
406:
$ref: '#/responses/NotAcceptableError'
500:
$ref: '#/responses/InternalServerError'
'/cp/tags':
post:
summary: Creates a new Tag.
description: Creates a new tag with the given name. User requires persmission (`CreateTags`) to do so.
tags:
- tags
parameters:
- name: body
in: body
description: The new tag contents. Only the `name` field is necessary for creation.
required: true
schema:
$ref: '#/definitions/Tag'
responses:
200:
description: The newly created Tag entity.
schema:
type: array
items:
$ref: '#/definitions/Tag'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
406:
$ref: '#/responses/NotAcceptableError'
500:
$ref: '#/responses/InternalServerError'
'/cp/tags/get':
post:
summary: Search for Tags
description: Either lists existing tags or searches for suggestions based on the partial beginning of a tag name.
tags:
- tags
parameters:
- name: body
in: body
schema:
type: object
properties:
ids:
type: array
items:
type: string
suggest:
type: string
responses:
200:
description: List of Tags matching the specified filters.
schema:
type: object
properties:
count:
type: number
description: The overall amount of tags for the current filters.
data:
type: array
items:
$ref: '#/definitions/Tag'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
406:
$ref: '#/responses/NotAcceptableError'
500:
$ref: '#/responses/InternalServerError'
'/cp/tags/{id}':
delete:
summary: Deletes a Tag.
description: Deletes the specified tag given it belongs to the users account and the user has persmission (`DeleteTags`) to do so. If the tag is referenced by a Content Planner Post the request will fail with `ConflictError`. If the force parameter is set, all references will be removed before the Tag is deleted.
tags:
- tags
parameters:
- name: id
in: path
description: Id of the contact to delete.
required: true
type: string
pattern: '^[a-f0-9]{24}$'
- name: force
in: query
description: Whether to force deletion of tag and its references.
required: false
default: false
type: boolean
responses:
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
406:
$ref: '#/responses/NotAcceptableError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
'/cp/adAccounts':
post:
summary: creates a multiple new adAccounts
description: 'Creates multiple new adAccount based on the provided data. Required permission: `EditAdAccounts`'
tags:
- ads
- adAccounts
parameters:
- name: body
in: body
description: Data of the adAccounts that should be created. Array of objects
schema:
type: array
items:
type: object
properties:
name:
description: name of the adAccount on Facebook
type: string
networkId:
description: id of the adAccount on Facebook
type: string
businessId:
description: id of the bussines this adAccount belongs to
type: string
currency:
description: currency used in this adAccount
type: string
responses:
201:
description: resultes for all posts to which content was copied
schema:
type: array
items:
type: object
properties:
networkId:
type: string
description: id of the ad account on network
success:
type: boolean
description: was creation successfully executed
reason:
type: string
description: if creation fails contains the reason for it
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
500:
$ref: '#/responses/InternalServerError'
get:
summary: returns list of adAccounts
description: 'Returns a paginated list of Facebook adAccounts. Required permission: `EditAdAccounts`'
tags:
- ads
- adAccounts
parameters:
- name: sort
in: query
description: should returned adAccounts be ordered ascending or descending by name
type: string
enum: ['asc', 'desc']
- $ref: '#/parameters/pagingOffset'
- $ref: '#/parameters/pagingCount'
responses:
200:
description: paginated list of adAccounts
schema:
type: object
properties:
count:
type: number
data:
type: array
items:
$ref: '#/definitions/AdAccount'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
500:
$ref: '#/responses/InternalServerError'
'/cp/adAccounts/{adAccountId}':
delete:
summary: deactivates an existing adAccount
description: 'Marks the specified adAccount as inactive. Required permission: `EditAdAccounts`'
tags:
- ads
- adAccounts
parameters:
- name: adAccountId
in: path
description: id of the adAccount that should be deactivated
type: string
pattern: '^[a-f0-9]{24}$'
required: true
responses:
200:
description: OK
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
'/cp/channels/facebook/adAccess':
post:
summary: requests ad access for channels
description: 'Requests ad access for the specified channels. Required permission: `EditAdAccounts`'
tags:
- ads
parameters:
- name: body
in: body
description: a list of channelIds for which the adAccess should be requested
schema:
type: array
items:
type: string
pattern: '^[a-f0-9]{24}$'
required: true
responses:
200:
description: OK
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
500:
$ref: '#/responses/InternalServerError'
'/cp/ads':
get:
summary: returns list of ads
description: 'Returns a paginated list of Facebook ads belonging to a post. For now this will only be a single post but will be more as soon as we support multiple ads per post. Required permission: `ViewAds`'
tags:
- ads
parameters:
- name: postId
in: query
description: the post for which the ads should be returned
type: string
pattern: '^[a-f0-9]{24}$'
required: true
responses:
200:
description: list of ads
schema:
type: array
items:
$ref: '#/definitions/Ad'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
post:
summary: creates a new ad
description: 'creates a new ad. Required permission: `EditAds`'
tags:
- ads
parameters:
- name: body
in: body
description: data of the ad that should be created
schema:
type: object
properties:
adAccountId:
type: string
networkAd:
type: object
properties:
network:
type: string
enum: ['FACEBOOK']
campaign:
type: object
properties:
id:
type: string
name:
type: string
specialAdCategory:
type: array
items:
type: string
enum: ['HOUSING', 'CREDIT', 'EMPLOYMENT']
adSet:
type: object
properties:
id:
type: string
name:
type: string
campaignId:
type: string
postId:
type: string
responses:
201:
description: created ad object
schema:
$ref: '#/definitions/Ad'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
'/cp/ads/{adId}':
patch:
summary: updates an existing ad
description: 'updates an existing ad. Required permission: `EditAds`'
tags:
- ads
parameters:
- name: adId
in: path
description: id of the ad that should be updated
type: string
pattern: '^[a-f0-9]{24}$'
required: true
- name: body
in: body
description: data of the ad that should be updated
schema:
$ref: '#/definitions/Ad'
responses:
200:
description: updated ad object
schema:
$ref: '#/definitions/Ad'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
delete:
summary: deletes an existing ad
description: 'If the ad was not yet published it is fully deleted. If the ad was published the status is set to `DELETED` on facebook and marked as deleted in socialHub. Required permission: `EditAds`'
tags:
- ads
parameters:
- name: adId
in: path
description: id of the ad that should be deleted
type: string
pattern: '^[a-f0-9]{24}$'
required: true
responses:
200:
description: OK
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
'/cp/ads/{adId}/status/{status}':
post:
summary: updates the status of an ad
description: 'updates the status of an ad and is used to pause and resume a running ad. Required permission: `EditAds`'
tags:
- ads
parameters:
- name: adId
in: path
description: id of the ad that should be updated
type: string
pattern: '^[a-f0-9]{24}$'
required: true
- name: status
in: path
description: the new status the ad should be changed to
type: string
enum: ['paused', 'active']
required: true
responses:
200:
description: updated ad object
schema:
$ref: '#/definitions/Ad'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
'/cp/posts/{postId}/ads/status/{status}':
post:
summary: updates the status of an ad by post id
description: 'updates the status of an ad and is used to pause and resume a running ad. Required permission: `EditAds`'
tags:
- ads
parameters:
- name: postId
in: path
description: id of the post to update the ad status for
type: string
pattern: '^[a-f0-9]{24}$'
required: true
- name: status
in: path
description: the new status the ad should be changed to
type: string
enum: ['paused', 'active']
required: true
responses:
200:
description: updated ad object
schema:
$ref: '#/definitions/Ad'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
'/inbox/tickets/{ticketId}':
get:
summary: Returns ticket data.
description: Returns existing ticket that belong to the current account and user.
tags:
- tickets
parameters:
- name: ticketId
in: path
description: id of the ticket
type: string
pattern: '^[a-f0-9]{24}$'
required: true
responses:
200:
description: ticket entity.
schema:
$ref: '#/definitions/Ticket'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
'/inbox/tickets/{ticketId}/history':
get:
summary: Lists the history of ticket
description: Get a list of all history items related to ticket
tags:
- tickets
parameters:
- name: ticketId
in: path
description: id of the ticket you want the history for
type: string
pattern: '^[a-f0-9]{24}$'
required: true
responses:
200:
description: Successfully return an array of ticket history.
schema:
type: 'array'
items:
type: 'object'
properties:
action:
type: string
pattern: /^[a-zA-Z]+$/
actor:
$ref: '#/definitions/ObjectId'
time:
$ref: '#/definitions/Date'
variables:
type: object
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/AccessDenied'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
'/inbox/tickets/{ticketId}/requests':
post:
summary: Creates a new email request
description: Creates a new email by sending a email with the provided data. Can contain ticket context.
tags:
- tickets
parameters:
- name: ticketId
in: path
description: id of the ticket for with to create an email request
type: string
pattern: '^[a-f0-9]{24}$'
required: true
- name: updatedTime
in: query
description: required if the ticket also has a updatedTime. Request fails if this updatedTime does not match the updatedTime of the ticket in db.
type: string
format: date-time
- name: body
in: body
description: The new contacts contents. The field `_id` will be overridden with actual new Id.
required: true
schema:
allOf:
- $ref: '#/definitions/EmailRequest'
- type: object
properties:
tz:
type: string
description: User timezone (e.g. Europe/Berlin)
responses:
201:
description: The data of the created email request.
schema:
$ref: '#/definitions/EmailRequest'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
406:
$ref: '#/responses/NotAcceptableError'
500:
$ref: '#/responses/InternalServerError'
'/inbox/tickets/{ticketId}/tree':
get:
summary: Returns the full ticket tree
description: Returns the full ticket tree for the specified ticket, used for the original post view in the sidebar
tags:
- tickets
parameters:
- name: ticketId
in: path
description: id of the ticket for which to create the tree
type: string
pattern: '^[a-f0-9]{24}$'
required: true
- name: treeId
in: query
description: id of the channel manifest tree to return
type: string
responses:
201:
description: The data for ticket tree
schema:
type: array
items:
allOf:
- $ref: '#/definitions/Ticket'
- type: object
properties:
depth:
type: number
unreadCommentsCount:
type: number
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
406:
$ref: '#/responses/NotAcceptableError'
500:
$ref: '#/responses/InternalServerError'
'/inbox/tickets/{ticketId}/actions/{actionId}':
post:
summary: Performs an action on a ticket
description: "Performs an action defined in channel manifest on a custom ticket or a default action on a default network. Currently supported default actions: `reply`, `archive`, `assign`. Requires inbox product."
tags:
- tickets
parameters:
- name: ticketId
in: path
description: id of the ticket for which to create the tree
type: string
pattern: '^[a-f0-9]{24}$'
required: true
- name: actionId
in: path
description: id of the manifest action to perform on a ticket
type: string
required: true
pattern: '^[a-zA-Z0-9-_]{1,256}$'
- name: assignee
in: query
description: Id of the user to assign ticket to
pattern: '^[a-f0-9]{24}$'
type: string
- name: archive
in: query
description: Archive a ticket after main action
type: string
enum: ['true']
- name: updatedTime
in: query
description: required if the ticket also has a updatedTime. Request fails if this updatedTime does not match the updatedTime of the ticket in db.
type: string
format: date-time
- name: execAiActions
in: query
description: used to determinate if ai actions should be executes or skipped
type: boolean
- name: body
in: body
required: true
schema:
type: object
properties:
text:
type: string
description: text to send in reply
attachment:
type: string
format: uri
description: url of an attachment
attachmentId:
description: id of the attachment media.
type: string
pattern: '^[a-f0-9]{24}$'
sendAs:
type: string
enum: [
'DM',
'PRIVATE_REPLY'
]
description: option to send a reply as a different type than the default reply type
tag:
type: string
enum: [
'CONFIRMED_EVENT_UPDATE',
'POST_PURCHASE_UPDATE',
'ACCOUNT_UPDATE',
'HUMAN_AGENT'
]
description: Facebook messaging tag for replying out of 24h reply window
channelId:
type: string
pattern: '^[a-f0-9]{24}$'
description: id of the channel that should be used to reply instead of the tickets channel
excludedReplyIds:
type: array
items:
type: string
description: ids of Twitter users that should not be mentioned in a twitter reply
template:
type: object
description: template to use
required: ['name', 'networkId', 'language']
properties:
name:
type: string
networkId:
type: string
language:
type: string
variables:
type: object
description: variables which satisfy restrictions from template.variables
option:
type: string
description: id of the selected reply option
categoryIds:
type: array
minItems: 1
description: ids of categories to assign to the ticket
items:
type: string
pattern: '^[a-f0-9]{24}$'
suggestedAiActions:
type: array
minItems: 0
maxItems: 6
description: possible executable actions (required if execAiActions is true)
items:
type: string
uniqueItems: true
enum: ['archive', 'category', 'delete', 'hide', 'like', 'reply']
responses:
201:
description: Updated ticket
schema:
$ref: '#/definitions/Ticket'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
'/inbox/tickets/actions/bulk/{actionId}':
post:
summary: Performs an action on a list of tickets
description: "Performs an action on multiple tickets at the same time. Currently only supports the `tag` action. Requires inbox product."
tags:
- tickets
parameters:
- name: actionId
in: path
description: action that should be executed
type: string
required: true
enum:
- tag
- sentiment
- name: body
in: body
required: true
schema:
type: object
properties:
ticketIds:
type: array
description: ids of tickets that should be updated with the action
items:
type: string
pattern: '^[a-f0-9]{24}$'
sentiment:
type: string
description: sentiment that should be set to the tickets
enum:
- POSITIVE
- NEGATIVE
- NEUTRAL
categoryIds:
type: array
description: ids of categories to assign to the tickets. Required for the `tag` action
items:
type: string
pattern: '^[a-f0-9]{24}$'
overwriteOldCategories:
type: boolean
description: If multiTagging is inactive the route returns a `TicketAlreadyHasCategory` if a ticket already has a ticket. If this flag is set to `true` the existing category will be replaced instead.
required: ['ticketIds']
responses:
200:
description: Updated tickets
schema:
type: array
items:
$ref: '#/definitions/Ticket'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
'/inbox/tickets/actions/bulk/archive':
put:
summary: Archives a list of tickets
description: "Archives multiple tickets at the same time. Optionally, it can also trigger ai predicted actions."
tags:
- tickets
parameters:
- name: execAiActions
in: query
description: whether ai predicted actions be executed
type: boolean
required: false
- name: body
in: body
required: true
schema:
type: array
items:
type: object
properties:
id:
type: string
pattern: '^[a-f0-9]{24}$'
description: id of one of the tickets that should be archived
updatedTime:
type: string
description: update time of the ticket when it was displayed to the user
suggestedAiActions:
type: array
minItems: 0
maxItems: 6
description: possible executable actions (required if execAiActions is true)
items:
type: string
uniqueItems: true
enum: ['archive', 'category', 'delete', 'hide', 'like', 'reply']
required: ['id', 'updatedTime']
responses:
204:
description: Empty response
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
'/inbox/tickets/{ticketId}/suggest/{actionId}':
post:
summary: Create reply suggestion for a ticket
description: Creates a new reply suggestion for inbox approval process. Requires `ReplyTicket` permission.
tags:
- tickets
parameters:
- name: ticketId
in: path
description: id of the ticket to create reply suggestion for
type: string
pattern: '^[a-f0-9]{24}$'
required: true
- name: actionId
in: path
description: id of the manifest action to perform on a ticket (always `reply` for normal networks)
type: string
required: true
pattern: '^[a-zA-Z0-9-_]{1,256}$'
- name: updatedTime
in: query
description: required if the ticket also has a updatedTime. Request fails if this updatedTime does not match the updatedTime of the ticket in db.
type: string
format: date-time
- name: body
in: body
required: true
schema:
type: object
properties:
text:
type: string
description: text to send in reply
attachment:
type: string
format: url
description: reply attachment
attachmentId:
description: id of the attachment media.
type: string
pattern: '^[a-f0-9]{24}$'
template:
type: object
description: template to use for template reply action
required: ['name', 'networkId', 'language']
properties:
name:
type: string
networkId:
type: string
language:
type: string
variables:
type: object
description: variables which satisfy restrictions from template.variables
sendAs:
type: string
enum: ['DM', 'PRIVATE_REPLY']
description: modifier to send reply as private message
tag:
type: 'string'
enum: [
'CONFIRMED_EVENT_UPDATE',
'POST_PURCHASE_UPDATE',
'ACCOUNT_UPDATE',
'HUMAN_AGENT',
]
description: reply tag to use (facebook)
channelId:
type: string
pattern: '^[a-f0-9]{24}$'
description: id of the channel to use for reply (switch reply channel)
excludedReplyIds:
type: array
description: excluded mentions from the reply (twitter)
items:
type: string
option:
type: string
description: id of the selected reply option
responses:
201:
description: Updated ticket
schema:
$ref: '#/definitions/Ticket'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
'/inbox/tickets/{ticketId}/reject':
post:
summary: rejects a tickets suggestion
description: rejectes the most recent suggestion of the specified ticket. *requires 'ViewTickets' permission
tags:
- tickets
parameters:
- name: ticketId
in: path
description: id of the ticket for which to reject a suggestion
type: string
pattern: '^[a-f0-9]{24}$'
required: true
- name: updatedTime
in: query
description: required if the ticket also has a updatedTime. Request fails if this updatedTime does not match the updatedTime of the ticket in db.
type: string
format: date-time
- name: body
in: body
required: true
schema:
type: object
properties:
text:
type: string
description: text to be added to the rejection followup in ticket
required: ['text']
responses:
200:
description: Updated ticket
schema:
$ref: '#/definitions/Ticket'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
'/inbox/tickets/{ticketId}/approve':
post:
summary: Approve a reply suggestion for a ticket
description: Approves a reply suggestion for inbox approval process. If no information is specified in the request body, the previous suggestion is approved. Otherwise the request body's information will override the previous suggestion and it will be marked as "Edited & Approved". Requires `ApproveSuggestion` permission and sometimes `ApproveOwnSuggestion`.
tags:
- tickets
parameters:
- name: ticketId
in: path
description: id of the ticket to create reply suggestion for
type: string
pattern: '^[a-f0-9]{24}$'
required: true
- name: updatedTime
in: query
description: required if the ticket also has a updatedTime. Request fails if this updatedTime does not match the updatedTime of the ticket in db.
type: string
format: date-time
- name: execAiActions
in: query
description: used to determinate if ai actions should be executes or skipped
type: boolean
- name: body
in: body
required: true
schema:
type: object
properties:
text:
type: string
description: text to send in reply
attachment:
type: string
format: url
description: reply attachment
attachmentId:
description: id of the attachment media.
type: string
pattern: '^[a-f0-9]{24}$'
variables:
type: object
description: variables which satisfy restrictions from template.variables
channelId:
type: string
pattern: '^[a-f0-9]{24}$'
description: reply channel (switch reply channel feature)
excludedReplyIds:
type: array
items:
type: string
suggestedAiActions:
type: array
minItems: 0
maxItems: 6
description: possible executable actions (required if execAiActions is true)
items:
type: string
uniqueItems: true
enum: ['archive', 'category', 'delete', 'hide', 'like', 'reply']
responses:
201:
description: Updated ticket
schema:
$ref: '#/definitions/Ticket'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
'/inbox/tickets/{ticketId}/actions/{actionId}/templates':
get:
summary: Returns action templates from the integration
description: Returns available templates from the integration for the given manifest based channel. Requires inbox product.
tags:
- tickets
parameters:
- name: ticketId
in: path
description: id of the ticket to return templates for
type: string
pattern: '^[a-f0-9]{24}$'
required: true
- name: actionId
in: path
description: id of the manifest action
type: string
required: true
pattern: '^[a-zA-Z0-9-_]{1,256}$'
responses:
201:
description: Array of available templates
schema:
type: object
properties:
name:
type: string
description: name of the template
networkId:
type: string
description: id of the template on network
variables:
type: object
description: definitions of template variables (json schema)
text:
type: object
description: object with language codes as keys and handlebars template strings as values
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
'/inbox/tickets/{ticketId}/priority':
post:
summary: Marks ticket as priority tikcket
description: Marks the specificed ticket with the `priority` tag. Requires inbox product and rules feature.
tags:
- tickets
parameters:
- name: ticketId
in: path
description: id of the ticket which should be marked as priority
type: string
pattern: '^[a-f0-9]{24}$'
required: true
- name: updatedTime
in: query
description: required if the ticket also has a updatedTime. Request fails if this updatedTime does not match the updatedTime of the ticket in db.
type: string
format: date-time
responses:
200:
description: Updated ticket
schema:
$ref: '#/definitions/Ticket'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
delete:
summary: Unmarks ticket as priority tikcket
description: Removes the the `priority` tag from the specificed ticket. Requires inbox product and rules feature.
tags:
- tickets
parameters:
- name: ticketId
in: path
description: id of the ticket which should be unmarked as priority
type: string
pattern: '^[a-f0-9]{24}$'
required: true
- name: updatedTime
in: query
description: required if the ticket also has a updatedTime. Request fails if this updatedTime does not match the updatedTime of the ticket in db.
type: string
format: date-time
responses:
200:
description: Updated ticket
schema:
$ref: '#/definitions/Ticket'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
'/inbox/tickets/{ticketId}/sentiment':
post:
summary: Sets a Ticket sentiment
description: Sets the specified sentiment on the Ticket. Requires inbox product.
tags:
- tickets
parameters:
- name: ticketId
in: path
description: id of the ticket which should be marked as priority
type: string
pattern: '^[a-f0-9]{24}$'
required: true
- name: updatedTime
in: query
description: required if the ticket also has a updatedTime. Request fails if this updatedTime does not match the updatedTime of the ticket in db.
type: string
format: date-time
- name: body
in: body
required: true
schema:
type: object
required: ['sentiment']
properties:
sentiment:
description: 'Can also be nulled to unset sentiment!'
type: 'string'
enum: ['POSITIVE','NEUTRAL','NEGATIVE']
responses:
200:
description: Updated ticket
schema:
$ref: '#/definitions/Ticket'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
'/inbox/tickets/{ticketId}/snooze':
post:
summary: Snoozes a ticket
description: Changes the status of a ticket to `snoozed`. Requires the permission `ArchiveTicket`
tags:
- tickets
parameters:
- name: ticketId
in: path
description: id of the ticket which should moved to snooze folder
type: string
pattern: '^[a-f0-9]{24}$'
required: true
- name: body
in: body
required: true
schema:
type: object
properties:
snoozedUntil:
type: string
format: date-time
required: ['snoozedUntil']
responses:
200:
description: Updated ticket
schema:
$ref: '#/definitions/Ticket'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
'/inbox/tickets/interactor/{interactorId}':
patch:
summary: Updates interactor data in tickets
description: Updates interactor data in tickets owned by him. Requires inbox product and `ViewTickets` permission.
tags:
- tickets
parameters:
- name: interactorId
in: path
description: id of the interactor to update
type: string
pattern: '^[a-f0-9]{24}$'
required: true
- name: body
in: body
required: true
schema:
type: object
properties:
name:
type: string
displayName:
type: string
url:
type: string
format: url
picture:
type: string
format: url
responses:
204:
description: Empty response in case of success
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
500:
$ref: '#/responses/InternalServerError'
'/inbox/tickets/{ticketId}/interactor/block':
post:
summary: Blocks ticket interactor on network
description: Blocks ticket interactor on network (only facebook is supported at the moment). Requires inbox product and `BlockInteractor` permission.
tags:
- tickets
parameters:
- name: ticketId
in: path
description: id of the ticket the action was triggered on
type: string
pattern: '^[a-f0-9]{24}$'
required: true
responses:
200:
description: Updated ticket
schema:
$ref: '#/definitions/Ticket'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
'/inbox/tickets/export':
post:
summary: 'Exports a csv of tickets'
description: 'Exports a csv of tickets restricted by their createdTime, categories and channelId.'
tags:
- tickets
parameters:
- name: body
in: body
required: true
schema:
type: object
required: [start, end]
properties:
start:
type: string
format: date-time
description: 'Filter tickets by their createdTime since the specified ISODate string.'
end:
type: string
format: date-time
description: 'Filter tickets by their createdTime until the specified ISODate string.'
channelIds:
type: array
description: Filter tickets by given channelIds.
items:
$ref: '#/definitions/ObjectId'
categories:
type: array
description: 'Filter tickets by given category ids'
minItems: 1
items:
$ref: '#/definitions/ObjectId'
categoriesOperator:
type: string
enum: ['OR', 'AND']
description: Operator to use for the categories filter. Has effect only if `categories` filter is set explicitly. `OR` - ticket must have at least one of provided categories. `AND` - ticket must have all the provided categories. If not set, the value will be determined by the multiTagging feature.
responses:
200:
description: The created csv file.
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
'/inbox/tickets/{ticketId}/interactors':
get:
summary: Returns a list of interactors that can be mentioned in reply.
description: Returns a list of interactors searched by name, channel and root id. Supports only FB tickets.
tags:
- tickets
parameters:
- name: ticketId
in: path
description: id of the ticket to create reply for
type: string
pattern: '^[a-f0-9]{24}$'
required: true
- name: name
in: query
description: name of the interactor
type: string
responses:
200:
description: The list of found interactors
schema:
type: array
items:
type: object
properties:
id:
$ref: '#/definitions/ObjectId'
name:
type: string
picture:
type: string
format: url
socialNetworkUserId:
type: string
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
406:
$ref: '#/responses/NotAcceptableError'
500:
$ref: '#/responses/InternalServerError'
'/inbox/tickets/{ticketId}/ai-suggestions/{resource}/{action}':
post:
summary: Update selection of the AI suggestions of a ticket
description: Updates selection status of the AI suggestions of a ticket to apply the selected ones later (on archive, etc.)
tags:
- tickets
parameters:
- name: ticketId
in: path
description: id of the ticket
type: string
pattern: '^[a-f0-9]{24}$'
required: true
- name: resource
in: path
description: name of the ai suggestion
type: string
enum: ['actions', 'categories', 'actionGroups']
required: true
- name: action
in: path
description: selection status of the ai suggestion
type: string
enum: ['select', 'deselect']
required: true
- name: body
in: body
required: true
schema:
type: object
properties:
label:
description: label name of the ai suggestion (this body params only required for the "actions" and "categories" url params)
type: 'string'
minLength: 1
maxLength: 512
responses:
200:
description: Updated ticket
schema:
$ref: '#/definitions/Ticket'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
'/inbox/tickets/{ticketId}/categories/{categoryId}':
delete:
summary: Removes category from ticket
description: Removes category from ticket, requires `AssignCategories` permission.
tags:
- tickets
parameters:
- name: categoryId
in: path
description: Identifies the category to delete.
required: true
type: string
pattern: '^[a-f0-9]{24}$'
- name: ticketId
in: path
description: Identifies the ticket to remove the category from.
required: true
type: string
pattern: '^[a-f0-9]{24}$'
responses:
200:
description: Updated ticket
schema:
$ref: '#/definitions/Ticket'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
'/inbox/tickets/{ticketId}/followups/{followupId}':
put:
summary: updates the follow up message
description: updates the followup message for a facebook reply message
tags:
- tickets
parameters:
- name: followupId
in: path
description: Identifies the followupId to update
required: true
type: string
pattern: '^[a-f0-9]{24}$'
- name: ticketId
in: path
description: Identifies the ticket
required: true
type: string
pattern: '^[a-f0-9]{24}$'
responses:
200:
description: Updated ticket
schema:
$ref: '#/definitions/Ticket'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
delete:
summary: Removes followup from ticket
description: Removes followup from ticket, requires `ViewTickets` permission and `DeleteNote` or `DeleteReply` permission depending on followup type.
tags:
- tickets
parameters:
- name: followupId
in: path
description: Identifies the followup to delete.
required: true
type: string
pattern: '^[a-f0-9]{24}$'
- name: ticketId
in: path
description: Identifies the ticket to remove the category from.
required: true
type: string
pattern: '^[a-f0-9]{24}$'
responses:
200:
description: Updated ticket
schema:
$ref: '#/definitions/Ticket'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
'/inbox/tickets/categories/{categoryId}':
delete:
summary: Removes categoryId from all tickets
description: Removes categoryId from all ticket, requires `AssignCategories` permission.
tags:
- tickets
parameters:
- name: categoryId
in: path
description: Identifies the category to delete.
required: true
type: string
pattern: '^[a-f0-9]{24}$'
responses:
204:
description: Category successfully removed from all tickets
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
'/inbox/tickets/{ticketId}/translate':
post:
summary: Returns ticket with a translation in either User or Account locale.
description: Returns existing ticket with a translation of the orginal text comment.
tags:
- tickets
parameters:
- name: ticketId
in: path
description: id of the ticket
type: string
pattern: '^[a-f0-9]{24}$'
required: true
responses:
201:
description: ticket entity.
schema:
$ref: '#/definitions/Ticket'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
'/inbox/interactors/{interactorId}/history':
post:
summary: Returns the ticket history of an interactor
description: Returns the ticket history for the specified interactors, used for the user history view in the sidebar
tags:
- tickets
parameters:
- name: interactorId
in: path
description: id of the interactor for which to create the trees
type: string
pattern: '^[a-f0-9]{24}$'
required: true
- name: body
in: body
description: limit ticket history to these channelIds. If an empty array is provided all channels the current user has access to are used.
required: true
schema:
type: array
items:
type: string
pattern: '^[a-f0-9]{24}$'
responses:
201:
description: The data for interactor history
schema:
type: array
items:
type: array
items:
allOf:
- $ref: '#/definitions/Ticket'
- type: object
properties:
depth:
type: number
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
406:
$ref: '#/responses/NotAcceptableError'
500:
$ref: '#/responses/InternalServerError'
'/inbox/interactors/{interactorId}/networkData':
get:
summary: Returns interactor with network data
description: Returns interactor with network data. At the moment only TWITTER is supported. Requires inbox product and `ViewTickets` permission.
tags:
- tickets
parameters:
- name: interactorId
in: path
description: id of the interactor to return
type: string
pattern: '^[a-f0-9]{24}$'
required: true
- name: channelId
in: query
type: string
pattern: '^[a-f0-9]{24}$'
description: id of the channel to use for network request
required: true
responses:
200:
description: Interactor data. If interactor name, url or picture has changed, status code will be 202
schema:
type: object
properties:
_id:
type: string
pattern: '^[a-f0-9]{24}$'
createdTime:
type: string
format: date-time
updatedTime:
type: string
format: date-time
picture:
type: string
format: url
name:
type: string
username:
type: string
url:
type: string
format: url
socialNetworkUserId:
type: string
socialNetwork:
type: string
networkSpecific:
type: object
properties:
url:
type: string
format: url
profilePicture:
type: string
format: url
username:
type: string
website:
type: string
format: url
friendsCount:
type: number
verified:
type: boolean
description:
type: string
followersCount:
type: number
name:
type: string
channelsRelationship:
type: object
description: interactor relationship object with the channel
changedProperty:
type: string
enum: ['name', 'picture', 'url']
description: name of the changed property (if any of them changed)
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
'/inbox/alerts':
get:
summary: Returns existing alerts that belong to the current account and user
description: Returns existing alerts that belong to the current account and user
tags:
- inbox alerts
responses:
200:
description: List of exiting alerts that belong to the current account and user
schema:
type: array
items:
type: object
properties:
id:
type: string
pattern: '^[a-f0-9]{24}$'
createdTime:
type: string
format: date-time
updatedTime:
type: string
format: date-time
userId:
type: string
pattern: '^[a-f0-9]{24}$'
accountId:
type: string
pattern: '^[a-f0-9]{24}$'
channelIds:
type: array
items:
type: string
pattern: '^[a-f0-9]{24}$'
emails:
type: array
items:
type: string
format: email
excludeBusinessHours:
type: boolean
interval:
type: number
threshold:
type: number
lastAlertTime:
type: string
format: date-time
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
post:
summary: Creates and resturns an alert with belonging to the current account and user
description: Creates and resturns an alert with belonging to the current account and user. Also checks whether the current user has access to the provided channel ids or not
tags:
- inbox alerts
parameters:
- name: body
in: body
required: true
schema:
type: object
properties:
channelIds:
type: 'array'
uniqueItems: true
minItems: 1
items:
type: string
pattern: '^[a-f0-9]{24}$'
interval:
type: number
minimum: 30
maximum: 1440
emails:
type: array
uniqueItems: true
minItems: 1
items:
type: string
format: email
threshold:
type: number
minimum: 10
excludeBusinessHours:
type: boolean
responses:
201:
description: Creates and resturns an alert with belonging to the current account and user
schema:
type: array
items:
type: object
properties:
id:
type: string
pattern: '^[a-f0-9]{24}$'
createdTime:
type: string
format: date-time
updatedTime:
type: string
format: date-time
userId:
type: string
pattern: '^[a-f0-9]{24}$'
accountId:
type: string
pattern: '^[a-f0-9]{24}$'
channelIds:
type: array
items:
type: string
pattern: '^[a-f0-9]{24}$'
emails:
type: array
items:
type: string
format: email
excludeBusinessHours:
type: boolean
interval:
type: number
threshold:
type: number
lastAlertTime:
type: string
format: date-time
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
'/inbox/alerts/{alertId}':
patch:
summary: Updates and resturns an alert that belongs to the current account and user
description: Updates and resturns an alert that belons to the current account and user. Also checks whether the current user has access to the provided channel ids or not
tags:
- inbox alerts
parameters:
- name: alertId
in: path
description: ID of the alert to update
type: string
pattern: '^[a-f0-9]{24}$'
required: true
- name: body
in: body
required: true
schema:
type: object
properties:
channelIds:
type: 'array'
uniqueItems: true
minItems: 1
items:
type: string
pattern: '^[a-f0-9]{24}$'
interval:
type: number
minimum: 30
maximum: 1440
emails:
type: array
uniqueItems: true
minItems: 1
items:
type: string
format: email
threshold:
type: number
minimum: 10
excludeBusinessHours:
type: boolean
responses:
200:
description: Updates and resturns an alert that belongs to the current account and user
schema:
type: array
items:
type: object
properties:
id:
type: string
pattern: '^[a-f0-9]{24}$'
createdTime:
type: string
format: date-time
updatedTime:
type: string
format: date-time
userId:
type: string
pattern: '^[a-f0-9]{24}$'
accountId:
type: string
pattern: '^[a-f0-9]{24}$'
channelIds:
type: array
items:
type: string
pattern: '^[a-f0-9]{24}$'
emails:
type: array
items:
type: string
format: email
excludeBusinessHours:
type: boolean
interval:
type: number
threshold:
type: number
lastAlertTime:
type: string
format: date-time
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
delete:
summary: Deletes an alert that belongs to the current account and user
description: Deletes an alert that belons to the current account and user
tags:
- inbox alerts
parameters:
- name: alertId
in: path
description: ID of the alert to delete
type: string
pattern: '^[a-f0-9]{24}$'
required: true
responses:
204:
description: Deletes an alert that belongs to the current account and user. Empty response
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
500:
$ref: '#/responses/InternalServerError'
'/settings':
get:
summary: returns settings options
description: returns the possible settings options for the current user and account
tags:
- settings
responses:
200:
description: settings options
schema:
$ref: '#/definitions/Settings'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
500:
$ref: '#/responses/InternalServerError'
'/settings/manifests':
get:
summary: Returns reusable manifests available for account
description: Returns an array of reusable manifests for user account. Returns all reusable manifests for SUPERADMIN if `all` query parameter is specified.
tags:
- settings
parameters:
- name: all
in: query
description: whether or not return all reusable manifests for SUPERADMIN
type: boolean
required: false
responses:
200:
description: settings options
schema:
type: array
items:
$ref: '#/definitions/Manifest'
401:
$ref: '#/responses/AccessTokenInvalidError'
500:
$ref: '#/responses/InternalServerError'
'/settings/aiConfigPanel':
get:
summary: Returns ai config panel in a structure according to the account features and ai thresholds
description: Returns ai config panel in a structure according to the account features and ai thresholds
tags:
- settings
responses:
200:
description: Config panel
schema:
$ref: '#/definitions/ConfigPanel'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
500:
$ref: '#/responses/InternalServerError'
'/settings/features':
get:
summary: Returns current state of account features
description: Returns the state of account features for the features page. Requires EditAccount and ViewAccountSettings permissions.
tags:
- settings
responses:
200:
description: State of account features
schema:
type: array
items:
type: object
properties:
group:
type: string
items:
type: array
items:
type: object
properties:
key:
type: string
helpLink:
type: boolean
bundleStatus:
type: object
properties:
enterprise:
type: string
professional:
type: string
state:
type: object
properties:
type:
type: string
active:
type: boolean
disabled:
type: boolean
tooltip:
type: string
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
500:
$ref: '#/responses/InternalServerError'
'/settings/features/request':
post:
summary: Request feature
description: With this endpoint users triggers request feature proces that sends email to CSM. Required permissions EditAccount & ViewAccountSettings
tags:
- settings
parameters:
- name: body
in: body
required: true
schema:
type: object
properties:
featureName:
type: string
description: feature name like it is in `account.features`
required: [featureName]
responses:
200:
description: Feature requested.
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/AccessDenied'
404:
$ref: '#/responses/NotFoundError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
'/manifests/{manifestId}/callbacks/channelCreation':
get:
summary: Redirects user to manifest channel creation url.
description: 'Generates jwt token and redirects user to manifest channel creation url. Required permission: `EditChannels`, `ViewAccountSettings` or `EditTeamChannels`'
tags:
- manifests
parameters:
- name: manifestId
in: path
description: Id of the manifest to create a channel based on
type: string
pattern: '^[a-f0-9]{24}$'
required: true
- name: teamIds
in: query
description: teams to add the channel to
type: string
pattern: '^[a-f0-9]{24}$'
responses:
302:
description: Redirects to the manifest channel creation url
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
'/manifests/{manifestId}/callbacks/channelReactivation':
get:
summary: Redirects user to manifest channel reactivation url.
description: 'Generates jwt token and redirects user to manifest channel reactivation url. Required permission: `EditChannels`, `ViewAccountSettings`'
tags:
- manifests
parameters:
- name: manifestId
in: path
description: Id of the channel manifest
type: string
pattern: '^[a-f0-9]{24}$'
required: true
- name: channelId
in: query
description: Id of the channel to reactivate
type: string
pattern: '^[a-f0-9]{24}$'
required: true
responses:
302:
description: Redirects to the manifest channel creation url
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
'/ml/items':
get:
summary: Returns root directory data for Webix File Manager.
description: 'When the frontend initializes it first fetches the root directory and its contents from here. Folders returned within the root directory will be flagged with `webix_branch` which will cause the frontend to ask for directory contents via the `branch` action.'
tags:
- medialibrary
parameters:
- name: count
in: query
type: number
description: The number of items to return
default: 100
minimum: 0
maximum: 100
- name: offset
in: query
type: number
description: The number of items to skip in the result. Works only with `branch` and `search` actions.
default: 0
minimum: 0
- name: sortBy
in: query
type: string
description: Sorting of items. Works only with `branch` and `search` actions. `score` option sorts items by best/worst search match.
enum: ['value', 'title', 'date', 'size', 'score']
default: 'score'
- name: order
in: query
type: string
description: Order of items. Works only with `branch` and `search` actions.
enum: ['asc', 'desc']
default: 'desc'
- name: teamIds
in: query
description: Visibility filter
type: array
items:
type: string
pattern: '^[a-f0-9]{24}$'
responses:
200:
description: Root directory with children (`data`)
schema:
type: array
items:
$ref: '#/definitions/File'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
500:
$ref: '#/responses/InternalServerError'
post:
summary: Handles Webix File Manager actions.
description: 'Webix sends action data as form urlencoded instead of json.'
tags:
- medialibrary
consumes:
- application/x-www-form-urlencoded
parameters:
- name: body
in: body
description: 'Action and action paramters'
required: true
schema:
type: object
properties:
action:
type: string
enum: ['branch', 'create', 'remove', 'rename', 'move', 'search', 'copy', 'visibility']
source:
type: string
target:
type: string
text:
type: string
count:
type: number
description: The number of items to return. Works only with `branch` and `search` actions.
default: 100
minimum: 0
maximum: 100
offset:
type: number
description: The number of items to skip in the result. Works only with `branch` and `search` actions.
default: 0
minimum: 0
sortBy:
type: string
description: Sorting of items. Works only with `branch` and `search` actions. `score` option sorts items by best/worst search match.
enum: ['value', 'title', 'date', 'size', 'score']
default: 'score'
order:
type: string
description: Order of items. Works only with `branch` and `search` actions.
enum: ['asc', 'desc']
default: 'desc'
userIds:
type: 'array'
description: Filters items by userIds. Works only with `branch` and `search` actions.
items:
type: string
pattern: '^[a-f0-9]{24}$'
types:
type: 'array'
description: Filters items by types (mimetype / folder). Works only with `branch` and `search` actions.
items:
type: string
teamIds:
type: array
description: Visibility filter for `branch` and `search` actions. Value to set for the folder for `visibility` action.
items:
$ref: '#/definitions/ObjectId'
responses:
200:
description: Various responses, but most of the time some form of Media Library File
schema:
$ref: '#/definitions/File'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
415:
$ref: '#/responses/UnsupportedMediaType'
500:
$ref: '#/responses/InternalServerError'
'/ml/media/{mediaId}':
get:
summary: Returns media properties.
description: Returns media meta data and properties of the associated file in media library. Requires `UseMediaLibrary` permission.
tags:
- medialibrary
parameters:
- name: mediaId
in: path
description: Id of the media to return properties data for
type: string
pattern: '^[a-f0-9]{24}$'
required: true
responses:
200:
description: Media library file properties with media meta data
schema:
$ref: '#/definitions/File'
401:
$ref: '#/responses/AccessTokenInvalidError'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
patch:
summary: Updates file properties on media library.
description: Updates file properties on media library. Requires `MediaLibraryEdit` permission.
tags:
- medialibrary
parameters:
- name: mediaId
in: path
description: mediaId of the file to update
type: string
pattern: '^[a-f0-9]{24}$'
required: true
- name: body
in: body
required: true
schema:
type: object
properties:
value:
type: 'string'
title:
type: 'string'
note:
type: 'string'
alt:
type: 'string'
licenseInformation:
type: 'string'
licenseEndDate:
type: 'string'
format: 'date-time'
description: 'Can either be a date or `null` to unset it'
responses:
200:
description: Updated media library file
schema:
$ref: '#/definitions/File'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
404:
$ref: '#/responses/NotFoundError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
post:
summary: Adds existing media to media library.
description: Creates a file in the accounts media library by media
tags:
- medialibrary
parameters:
- name: mediaId
in: path
description: Id of the media to add to the media library
type: string
pattern: '^[a-f0-9]{24}$'
required: true
- name: body
in: body
required: true
schema:
type: object
properties:
directory:
description: Directory within media library to put media into
type: 'string'
propertiesSource:
type: string
pattern: '^[a-f0-9]{24}$'
description: optional mediaId of another media from which to copy all media properties from (title, note, etc.).
responses:
201:
description: File created on media library
schema:
$ref: '#/definitions/File'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
404:
$ref: '#/responses/NotFoundError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
put:
summary: Replaces media of the media lib file.
description: Replaces media of the media lib file and updates properties accordingly
tags:
- medialibrary
parameters:
- name: mediaId
in: path
description: Id of the media to replace
type: string
pattern: '^[a-f0-9]{24}$'
required: true
- name: body
in: body
required: true
schema:
type: object
properties:
mediaId:
description: if of the media to replace the file with
type: 'string'
pattern: '^[a-f0-9]{24}$'
responses:
201:
description: Updated media lib file
schema:
$ref: '#/definitions/File'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
'/analytics/dashboards':
get:
summary: Returns account dashboards.
description: Returns account dashboards. Requires `ViewAnalytics` permission.
tags:
- dashboards
parameters:
- $ref: '#/parameters/pagingOffset'
- $ref: '#/parameters/pagingCount'
responses:
200:
description: List of contacts of the account.
schema:
type: array
items:
$ref: '#/definitions/Dashboard'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
406:
$ref: '#/responses/NotAcceptableError'
500:
$ref: '#/responses/InternalServerError'
post:
summary: Creates a custom dashboard
description: Creates a custom dashboard if title is not already used in account. Requires `EditDashboards` permission.
tags:
- dashboards
parameters:
- name: body
in: body
required: true
schema:
type: object
properties:
title:
type: string
minLength: 3
description:
type: string
content:
type: string
hidden:
type: boolean
channelIds:
type: array
items:
type: string
pattern: '^[a-f0-9]{24}$'
networks:
type: array
items:
type: string
enum: ['FACEBOOK', 'TWITTER', 'YOUTUBE', 'INSTAGRAM_BUSINESS', 'WORDPRESS', 'LINKEDIN', 'CUSTOM', 'SEARCHES', 'WHATSAPP', 'GOOGLE_MY_BUSINESS']
timeRange:
type: object
comparisonTimeRange:
type: object
widgets:
type: array
items:
type: object
responses:
201:
description: Successfully created custom dashboard entity.
schema:
$ref: '#/definitions/Dashboard'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/AccessDenied'
404:
$ref: '#/responses/NotFoundError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
'/analytics/dashboards/{id}':
patch:
summary: Updates a custom dashboard
description: Updates a custom dashboard. Requires `EditDashboards` permission.
tags:
- dashboards
parameters:
- name: id
in: path
description: Id of the dashboard to update.
required: true
type: string
pattern: '^[a-f0-9]{24}$'
- name: body
in: body
required: true
schema:
type: object
properties:
title:
type: string
minLength: 3
description:
type: string
content:
type: string
hidden:
type: boolean
channelIds:
type: array
items:
type: string
pattern: '^[a-f0-9]{24}$'
networks:
type: array
items:
type: string
enum: ['FACEBOOK', 'TWITTER', 'YOUTUBE', 'INSTAGRAM_BUSINESS', 'WORDPRESS', 'LINKEDIN', 'CUSTOM', 'SEARCHES', 'WHATSAPP', 'GOOGLE_MY_BUSINESS']
timeRange:
type: object
comparisonTimeRange:
type: object
widgets:
type: array
items:
type: object
responses:
200:
description: Successfully updated custom dashboard entity.
schema:
$ref: '#/definitions/Dashboard'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/AccessDenied'
404:
$ref: '#/responses/NotFoundError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
delete:
summary: Deletes a custom dashboard
description: Deletes a custom dashboard and throws an error for default dashboards. Requires `EditDashboards` permission.
tags:
- dashboards
parameters:
- name: id
in: path
description: Id of the dashboard to delete.
required: true
type: string
pattern: '^[a-f0-9]{24}$'
responses:
204:
description: Empty response in case of success.
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/AccessDenied'
404:
$ref: '#/responses/NotFoundError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
'/analytics/dashboards/{id}/export':
post:
summary: Exports dashboard as pdf
description: Generates pdf for the given dashboard. Requires `ViewAnalytics` permission.
tags:
- dashboards
parameters:
- name: id
in: path
description: Id of the dashboard to generate pdf for.
required: true
type: string
pattern: '^[a-f0-9]{24}$'
- name: body
in: body
required: true
schema:
type: object
properties:
channelsEmpty:
type: boolean
description: boolean showing if channel filter is active
channelIds:
type: array
description: list of channelIds. Will be provided as `channelFilter` string to export view via puppeteer
items:
type: string
pattern: '^[a-f0-9]{24}$'
start:
type: string
format: date-time
description: start of selected time period
end:
type: string
format: date-time
description: end of selected time period
relative:
type: string
description: predefined relative time range
offset:
type: string
description: offset of the relative time range
comparisonStart:
type: string
format: date-time
description: start of comparison time range
comparisonEnd:
type: string
format: date-time
description: end of comparison time range
comparisonRelative:
type: string
description: predefined relative time range for comparison
comparisonOffset:
type: string
description: offset of the relative comparison time range
tz:
type: string
description: timezone of the user
tags:
type: array
description: array of tag ids. Will be provided as `tags` string to export view via puppeteer
items:
type: string
pattern: '^[a-f0-9]{24}$'
categories:
type: array
description: array of category ids. Will be provided as `categories` string to export view via puppeteer
items:
type: string
pattern: '^[a-f0-9]{24}$'
categoriesOperator:
type: string
enum: ['OR', 'AND']
description: operator to use for the categories filter
window:
type: object
description: object containing the filtering parameters that should be used in the pdf export.
responses:
200:
description: Generated pdf.
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/AccessDenied'
404:
$ref: '#/responses/NotFoundError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
'/analytics/dashboards/shared/{id}':
delete:
summary: Deletes a shared dashboard link
description: Deletes a shared dashboard link and throws an error if the realated dashboard does not belongs to the account. Requires `EditDashboards` permission and `shareDashboardsViaLink` feature.
tags:
- dashboards
parameters:
- name: id
in: path
description: Id of the shared dashboard link to delete
required: true
type: string
pattern: '^[a-f0-9]{24}$'
responses:
204:
description: Empty response in case of success.
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/AccessDenied'
404:
$ref: '#/responses/NotFoundError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
'/analytics/dashboards/shared':
get:
summary: Returns account shared dashboard links or shared dashboard link for one dashboard.
description: Returns account shared dashboard links or shared dashboard link for one dashboard. Requires `EditDashboards` permission and `shareDashboardsViaLink` feature.
tags:
- dashboards
parameters:
- name: dashboardId
in: query
description: id of the dashboard (optional)
type: string
pattern: '^[a-f0-9]{24}$'
responses:
200:
description: List of shared dashboard link.
schema:
type: array
items:
$ref: '#/definitions/SharedDashboardLink'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
406:
$ref: '#/responses/NotAcceptableError'
500:
$ref: '#/responses/InternalServerError'
post:
summary: Create new shared dashboard link
description: Create new shared dashboard link for external user that has no access to socialhub
tags:
- dashboards
parameters:
- name: body
in: body
required: true
schema:
type: object
properties:
name:
type: string
minLength: 3
dashboardId:
type: string
pattern: '^[a-f0-9]{24}$'
channels:
type: array
items:
type: string
pattern: '^[a-f0-9]{24}$'
timeRange:
type: string
comparisonTimeRange:
type: string
responses:
201:
description: Successfully created custom dashboard entity.
schema:
$ref: '#/definitions/SharedDashboardLink'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/AccessDenied'
404:
$ref: '#/responses/NotFoundError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
'/analytics/dashboards/shared/external/dashboard':
get:
summary: Returns the shared dashboard.
description: Returns the shared dashboard.
tags:
- dashboards
parameters:
- name: token
in: query
description: a valid jwt token to access the dashboard
type: string
required: true
responses:
200:
description: Shared dashboard.
schema:
$ref: '#/definitions/Dashboard'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
406:
$ref: '#/responses/NotAcceptableError'
500:
$ref: '#/responses/InternalServerError'
'/cp/analytics/shared/external/posts':
post:
summary: returns the analytics object for posts to external user.
description: 'Returns a sorted, paged list of analytics objects for posts to external user.'
tags:
- dashboards
parameters:
- name: token
in: query
description: a valid jwt token to access the dashboard
type: string
required: true
- name: since
in: query
description: since when the post analytics should be returned
required: true
type: string
format: date-time
- name: until
in: query
description: until when the post analytics should be returned
required: true
type: string
format: date-time
- name: sortBy
in: query
description: the attribute the returned post analytics are sorted by.
enum: [ 'date', 'engagement', 'reach', 'quotient', 'clicks' ]
required: true
type: string
- name: order
in: query
description: ascending or descending order of the returned post analytics
required: true
type: string
enum: [ 'asc', 'desc' ]
- $ref: '#/parameters/pagingOffset'
- $ref: '#/parameters/pagingCount'
- name: body
in: body
required: false
schema:
type: object
properties:
channelIds:
type: array
items:
type: string
pattern: '^[a-f0-9]{24}$'
responses:
200:
description: Paginated list of posts
schema:
type: object
properties:
count:
type: number
description: The overall amount of posts for the current filters (for pagination).
data:
type: array
items:
$ref: '#/definitions/PostAnalytics'
warnings:
type: array
items:
type: object
properties:
key:
type: string
enum:
- incompleteData
data:
type: object
properties:
channels:
type: array
items:
$ref: '#/definitions/ObjectId'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
'/analytics/dashboards/shared/external/metrics/{metric}/{mode}':
post:
summary: Returns metric data to external user
description: Returns metric data for the specified metric and mode.
tags:
- dashboards
parameters:
- name: token
in: query
description: a valid jwt token to access the dashboard
type: string
required: true
- name: metric
in: path
description: What data is it about?
required: true
type: string
- name: mode
in: path
description: How should it be returned?
required: true
type: string
- name: from
in: query
type: string
format: date-time
description: 'Automatically sets start of day of the specified date. Uses start of today if nothing is specified'
- name: to
in: query
type: string
format: date-time
description: 'Automatically sets end of day of the specified date. Uses end of today if nothing is specified.'
- name: comparisonFrom
in: query
type: string
format: date-time
description: 'Start of comparison time'
- name: comparisonTo
in: query
type: string
format: date-time
description: 'End of comparison time'
- name: tz
in: query
type: string
default: 'Europe/Berlin'
description: 'Must be a valid timzone value of moment-timezone'
- name: sortBy
in: query
type: string
enum: [ 'value' ]
- name: order
in: query
type: string
enum: [ 'asc', 'desc' ]
- name: count
in: query
type: integer
minimum: 0
maximum: 500
- name: offset
in: query
type: integer
minimum: 0
- name: body
in: body
required: true
description: 'Array of Channel IDs to return metrics data for. Uses all Channels User has access to if nothing specified.'
schema:
type: object
properties:
channelIds:
type: array
items:
$ref: '#/definitions/ObjectId'
monitoring:
type: string
enum: [ 'EXCLUDE', 'INCLUDE', 'ONLY' ]
default: 'EXCLUDE'
networks:
type: array
items:
type: string
enum: [ 'FACEBOOK', 'TWITTER', 'YOUTUBE', 'INSTAGRAM_BUSINESS', 'WORDPRESS', 'LINKEDIN', 'CUSTOM', 'SEARCHES', 'WHATSAPP', 'GOOGLE_MY_BUSINESS' ]
responses:
200:
description: Metric data
schema:
type: object
properties:
data:
type: array
items:
type: object
properties:
value:
type: number
description: 'Numeric value of the metric'
name:
type: string
description: 'Descriptor the value belongs to (eg. ticket type) / null if value is for all'
channelId:
type: string
pattern: '^[a-f0-9]{24}$'
description: 'Channel the value belongs to / null if value is for all channels'
from:
type: string
format: date-time
description: 'Time range the value belongs to (usually full hours or days)'
to:
type: string
format: date-time
description: 'Time range the value belongs to (usually full hours or days)'
warnings:
type: array
description: 'List of warnings related to the result'
items:
type: object
properties:
key:
type: string
description: 'Translation key for the warning'
data:
type: object
description: "Optional dynamic warning related information (can't be statically stored in the translation)"
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
'/analytics/dashboards/shared/external/metrics':
get:
summary: Returns available metrics and widgets for external users
description: Returns all available metrics and widgets to create custom widgets.
tags:
- dashboards
parameters:
- name: token
in: query
description: a valid jwt token to access the dashboard
type: string
required: true
responses:
200:
description: Available widgets and metrics
schema:
type: object
properties:
widgets:
type: array
items:
type: object
properties:
title:
type: string
description: Widget group title
items:
type: array
items:
type: object
properties:
title:
type: string
description: Widget title
type:
type: string
description: Widget type
disabled:
type: boolean
description: Flag showing whether widget is supported or not
constraints:
type: array
description: Flag showing whether widget is supported or not
items:
type: string
metrics:
type: array
description: List of all available metrics
items:
type: object
properties:
metric:
type: string
description: Type of the metric
mode:
type: string
description: Metric mode
widgets:
type: array
items:
type: string
description: List of widget types the metric can be used in
networks:
type: array
items:
type: string
description: List of social networks supported by the metric
title:
type: string
description: Translated metric title
description:
type: string
description: Translated metric description
area:
type: string
description: Area type of the metric
helpLink:
type: string
description: Zendesk help page link
areas:
type: array
description: List of metric areas
items:
type: object
properties:
type:
type: string
description: Type of the area
title:
type: string
description: Translated area title
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
'/analytics/metrics':
get:
summary: Returns available metrics and widgets
description: Returns all available metrics and widgets to create custom widgets.
tags:
- metrics
responses:
200:
description: Available widgets and metrics
schema:
type: object
properties:
widgets:
type: array
items:
type: object
properties:
title:
type: string
description: Widget group title
items:
type: array
items:
type: object
properties:
title:
type: string
description: Widget title
type:
type: string
description: Widget type
disabled:
type: boolean
description: Flag showing whether widget is supported or not
constraints:
type: array
description: Flag showing whether widget is supported or not
items:
type: string
metrics:
type: array
description: List of all available metrics
items:
type: object
properties:
metric:
type: string
description: Type of the metric
mode:
type: string
description: Metric mode
widgets:
type: array
items:
type: string
description: List of widget types the metric can be used in
networks:
type: array
items:
type: string
description: List of social networks supported by the metric
title:
type: string
description: Translated metric title
description:
type: string
description: Translated metric description
area:
type: string
description: Area type of the metric
helpLink:
type: string
description: Zendesk help page link
areas:
type: array
description: List of metric areas
items:
type: object
properties:
type:
type: string
description: Type of the area
title:
type: string
description: Translated area title
401:
$ref: '#/responses/AccessTokenInvalidError'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
'/analytics/metrics/{metric}/{mode}':
post:
summary: Returns metric data
description: Returns metric data for the specified metric and mode. Requires `ViewAnalytics` permission.
tags:
- metrics
parameters:
- name: metric
in: path
description: What data is it about?
required: true
type: string
- name: mode
in: path
description: How should it be returned?
required: true
type: string
- name: from
in: query
type: string
format: date-time
description: 'Automatically sets start of day of the specified date. Uses start of today if nothing is specified'
- name: to
in: query
type: string
format: date-time
description: 'Automatically sets end of day of the specified date. Uses end of today if nothing is specified.'
- name: comparisonFrom
in: query
type: string
format: date-time
description: 'Start of comparison time'
- name: comparisonTo
in: query
type: string
format: date-time
description: 'End of comparison time'
- name: tz
in: query
type: string
default: 'Europe/Berlin'
description: 'Must be a valid timzone value of moment-timezone'
- name: sortBy
in: query
type: string
enum: ['value']
- name: order
in: query
type: string
enum: ['asc', 'desc']
- name: count
in: query
type: integer
minimum: 0
maximum: 500
- name: offset
in: query
type: integer
minimum: 0
- name: body
in: body
required: true
description: 'Array of Channel IDs to return metrics data for. Uses all Channels User has access to if nothing specified.'
schema:
type: object
properties:
channelIds:
type: array
items:
$ref: '#/definitions/ObjectId'
monitoring:
type: string
enum: ['EXCLUDE', 'INCLUDE', 'ONLY']
default: 'EXCLUDE'
networks:
type: array
items:
type: string
enum: ['FACEBOOK', 'TWITTER', 'YOUTUBE', 'INSTAGRAM_BUSINESS', 'WORDPRESS', 'LINKEDIN', 'CUSTOM', 'SEARCHES', 'WHATSAPP', 'GOOGLE_MY_BUSINESS']
tags:
type: array
items:
$ref: '#/definitions/ObjectId'
tagsOperator:
type: string
enum: ['OR', 'AND']
description: Operator to use for the tags filter. Has effect only if `tags` filter is set explicitly. `OR` - ticket must have at least one of provided tags. `AND` - ticket must have all the provided tags. If not set, the default value is `AND`.
categories:
type: array
items:
$ref: '#/definitions/ObjectId'
categoriesOperator:
type: string
enum: ['OR', 'AND']
description: Operator to use for the categories filter. Has effect only if `categories` filter is set explicitly. `OR` - ticket must have at least one of provided categories. `AND` - ticket must have all the provided categories. If not set, the value will be determined by the multiTagging feature.
responses:
200:
description: Metric data
schema:
type: object
properties:
data:
type: array
items:
type: object
properties:
value:
type: number
description: 'Numeric value of the metric'
name:
type: string
description: 'Descriptor the value belongs to (eg. ticket type) / null if value is for all'
channelId:
type: string
pattern: '^[a-f0-9]{24}$'
description: 'Channel the value belongs to / null if value is for all channels'
from:
type: string
format: date-time
description: 'Time range the value belongs to (usually full hours or days)'
to:
type: string
format: date-time
description: 'Time range the value belongs to (usually full hours or days)'
warnings:
type: array
description: 'List of warnings related to the result'
items:
type: object
properties:
key:
type: string
description: 'Translation key for the warning'
data:
type: object
description: "Optional dynamic warning related information (can't be statically stored in the translation)"
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
'/analytics/metrics/tickets':
post:
summary: returns the analytics object for tickets.
description: 'Returns a paged list of analytics objects for tickets. Needed permissions `ViewAnalytics`'
tags:
- metrics
parameters:
- name: since
in: query
description: since when the ticket analytics should be returned
required: true
type: string
format: date-time
- name: until
in: query
description: until when the ticket analytics should be returned
required: true
type: string
format: date-time
- name: order
in: query
description: ascending or descending order of the returned ticket analytics
required: true
type: string
enum: ['asc', 'desc']
- $ref: '#/parameters/pagingOffset'
- $ref: '#/parameters/pagingCount'
- name: body
in: body
required: true
schema:
type: object
properties:
channelIds:
type: array
items:
type: string
pattern: '^[a-f0-9]{24}$'
monitoring:
type: string
enum: ['EXCLUDE', 'INCLUDE', 'ONLY']
default: 'EXCLUDE'
categories:
type: array
description: array of categories ids the ticket must have
items:
type: string
pattern: '^[a-f0-9]{24}$'
categoriesOperator:
type: string
enum: ['OR', 'AND']
description: Operator to use for the categories filter. Has effect only if `categories` filter is set explicitly. `OR` - ticket must have at least one of provided categories. `AND` - ticket must have all the provided categories. If not set, the value will be determined by the multiTagging feature.
responses:
200:
description: Paginated list of tickets
schema:
type: object
properties:
count:
type: number
description: The overall amount of tickets for the current filters (for pagination).
data:
type: array
items:
$ref: '#/definitions/Ticket'
warnings:
type: array
items:
type: object
properties:
key:
type: string
enum:
- incompleteData
data:
type: object
properties:
channels:
type: array
items:
$ref: '#/definitions/ObjectId'
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
'/productboard/notes':
post:
summary: Creates a note in our productboard
description: Creates a new note in our productboard
tags:
- productboard
parameters:
- name: body
in: body
required: true
description: 'Data for the note'
schema:
type: object
required: ['title', 'content']
properties:
title:
type: string
description: 'title of the productboard note'
minLength: 5
content:
type: string
description: 'text of the productboard note'
minLength: 20
tags:
type: array
description: 'list of tags added to the productboard note'
items:
type: string
responses:
200:
description: 'productboard note id'
schema:
type: object
properties:
id:
type: string
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
'/realtime/media/{mediaId}/converted':
post:
summary: sets converted media
description: update post with converted media and send notification to user
tags:
- realtime
parameters:
- name: mediaId
in: path
description: media id of the converted media
required: true
type: string
pattern: '^[a-f0-9]{24}$'
- name: body
in: body
required: true
description: 'Data for the note'
schema:
type: object
required: ['postId', 'userId']
properties:
postId:
type: string
description: 'post id of the post containing the converted media'
pattern: '^[a-f0-9]{24}$'
userId:
type: string
description: 'user id of the user who triggered the conversion'
pattern: '^[a-f0-9]{24}$'
responses:
204:
description: Empty response in case of success
400:
$ref: '#/responses/BadRequestError'
404:
$ref: '#/responses/NotFoundError'
500:
$ref: '#/responses/InternalServerError'
'/utilities/translations/translate':
post:
summary: Translates some text to a target language.
description: 'Returns the translation of the input text in the selected language as well as the source language that was detected'
tags:
- utilities
parameters:
- name: body
in: body
required: true
description: body containing text, language, targetType and itemId
schema:
type: object
properties:
text:
type: string
sourceLanguage:
type: string
targetLanguage:
type: string
targetType:
type: string
itemId:
type: string
required: ['text', 'targetLanguage', 'targetType', 'itemId']
responses:
200:
description: List of post aggregates.
schema:
type: object
properties:
text:
type: string
sourceLanguage:
type: string
targetLanguage:
type: string
400:
$ref: '#/responses/BadRequestError'
401:
$ref: '#/responses/AccessTokenInvalidError'
403:
$ref: '#/responses/InsufficientPermissions'
409:
$ref: '#/responses/ConflictError'
500:
$ref: '#/responses/InternalServerError'
# Reusable parameter definitions.
parameters:
pagingOffset:
name: offset
in: query
description: How many entities to skip when returning a list.
required: false
type: integer
pagingCount:
name: count
in: query
description: How many entities to show when returning a list.
required: false
type: integer
# Reusable data type schema definitions.
definitions:
ObjectId:
description: Resource identifier string called `ObjectId`.
type: string
pattern: '^[a-f0-9]{24}$'
Date:
description: String of ISODate
type: string
format: date-time
Error:
description: Standard API error object.
type: object
properties:
code:
type: string
pattern: '^[a-zA-Z]*$'
message:
type: string
ValidationError:
description: Entity validation error object.
type: object
properties:
code:
type: string
pattern: '^[a-zA-Z]*$'
message:
type: string
errors:
type: object
properties:
$field:
type: array
items:
type: string
enum: ['publishTimeNotInFuture', 'max1VideoForPostOrTweet', 'noImageAndVideoAtOnce', 'max1AnimationForPostOrTweet', 'noOtherEntitiesWithAnimation', 'noAnimationsForstagram', 'max4ImagesForTwitterTweet', 'max1ImageForFacebookPosts' ,'twitterTweetCharacterCountTooBig', 'requireTextLinkImageOrVideo', 'noTargetingForAlbumPosts']
Account:
type: object
description: A customers own namespace.
properties:
_id:
$ref: '#/definitions/ObjectId'
name:
type: string
createdTime:
$ref: '#/definitions/Date'
expirationTime:
$ref: '#/definitions/Date'
tags:
type: array
items:
type: string
customTags:
type: array
items:
type: string
salesforceId:
type: string
lastActivity:
$ref: '#/definitions/Date'
channelLimit:
type: number
userLimit:
type: number
monitoringResultLimit:
type: number
package:
type: string
features:
type: object
properties:
approvalProcess:
type: boolean
coworking:
type: boolean
rules:
type: boolean
categories:
type: boolean
categoriesForceUserToTag:
type: boolean
categoriesForceUserToTagOne:
type: boolean
templates:
type: boolean
security:
type: boolean
cpApprovalProcess:
type: boolean
contacts:
type: boolean
teams:
type: boolean
hidePlaces:
type: boolean
beta:
type: boolean
switchReplyChannel:
type: boolean
customChannels:
type: boolean
customPermissions:
type: boolean
dontIgnoreSearchResults:
type: boolean
postBasedbox:
type: boolean
customDashboards:
type: boolean
sentiments:
type: boolean
snoozeTickets:
type: boolean
inboxAlerts:
type: boolean
canary:
type: boolean
smartSentiments:
type: boolean
smartAutoArchive:
type: boolean
smartActions:
type: boolean
smartCategories:
type: boolean
smartbox:
type: boolean
analyticsReports:
type: boolean
useSocketCounters:
type: boolean
linkShortener:
type: boolean
skipPublishingRetries:
type: boolean
smartContentPlanner:
type: boolean
shareDashboardsViaLink:
type: boolean
sentimentBasedLikePrediction:
type: boolean
ticketTranslations:
type: boolean
customFolders:
type: boolean
linkedinPrivateProfile:
type: boolean
benchmarking:
type: boolean
availableFeatures:
type: object
properties:
sentiments:
type: boolean
postBasedbox:
type: boolean
rules:
type: boolean
snoozeTickets:
type: boolean
categoriesForceUserToTag:
type: boolean
categoriesForceUserToTagOne:
type: boolean
multiTagging:
type: boolean
cpEmailApprovalProcess:
type: boolean
personalCSM:
type: boolean
shOnboarding:
type: boolean
customPermissions:
type: boolean
switchReplyChannel:
type: boolean
inboxAlerts:
type: boolean
analyticsReports:
type: boolean
customDashboards:
type: boolean
security:
type: boolean
smartSentiments:
type: boolean
smartContentPlanner:
type: boolean
shareDashboardsViaLink:
type: boolean
ticketTranslations:
type: boolean
customFolders:
type: boolean
linkedinPrivateProfile:
type: boolean
locale:
type: string
linkedAccounts:
type: array
items:
$ref: '#/definitions/ObjectId'
manifestIds:
type: array
items:
$ref: '#/definitions/ObjectId'
shortener:
type: object
properties:
mode:
type: string
enum: ['OFF', 'GENERIC', 'OWN']
url:
type: string
privacy:
type: object
properties:
enabled:
type: boolean
dayRange:
type: number
minimum: 14
maximum: 5000
deleteBy:
type: string
enum: ['createdTime', 'lastInteractionTime']
report:
type: boolean
reportRecipients:
type: array
items:
type: string
format: email
deleteOwn:
type: boolean
products:
type: object
properties:
inbox:
type: object
properties:
enabled:
type: boolean
cp:
type: object
properties:
enabled:
type: boolean
ml:
type: object
properties:
enabled:
type: boolean
storage:
type: object
properties:
usage:
type: number
limit:
type: number
support:
type: object
properties:
accessStatus:
type: string
enum: ['never', 'temporary', 'permanent']
accessUntil:
$ref: '#/definitions/Date'
keycloak:
type: object
properties:
realm:
type: string
secret:
type: string
pubKey:
type: string
UserSummary:
type: object
description: User of the customers account. This is the summary format, meaning it only contains the most necessary fields.
properties:
_id:
$ref: '#/definitions/ObjectId'
lastName:
type: string
firstName:
type: string
ChannelSummary:
type: object
description: A customers Social Media channel. This is the summary format, meaning it only contains the most necessary fields.
properties:
_id:
$ref: '#/definitions/ObjectId'
name:
description: Name of the channel as specified on the social network.
type: string
uniqueName:
type: string
socialNetwork:
type: string
enum: ['FACEBOOK', 'TWITTER', 'PLACEHOLDERS', 'INSTAGRAM_BUSINESS']
imageUrl:
description: URL to the channel image as specified by the social network.
type: string
format: uri
products:
type: object
description: List of available products for network
properties:
cp:
type: boolean
description: Content Planner product
inbox:
type: boolean
description: Inbox product
Channel:
type: object
description: A customers Social Media channel.
properties:
_id:
$ref: '#/definitions/ObjectId'
name:
description: Name of the channel as specified on the social network.
type: string
uniqueName:
description: Unique name containing more specific information about the channel.
type: string
socialNetwork:
type: string
enum: ['FACEBOOK', 'TWITTER', 'PLACEHOLDERS', 'INSTAGRAM_BUSINESS', 'WORDPRESS']
imageUrl:
description: URL to the channel image as specified by the social network.
type: string
format: uri
networkUrl:
description: Virtual property returning the URL to the channel on the network
type: string
format: uri
products:
type: object
description: List of available products for network
properties:
cp:
type: boolean
description: Content Planner product
inbox:
type: boolean
description: Inbox product
ChannelsCounts:
type: object
description: An object with counts for default channels and manifests.
properties:
facebook:
description: Counts facebook channels.
type: number
twitter:
description: Counts twitter channels.
type: number
youtube:
description: Counts youtube channels.
type: number
instagram_business:
description: Counts instagram business channels.
type: number
wordpress:
description: Counts wordpress channels.
type: number
linkedin:
description: Counts linkedin channels.
type: number
placeholders:
description: Counts placeholders channels.
type: number
custom:
description: Counts custom channels that don't belong to reusable manifests.
type: number
needsAttention:
description: Counts deleted channels or channels with at least one expiring token (expires in < 7 days).
type: number
totalInTeams:
description: Total number of channels user has access to including placeholders.
type: number
totalInAccount:
description: Number of account channels counted against channels limit.
type: number
User:
type: object
description: A SocialHub user which can do different actions based on his permissions.
properties:
_id:
$ref: '#/definitions/ObjectId'
accountId:
$ref: '#/definitions/ObjectId'
email:
type: string
userName:
type: string
firstName:
type: string
lastName:
type: string
role:
type: string
enum: [
'ADMIN',
'SUPERADMIN',
'SUPERADMINVIEWER',
'SMM',
'SMMWOI',
'CM',
'CMWOI',
'MANAGER',
'USER',
'ASSIGNER',
'REPORTER',
'OBSERVER',
'EDITOR',
'SMMAA',
'ADVERT'
]
locale:
type: string
updatedTime:
$ref: '#/definitions/Date'
createdTime:
$ref: '#/definitions/Date'
history:
$ref: '#/definitions/History'
permissions:
type: array
items:
type: string
readOnlyChannelIds:
type: array
items:
$ref: '#/definitions/ObjectId'
TeamSummary:
type: object
description: A Team determines which users have access to which channels. This is the summary format, meaning it only contains the most necessary fields.
properties:
_id:
$ref: '#/definitions/ObjectId'
name:
type: string
Team:
type: object
description: A team entity that contains all the information the team
properties:
_id:
$ref: '#/definitions/ObjectId'
accountId:
$ref: '#/definitions/ObjectId'
name:
type: string
users:
type: array
items:
$ref: '#/definitions/ObjectId'
channels:
type: array
items:
$ref: '#/definitions/ObjectId'
admins:
type: array
items:
$ref: '#/definitions/ObjectId'
createdTime:
$ref: '#/definitions/Date'
PostGroup:
type: object
description: A group of posts. An account can have multiple postGroups.
properties:
_id:
$ref: '#/definitions/ObjectId'
accountId:
$ref: '#/definitions/ObjectId'
Post:
type: object
description: A Content-Planner Post. N-Posts always belong to a group.
properties:
_id:
$ref: '#/definitions/ObjectId'
accountId:
$ref: '#/definitions/ObjectId'
postGroupId:
$ref: '#/definitions/ObjectId'
channel:
type: object
properties:
id:
$ref: '#/definitions/ObjectId'
uniqueName:
type: string
socialNetwork:
type: string
enum: ['FACEBOOK', 'TWITTER', 'PLACEHOLDERS', 'INSTAGRAM_BUSINESS', 'PINTEREST']
status:
type: string
enum: ['preDraft', 'draft', 'scheduled', 'publishing', 'published', 'failedToPublish', 'failed', 'needsApproval', 'deleted']
flags:
type: object
properties:
imported:
type: boolean
darkpost:
type: boolean
needsAttention:
type: boolean
promoted:
type: boolean
adAccountImported:
type: boolean
scheduleOnNetwork:
type: boolean
firstCommentPublishingFailed:
type: boolean
tags:
type: array
items:
$ref: '#/definitions/Tag'
categories:
type: array
items:
$ref: '#/definitions/ObjectId'
author:
$ref: '#/definitions/ObjectId'
suggestionAuthor:
$ref: '#/definitions/ObjectId'
assignee:
$ref: '#/definitions/ObjectId'
content:
type: object
properties:
type:
type: string
enum: ['POST', 'CAROUSEL','SLIDESHOW', 'ALBUM', 'TWEET', 'MEDIA', 'STORY_WORKAROUND', 'PIN']
text:
type: string
title:
type: string
mentions:
type: array
items:
type: object
properties:
offset:
type: number
length:
type: number
id:
type: string
meta:
type: string
images:
type: array
items:
type: object
properties:
id:
$ref: '#/definitions/Media'
link:
type: string
format: uri
index:
type: number
minimum: 0
maximum: 9
description:
type: string
name:
type: string
altText:
type: string
tags:
type: array
items:
type: object
properties:
id:
type: string
x:
type: number
minimum: 0
maximum: 1
y:
type: number
minimum: 0
maximum: 1
note:
type: string
productTags:
type: array
items:
type: object
properties:
id:
type: string
title:
type: string
x:
type: number
minimum: 0
maximum: 1
y:
type: number
minimum: 0
maximum: 1
videos:
type: array
items:
type: object
properties:
id:
$ref: '#/definitions/Media'
thumbnailId:
$ref: '#/definitions/ObjectId'
index:
type: number
minimum: 0
maximum: 9
link:
type: string
note:
type: string
productTags:
type: array
items:
type: object
properties:
id:
type: string
title:
type: string
animations:
type: array
items:
type: object
properties:
id:
$ref: '#/definitions/Media'
index:
type: number
minimum: 0
maximum: 9
tags:
type: array
items:
type: object
properties:
id:
type: string
x:
type: number
minimum: 0
maximum: 1
y:
type: number
minimum: 0
maximum: 1
productTags:
type: array
items:
type: object
properties:
id:
type: string
title:
type: string
x:
type: number
minimum: 0
maximum: 1
y:
type: number
minimum: 0
maximum: 1
children:
type: array
items:
type: object
properties:
_id:
$ref: '#/definitions/ObjectId'
text:
type: string
link:
type: string
note:
type: string
mediaId:
$ref: '#/definitions/ObjectId'
links:
type: array
items:
type: object
properties:
id:
$ref: '#/definitions/Link'
canCustomize:
type: boolean
customDescription:
type: string
customTitle:
type: string
customImage:
$ref: '#/definitions/Media'
facebookLink:
type: boolean
shortlinks:
type: array
items:
$ref: '#/definitions/Shortlink'
networkItemId:
type: string
location:
type: object
properties:
id:
type: string
name:
type: string
link:
type: string
address:
type: string
retweet:
type: object
properties:
type:
type: string
text:
type: string
networkItemId:
type: string
images:
type: array
items:
type: string
videos:
type: array
items:
type: string
inlineLinks:
type: array
items:
type: object
properties:
offset:
type: number
length:
type: number
anchor:
type: string
href:
type: string
mentions:
type: array
items:
type: object
properties:
offset:
type: number
length:
type: number
firstComment:
type: string
maxLength: 2000
tiktok:
type: object
properties:
allowComments:
type: boolean
default: true
allowDuet:
type: boolean
default: true
allowStitch:
type: boolean
default: true
isBrandOrganic:
type: boolean
default: false
isBrandedContent:
type: boolean
default: false
linkedin:
type: object
properties:
targeting:
$ref: '#/definitions/LinkedinTargeting'
facebook:
type: object
properties:
targeting:
$ref: '#/definitions/FacebookTargeting'
feedTargeting:
$ref: '#/definitions/FacebookTargeting'
pinterest:
type: object
properties:
boardId:
type: string
boardName:
type: string
boardSectionId:
type: string
boardSectionName:
type: string
placeholders:
type: object
properties:
emailAdvanceTime:
$ref: '#/definitions/Date'
createdTime:
$ref: '#/definitions/Date'
updatedTime:
$ref: '#/definitions/Date'
publishTime:
$ref: '#/definitions/Date'
publishTimeZone:
type: string
description: Timezone name of the `publishTime` field. Valid values are the timezone names specified by momentjs (`moment.tz.names()`).
networkUrl:
type: string
format: url
description: URL of the published post on the social network.
warnings:
type: array
items:
type: object
properties:
code:
type: string
path:
type: string
message:
type: string
data:
type: object
storyWorkaround:
type: object
properties:
publisher:
type: string
reminderTime:
$ref: '#/definitions/Date'
PostAggregate:
type: object
description: Contains aggregated post information for a certain time range (eg. for one day).
properties:
since:
$ref: '#/definitions/Date'
until:
$ref: '#/definitions/Date'
data:
type: object
properties:
facebook:
type: number
description: Number of facebook posts within the time range.
twitter:
type: number
description: Number of twitter posts within the time range.
placeholders:
type: number
description: Number of placeholders posts within the time range.
FeedItem:
type: object
description: A Content-Planner Posts history entries and user comments. Field `userId` be empty if feed item is of type `HISTORY` or `SYSTEMMESSAGE`.
properties:
_id:
$ref: '#/definitions/ObjectId'
accountId:
$ref: '#/definitions/ObjectId'
channelId:
$ref: '#/definitions/ObjectId'
postId:
$ref: '#/definitions/ObjectId'
type:
type: string
enum: ['COMMENT', 'HISTORY', 'SYSTEMMESSAGE']
message:
type: string
userId:
$ref: '#/definitions/ObjectId'
key:
type: string
enum: ['created', 'suggested', 'approved', 'failedToPublishInternal', 'failedToPublishNetworkError', 'failedToPublishFalseNetworkError', 'failedToPublishMissingPermission', 'albumFailedToPublishNetworkError', 'rejected', 'published', 'assigned']
createdTime:
$ref: '#/definitions/Date'
data:
description: Information related to the feed item
type: object
properties:
assignee:
$ref: '#/definitions/ObjectId'
recipients:
type: array
items:
type: string
format: email
mentions:
type: array
items:
$ref: '#/definitions/ObjectId'
err:
type: string
publishTime:
type: string
format: date-time
Campaign:
type: object
properties:
_id:
$ref: '#/definitions/ObjectId'
accountId:
$ref: '#/definitions/ObjectId'
name:
type: string
description: A short Campaign name (to display on the calendar)
description:
type: string
description: Detailed Content Campaign description
colour:
type: string
description: The colour to be used for more easily differentiating between different types of campaigns as hexdecimal value (eg. "00aaff").
pattern: '^[a-f0-9]{6}$'
startTime:
$ref: '#/definitions/Date'
endTime:
$ref: '#/definitions/Date'
createdTime:
$ref: '#/definitions/Date'
required:
- name
- startTime
- endTime
Categories:
type: object
properties:
_id:
$ref: '#/definitions/ObjectId'
accountId:
$ref: '#/definitions/ObjectId'
name:
type: string
description: A short Campaign name (to display on the calendar)
description:
type: string
description: Detailed Content Campaign description
parentId:
$ref: '#/definitions/ObjectId'
weight:
type: number
description: weight of category
rootId:
$ref: '#/definitions/ObjectId'
isLeaf:
type: boolean
hidden:
type: boolean
LinkedinTargeting:
type: object
properties:
insustries:
type: array
items:
type: object
properties:
id:
type: string
name:
type: string
geoLocations:
type: array
items:
type: object
properties:
id:
type: string
name:
type: string
jobFunctions:
type: array
items:
type: object
properties:
id:
type: string
name:
type: string
interfaceLocales:
type: array
items:
type: object
properties:
id:
type: string
name:
type: string
FacebookTargeting:
type: object
properties:
age_min:
type: number
minimum: 13
maximum: 65
age_max:
type: number
minimum: 13
maximum: 65
locales:
type: array
items:
type: number
minimum: 0
genders:
type: array
items:
type: number
minimum: 1
maximum: 2
locations:
type: array
items:
type: object
properties:
key:
type: string
name:
type: string
type:
type: string
enum: [country_group, country, region, city, zip]
country_code:
type: string
country_codes:
type: array
items:
type: string
country_name:
type: string
region_id:
type: string
region:
type: string
primary_city_id:
type: string
primary_city:
type: string
supports_region:
type: boolean
supports_city:
type: boolean
is_worldwide:
type: boolean
interests:
type: array
items:
type: object
properties:
id:
type: number
minimum: 0
name:
type: string
topic:
type: string
Shortlink:
type: object
properties:
_id:
$ref: '#/definitions/ObjectId'
url:
description: Unshortened original URL.
type: string
format: uri
shortUrl:
description: Shortened URL.
type: string
format: uri
Link:
type: object
properties:
_id:
$ref: '#/definitions/ObjectId'
accountId:
$ref: '#/definitions/ObjectId'
url:
type: string
format: uri
title:
type: string
description: title for the link preview
description:
type: string
description: for the link preview
images:
type: array
description: list of image urls for the link preview
items:
$ref: '#/definitions/Media'
createdTime:
type: string
format: date-time
updatedTime:
type: string
format: date-time
Media:
type: object
properties:
_id:
$ref: '#/definitions/ObjectId'
name:
description: The original name of the uploaded file
type: string
pattern: '^[0-9a-zA-Z_\-. ]+$'
extension:
description: The lowercased file extension with prefixed dot
type: string
mimetype:
description: The file mimetype determined from extension
type: string
type:
description: The media type, specifies backend processing like thumbnail generation
type: string
enum: [IMAGE, VIDEO, ANIMATION, OTHER]
size:
description: The media file size in bytes
type: number
minimum: 1
url:
description: A publicly reachable URL to the uploaded file
type: string
format: uri
createdTime:
type: string
format: date-time
expirationTime:
description: If set, specified that and when the media should automatically be deleted
type: string
format: date-time
accountId:
$ref: '#/definitions/ObjectId'
userId:
$ref: '#/definitions/ObjectId'
thumbnails:
description: List of available thumbnails for this media. After completing an upload it might take a few seconds before thumbnails are available.
type: array
items:
type: object
properties:
type:
type: string
url:
type: string
format: url
image:
description: Image meta information extracted during thumbnail generation. Field will not be available until thumbnails are generated.
type: object
properties:
width:
type: number
height:
type: number
video:
description: Video meta information extracted during thumbnail generation. Field will not be available until thumbnails are generated.
type: object
properties:
duration:
type: number
width:
type: number
height:
type: number
animation:
description: Animation meta information extracted during thumbnail generation. Field will not be available until thumbnails are generated.
type: object
properties:
width:
type: number
height:
type: number
frames:
type: number
external:
type: boolean
description: Identifies this media as an external file we only have the url to and not the file itself.
ChannelAnalytics:
type: object
properties:
accountId:
$ref: '#/definitions/ObjectId'
channelIds:
type: array
items:
$ref: '#/definitions/ObjectId'
fans:
type: number
fansByGender:
type: object
properties:
male:
type: number
female:
type: number
unknown:
type: number
reach:
type: object
properties:
organic:
type: number
paid:
type: number
total:
type: number
engagement:
type: object
properties:
likes:
type: number
shared:
type: number
comments:
type: number
total:
type: number
earliestDate:
type: string
format: date-time
comparison:
type: object
properties:
fans:
type: number
reach:
type: object
properties:
organic:
type: number
paid:
type: number
total:
type: number
engagement:
type: object
properties:
likes:
type: number
shared:
type: number
comments:
type: number
total:
type: number
earliestDate:
type: string
format: date-time
incompleteData:
type: boolean
PostAnalytics:
allOf:
- $ref: '#/definitions/Post'
- type: object
properties:
metric:
type: object
properties:
_id:
$ref: '#/definitions/ObjectId'
publishDate:
type: string
format: date-time
createdTime:
type: string
format: date-time
updatedTime:
type: string
format: date-time
post:
$ref: '#/definitions/ObjectId'
accountId:
$ref: '#/definitions/ObjectId'
visible:
type: boolean
engagementTotal:
type: number
reachTotal:
type: number
quotient:
type: number
engagement:
type: object
properties:
likes:
type: object
properties:
organic:
type: number
paid:
type: number
shares:
type: object
properties:
organic:
type: number
paid:
type: number
replies:
type: object
properties:
organic:
type: number
paid:
type: number
reach:
type: object
properties:
organic:
type: number
paid:
type: number
clicks:
type: number
PostAnalyticsRefactored:
allOf:
- $ref: '#/definitions/Post'
- type: object
properties:
metric:
type: object
properties:
updatedTime:
type: string
format: date-time
engagement:
type: object
properties:
likes:
type: number
shared:
type: number
comments:
type: number
total:
type: number
reach:
type: object
properties:
paid:
type: number
organic:
type: number
total:
type: number
quotient:
type: number
clicks:
type: number
followers:
type: number
Contact:
type: object
description: E-Mail contact created by the customer. An account can have multiple contacts.
required:
- email
properties:
_id:
$ref: '#/definitions/ObjectId'
email:
type: string
Tag:
type: object
description: Content Planner Content Tags for Tagging Content
required:
- name
properties:
_id:
$ref: '#/definitions/ObjectId'
name:
type: string
createdTime:
type: string
format: date-time
accountId:
$ref: '#/definitions/ObjectId'
AdAccount:
type: object
description: adAccount object used to create Facebook ads
required:
- name
- networkId
- currency
- active
- accessStatus
properties:
_id:
$ref: '#/definitions/ObjectId'
name:
type: string
networkId:
type: string
currency:
type: string
businessId:
type: string
active:
type: boolean
accessStatus:
type: string
enum: ['PENDING', 'REJECTED', 'ACCEPTED']
createdTime:
type: string
format: date-time
updatedTime:
type: string
format: date-time
accountId:
$ref: '#/definitions/ObjectId'
Ad:
type: object
description: advertising object
properties:
name:
type: string
adAccountId:
$ref: '#/definitions/ObjectId'
status:
type: string
enum: ['scheduled', 'publishing', 'published', 'failedToPublish']
networkAd:
type: object
properties:
network:
type: string
enum: ['FACEBOOK']
campaing:
type: object
properties:
id:
type: string
name:
type: string
specialAdCategory:
type: array
items:
type: string
enum: ['HOUSING', 'CREDIT', 'EMPLOYMENT']
adSet:
type: object
properties:
id:
type: string
name:
type: string
status:
type: string
enum: ['ACTIVE', 'PAUSED', 'ACHRIVED', 'DELETED']
postId:
$ref: '#/definitions/ObjectId'
createdTime:
type: string
format: date-time
updatedTime:
type: string
format: date-time
publishTime:
type: string
format: date-time
lockedTime:
type: string
format: date-time
flags:
type: object
properties:
needsAttention:
type: boolean
accountId:
$ref: '#/definitions/ObjectId'
FacebookAdCampaign:
type: object
description: campaign used in advertising
properties:
id:
type: string
name:
type: string
objective:
type: string
enum: [
'APP_INSTALLS',
'BRAND_AWARENESS',
'CONVERSIONS',
'EVENT_RESPONSES',
'LEAD_GENERATION',
'LINK_CLICKS',
'LOCAL_AWARENESS',
'MESSAGES',
'OFFER_CLAIMS',
'PAGE_LIKES',
'POST_ENGAGEMENT',
'PRODUCT_CATALOG_SALES',
'REACH',
'VIDEO_VIEWS'
]
status:
type: string
enum: [
'ACTIVE',
'PAUSED',
'DELETED',
'ARCHIVED'
]
FacebookAdSet:
type: object
description: campaign used in advertising
properties:
id:
type: string
name:
type: string
campaign_id:
type: string
created_time:
type: string
format: date-time
status:
type: string
enum: [
'ACTIVE',
'PAUSED',
'DELETED',
'ARCHIVED'
]
start_time:
type: string
format: date-time
end_time:
type: string
format: date-time
daily_budget:
type: string
lifetime_budget:
type: string
optimization_goal:
type: string
enum: [
'NONE',
'APP_INSTALLS',
'BRAND_AWARENESS',
'AD_RECALL_LIFT',
'ENGAGED_USERS',
'EVENT_RESPONSES',
'IMPRESSIONS',
'LEAD_GENERATION',
'LINK_CLICKS',
'OFFER_CLAIMS',
'OFFSITE_CONVERSIONS',
'PAGE_ENGAGEMENT',
'PAGE_LIKES',
'POST_ENGAGEMENT',
'REACH',
'SOCIAL_IMPRESSIONS',
'VIDEO_VIEWS',
'APP_DOWNLOADS',
'LANDING_PAGE_VIEWS',
'VALUE',
'REPLIES',
'THRUPLAY'
]
targeting:
type: object
properties:
age_max:
type: number
age_min:
type: number
geo_locations:
type: object
properties:
countries:
type: array
items:
type: string
regions:
type: array
items:
type: string
cities:
type: array
items:
type: string
device_platforms:
type: array
items:
type: string
enum: [
'mobile',
'desktop'
]
publisher_platforms:
type: array
items:
type: string
enum: [
'facebook',
'instagram',
'messenger',
'audience_network'
]
facebook_positions:
type: array
items:
type: string
enum: [
'feed',
'right_hand_column',
'marketplace'
]
instagram_positions:
type: array
items:
type: string
enum: [
'stream',
'story'
]
audience_network_positions:
type: array
items:
type: string
enum: [
'classic',
'instream_video',
'rewarded_video'
]
messenger_positions:
type: array
items:
type: string
enum: [
'messenger_home',
'sponsored_messages'
]
destination_type:
type: string
bid_amount:
type: string
EmailRequest:
type: object
description: Data for an email request.
required:
- recipient
- subject
properties:
note:
type: string
recipient:
type: array
items:
type: string
format: 'email'
cc:
type: array
items:
type: string
format: 'email'
subject:
type: string
context:
type: boolean
Ticket:
type: object
description: full ticket of the socilahub inbox
properties:
_id:
type: string
accountId:
type: string
channelId:
type: string
sourceTicketId:
type: string
assignee:
type: string
rootId:
type: string
parentId:
type: string
createdTime:
type: string
format: date-time
updatedTime:
type: string
format: date-time
archivedTime:
type: string
format: date-time
deletedTime:
type: string
format: date-time
anonymitedTime:
type: string
format: date-time
tags:
type: array
items:
type: string
enum: [ 'archived', 'autoArchived', 'massArchived', 'own', 'deletedInNetwork', 'unread', 'edited', 'deleted', 'hidden', 'delayed', 'incomplete', 'assignedByAnotherAccount', 'context', 'darkComment', 'suggested', 'priority', 'handedOver', 'ms1', 'privateReply', 'archivedByAi' ]
threadTags:
type: array
items:
type: string
participants:
type: array
items:
type: object
properties:
name:
type: string
email:
type: string
id:
type: string
followupTo:
type: object
properties:
followupToId:
type: string
createdByUserId:
type: string
categories:
type: array
items:
type: string
searchResult:
type: boolean
handover:
type: boolean
lostControl:
type: boolean
archiveNewComments:
type: boolean
sentiment:
type: string
enum: [ 'POSITIVE', 'NEUTRAL', 'NEGATIVE' ]
interaction:
type: object
properties:
socialNetwork:
type: string
enum: ['FACEBOOK', 'TWITTER', 'INSTAGRAM', 'INSTAGRAM_BUSINESS', 'YOUTUBE', 'GPKACES', 'WEB', 'NEWS', 'BLOGS', 'FORUMS', 'WORDPRESS', 'LINKEDIN']
type:
type: string
enum: ['POST', 'COMMENT', 'THREAD', 'MESSAGE', 'RATING', 'ALBUM', 'PHOTO', 'MENTION', 'DM' , 'MEDIA', 'VIDEO', 'TWEET', 'REVIEW', 'WEB', 'NEWS', 'BLOG', 'FORUM', 'TICKET', 'ADPOST']
subtype:
type: string
enum: ['STATUS', 'VIDEO', 'LINK', 'PHOTO', 'CAROUSEL', null]
message:
type: string
rating:
type: object
properties:
value:
type: number
scale:
type: number
recommendation:
type: string
enum: ['positive', 'negative', null]
networkItemId:
type: string
networkObjectId:
type: string
threadId:
type: string
promotedTweetIds:
type: array
items:
type: string
liked:
type: boolean
likedBy:
type: array
items:
type: string
sharedBy:
type: array
items:
type: string
controlledByUs:
type: boolean
hidden:
type: boolean
published:
type: boolean
pictures:
type: array
items:
type: object
properties:
small:
type: string
large:
type: string
videos:
type: array
items:
type: object
properties:
url:
type: string
format: uri
thumbnail:
type: string
format: uri
url:
type: string
link:
type: string
attachments:
type: array
items:
type: object
createdTime:
type: string
format: date-time
updatedTime:
type: string
format: date-time
interactor:
type: object
properties:
interactorId:
type: string
name:
type: string
picture:
type: string
url:
type: string
linkedInteractors:
type: array
items:
type: object
properties:
networkId:
type: string
name:
type: string
offset:
type: number
length:
type: number
recipients:
type: array
items:
type: string
location:
type: object
properties:
id:
type: string
name:
type: string
canDm:
type: boolean
followups:
type: array
items:
type: object
properties:
id:
type: string
message:
type: string
type:
type: string
enum: ['NOTE', 'REPLY', 'SUGGESTION', 'MAIL']
userId:
type: string
updatedTime:
type: string
format: date-time
createdTime:
type: string
format: date-time
networkId:
type: string
ticketId:
type: string
networkError:
type: string
isDeleted:
type: boolean
status:
type: string
suggestionRejected:
type: boolean
sendAs:
type: string
attachment:
type: string
translation:
type: object
canBeDeleted:
type: boolean
channelId:
type: string
previousVersions:
type: array
items:
type: object
properties:
message:
type: string
author:
type: string
createdTime:
type: string
format: date-time
taskId:
type: string
excludedReplyIds:
type: array
items:
type: string
actionId:
type: string
option:
type: string
template:
type: object
properties:
name:
type: string
networkId:
type: string
text:
type: string
language:
type: string
variables:
type: object
requests:
type: array
items:
type: object
properties:
recipient:
type: string
subject:
type: string
note:
type: string
context:
type: boolean
createdTime:
type: string
format: date-time
cc:
type: string
mailIds:
type: array
items:
type: string
translations:
type: array
items:
type: object
properties:
language:
type: string
text:
type: string
History:
type: object
description: A log entry that describes a specific change.
properties:
_id:
$ref: '#/definitions/ObjectId'
action:
type: string
pattern: /^[a-zA-Z]+$/
itemId:
$ref: '#/definitions/ObjectId'
actor:
$ref: '#/definitions/ObjectId'
time:
$ref: '#/definitions/Date'
variables:
type: object
accountId:
$ref: '#/definitions/ObjectId'
type:
type: string
ConfigPanel:
type: array
description: Structured ai config panel settings and descriptions
items:
type: object
properties:
type:
type: string
description: Type of the config panel card
enum: ['single-step', 'multi-step']
feature:
type: string
description: The account feature that enables or disables this card
isEnabled:
type: boolean
description: The flag indicates whether this card is enabled or disabled
isBlocked:
type: boolean
description: The flag indicates whether this card is blocked or not if some other requred features are disabled
tooltip:
type: string
description: The translation key for tooltip of the card
label:
type: string
description: The translation key for label of the card
icon:
type: string
description: The translation key for icon of the card
description:
type: string
description: The translation key for description of the card
settings:
type: array
description: The threshold settings array of the card
items:
type: object
properties:
label:
type: string
description: The translation key for label of the setting
description:
type: string
description: The translation key for description of the setting
updateField:
type: string
description: The field path of the value to update it
isDisabled:
type: string
description: The flag that indicates whether this setting is disabled ot not
value:
type: object
description: The value related properties of the settings
properties:
type:
type: string
enum: ['drop-down']
description: The ui element for how to display and select the threshold value
format:
type: string
enum: ['percentage']
description: The format of the value
selected:
type: number
description: The actual value of the selected threshold
min:
type: number
description: The possible min value of the threshold
max:
type: number
description: The possible max value of the threshold
step:
type: number
description: The steps to increase or decrease the possible values of the threshold
steps:
type: array
description: The steps of settings group of the card (for multi step cards)
items:
type: object
properties:
label:
type: string
description: The translation key for label of the setting group
oneLiner:
type: string
description: The translation key for one line description of the setting group
description:
type: string
description: The translation key for full description of the setting group
settingsGroups:
type: array
description: The group of settings
items:
type: object
properties:
description:
type: string
description: The translation key for description of the setting group
nextSettingImg:
type: string
description: The translation key for next setting img of the setting group
settings:
type: array
description: The threshold settings array of the card
items:
type: object
properties:
label:
type: string
description: The translation key for label of the setting
labelPrefix:
type: string
description: The translation key for label prefix of the setting
labelSuffix:
type: string
description: The translation key for label suffix of the setting
updateField:
type: string
description: The field path of the value to update it
isDisabled:
type: string
description: The flag that indicates whether this setting is disabled ot not
value:
type: object
description: The value related properties of the settings
properties:
type:
type: string
enum: ['drop-down']
description: The ui element for how to display and select the threshold value
format:
type: string
enum: ['percentage']
description: The format of the value
selected:
type: number
description: The actual value of the selected threshold
min:
type: number
description: The possible min value of the threshold
max:
type: number
description: The possible max value of the threshold
step:
type: number
description: The steps to increase or decrease the possible values of the threshold
Settings:
type: object
description: possible settings options object
properties:
searches:
type: object
properties:
languageValues:
type: array
description: all supported languages for searches according to http://doc.ubermetrics-technologies.com/api-reference/languages-and-media-segments/#Languages
items:
type: 'string'
countryValues:
type: array
description: all supported countries for searches according to ISO3166-1 alpha 2 https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
items:
type: 'string'
roles:
type: object
properties:
roles:
type: array
items:
type: object
properties:
key:
type: string
enum: [
SUPERADMIN,
ADMIN,
SMM,
SMMAA,
SMMWOI,
CM,
CMWOI,
ASSIGNER,
REPORTER,
OBSERVER,
EDITOR,
ADVERT,
CUSTOM
]
title:
type: string
permissions:
type: array
items:
type: string
enum: [
ViewAdminDropdown,
ViewAllAccounts,
EditAllAccounts,
EditAccountSalesSettings,
DeleteAccount,
ViewTickets,
ViewSuggestedTickets,
ViewContacts,
EditContacts,
ViewHistory,
Exportsights,
ViewUsers,
EditUsers,
ViewChannels,
EditChannels,
ViewFeatures,
EditFeatures,
ArchiveNewTickets,
approvalProcess,
coworking,
rules,
categories,
categoriesForceUserToTag,
templates,
cpApprovalProcess,
cpEmailApprovalProcess,
teams,
ViewLinkShortener,
contacts,
fbAds,
ReplyTicket,
ApproveSuggestion,
ApproveOwnSuggestion,
DeleteReply,
HideTicket,
NoteTicket,
DeleteNote,
DeleteTicket,
LikeTicket,
ShareTicket,
AssignTicket,
ArchiveTicket,
ForwardTicket,
HandBackTicket,
ViewCategories,
EditCategories,
AssignCategories,
ViewTemplates,
ViewTeams,
ViewSecuritySettings,
EditSecuritySettings,
ManageSearches,
BlockInteractor,
DeleteChannel,
ShortenLinks,
ViewPosts,
EditPosts,
ViewCollaborationTab,
CreateComment,
PublishPosts,
ApprovePosts,
ApproveOwnPosts,
ViewCampaigns,
EditCampaigns,
EditAccount,
ViewAnalytics,
CreateTags,
DeleteTags,
EditTags,
EditAdAccounts,
ViewAds,
EditAds,
ApprovalRequest,
ViewCalendar,
ViewContentList,
ViewAccountSettings,
ViewPersonalSettings,
UseMediaLibrary,
AddToMediaLibrary,
MediaLibraryEdit,
UseMediaEditor,
UploadMedia,
EditTemplates,
EditCustomFolders
]
permissions:
type: array
items:
type: object
properties:
key:
type: string
enum: [
ApprovePosts,
ApproveOwnPosts,
ViewAds,
EditAds,
ShortenLinks,
ViewPosts,
EditPosts,
ViewCollaborationTab,
CreateComment,
PublishPosts,
ViewCampaigns,
EditCampaigns,
ViewAnalytics,
CreateTags,
DeleteTags,
EditTags,
ApprovalRequest,
ViewSuggestedTickets,
ArchiveNewTickets,
ViewCategories,
AssignCategories,
ViewContacts,
EditContacts,
ViewTemplates,
ViewTickets,
ViewHistory,
Exportsights,
ReplyTicket,
ApproveSuggestion,
ApproveOwnSuggestion,
DeleteReply,
HideTicket,
NoteTicket,
DeleteNote,
DeleteTicket,
LikeTicket,
ShareTicket,
AssignTicket,
ArchiveTicket,
ForwardTicket,
HandBackTicket,
BlockInteractor,
ViewUsers,
ViewChannels,
UseMediaLibrary,
AddToMediaLibrary,
MediaLibraryEdit,
UseMediaEditor,
UploadMedia,
EditTemplates,
EditCustomFolders
]
title:
type: string
description:
type: string
type:
type: string
enum: [
general,
inbox,
cp
]
typeTitle:
type: string
description: Translated permission type
networks:
type: array
items:
type: object
properties:
network:
type: string
type:
type: string
enum: ['default', 'manifest', 'teaser']
manifest:
$ref: '#/definitions/Manifest'
title:
type: string
description:
type: string
moreDetails:
type: string
detailsLink:
type: string
addButtonLabel:
type: string
teaserTitle:
type: string
teaserDescription:
type: string
Category:
type: object
description: category object
properties:
name:
type: string
description:
type: string
isLeaf:
type: boolean
accountId:
$ref: '#/definitions/ObjectId'
parentId:
$ref: '#/definitions/ObjectId'
rootId:
$ref: '#/definitions/ObjectId'
Manifest:
type: object
description: channel manifest
properties:
branding:
type: object
properties:
icon:
description: 'HTTPS URL to Network icon (eg. Twitter Bird)'
type: string
format: uri
pattern: '^https://'
fallback:
description: 'HTTPS URL to fallback icon (eg. shown for ticket interactors without avatar)'
type: string
format: uri
pattern: '^https://'
color:
description: 'HTML Hex color code for Network branding (eg. Facebook blue for Ticket borders)'
type: string
pattern: '^#[0-9a-f]{3,6}$'
webhook:
type: object
properties:
url:
type: string
format: uri
secret:
type: string
inbox:
type: object
properties:
ticketActions:
type: array
items:
type: object
properties:
id:
type: string
type:
type: string
label:
type: string
config:
type: object
properties:
approvalProcess:
type: boolean
templates:
type: object
properties:
url:
type: string
format: url
timeout:
type: object
properties:
duration:
type: string
example: '24h'
after:
type: string
enum: ['networkCreationTime']
required:
- duration
- after
forceTagging:
type: boolean
attachments:
type: object
description: 'When set allows attachments to be specified for a `reply` ticket action.'
properties:
noText:
type: boolean
default: false
description: 'When enabled then there is no additional text allowed when an attachment is provided'
rightSidebar:
type: array
items:
type: object
properties:
id:
type: string
label:
type: string
treeBuilder:
type: string
enum: ['flatListWithoutRoot', 'flatListWithRoot']
callbacks:
type: object
properties:
channelCreation:
type: string
File:
description: Media Library File
type: object
properties:
id:
description: Full filepath
type: string
value:
description: Filename
type: string
type:
description: Filetype (`folder` for folders, mimetype for files)
type: string
size:
description: Filesize
type: number
minimum: 0
date:
description: Unix Timestamp of File creation
type: number
webix_branch:
description: (Folders only) Whether Webix File Manager needs to get folder contents via the `branch` action
type: boolean
webix_child_branch:
description: (Folders only) Whether this folder has contents
type: boolean
open:
type: boolean
data:
description: (Folders only) The contents of this folder
type: array
items:
$ref: '#/definitions/File'
accountId:
description: (Custom field) ID of the Account the Media Library item belongs to (for namespacing)
type: string
userId:
description: (Custom field) ID of the User who created the item (if not set, created by System)
type: string
mediaId:
description: (Custom field) ID of the Media in database
type: string
media:
$ref: '#/definitions/Media'
title:
description: (Custom field) Media title
type: string
note:
description: (Custom field) Internal note of the media
type: string
alt:
description: (Custom field) Alternative text of the media
type: string
licenseInformation:
description: (Custom field) Media license information
type: string
licenseEndDate:
description: (Custom field) Expiration date of media license
type: string
format: 'date-time'
thumbnail:
description: (Files only) URL to thumbnail of the media item
type: string
format: 'url'
thumbnails:
description: (Folders only) URLs to thumbnails of up to 4 media items contained
type: array
items:
type: string
format: 'url'
teamIds:
description: (Folders only) Visibility filter
type: array
items:
$ref: '#/definitions/ObjectId'
Rule:
description: Smart rule
type: object
properties:
name:
type: string
description:
type: string
active:
type: boolean
weight:
type: number
minimum: 0
trigger:
type: string
enum: ['ticket_creation']
entity:
type: string
enum: ['ticket']
conditions:
type: array
items:
type: object
properties:
condition:
type: string
enum: [
'message_has_keyword',
'message_consists_of_mentions',
'message_has_mention',
'type',
'ticket_belongs_to_channel',
'ticket_belongs_to_network',
]
config:
type: object
properties:
channelIds:
type: array
items:
type: string
pattern: '^[a-f0-9]{24}$'
keywordList:
type: string
pattern: '^[a-f0-9]{24}$'
types:
type: array
items:
type: object
properties:
network:
type: string
type:
type: string
networks:
type: array
items:
type: string
actions:
type: array
items:
type: object
properties:
action:
type: string
enum: [
'archive',
'mark_as_priority',
'assign',
'hide',
'delete',
'forward_by_mail',
'like',
'tag',
'sentiment'
]
config:
type: object
properties:
recipients:
type: array
items:
type: string
format: email
cc:
type: array
items:
type: string
format: email
context:
type: boolean
subject:
type: string
message:
type: string
replyTo:
type: string
format: email
categoryIds:
type: array
items:
type: string
pattern: '^[a-f0-9]{24}$'
sentiment:
type: string
enum: ['POSITIVE', 'NEUTRAL', 'NEGATIVE']
Template:
description: Inbox template
type: object
properties:
text:
type: string
description:
type: string
accountId:
type: string
pattern: '^[a-f0-9]{24}$'
createdTime:
type: string
format: date-time
updatedTime:
type: string
format: date-time
Font:
description: Media editor font
type: object
properties:
accountId:
type: string
pattern: '^[a-f0-9]{24}$'
fontFamily:
type: string
identifier:
type: string
styles:
type: object
properties:
fontWeight:
type: string
fontStyle:
type: string
mediaIds:
type: array
items:
type: string
pattern: '^[a-f0-9]{24}$'
createdTime:
type: string
format: date-time
updatedTime:
type: string
format: date-time
Folder:
description: Custom Inbox Folder
type: object
properties:
accountId:
type: string
pattern: '^[a-f0-9]{24}$'
createdTime:
type: string
format: date-time
updatedTime:
type: string
format: date-time
name:
type: string
scope:
type: string
enum: ['ACCOUNT']
filters:
type: array
items:
type: object
Search:
description: Monitoring search
type: object
properties:
accountId:
type: string
pattern: '^[a-f0-9]{24}$'
createdTime:
type: string
format: date-time
updatedTime:
type: string
format: date-time
name:
type: string
uniqueName:
type: string
socialNetwork:
type: string
enum: ['SEARCHES']
tags:
type: array
items:
type: string
endpoint:
type: object
SearchBody:
description: Request body to created/update a monitoring search
type: object
required: ['name', 'networks', 'languages', 'countries']
properties:
name:
type: string
maxLength: 50
networks:
type: array
uniqueItems: true
items:
type: string
enum: ['TWITTER', 'INSTAGRAM', 'WEB', 'BLOGS', 'FORUMS', 'NEWS', 'YOUTUBE']
languages:
type: array
uniqueItems: true
items:
type: string
enum: ['de', 'en', 'af', 'sq', 'ar', 'an', 'eu', 'be', 'bn', 'br', 'bg', 'ca', 'zh', 'cs', 'hr', 'da', 'nl', 'et', 'fr', 'fi', 'gl', 'el', 'gu', 'ht', 'hi', 'he', 'hu', 'is', 'id', 'ga', 'it', 'ja', 'kn', 'lv', 'ko', 'mk', 'ms', 'lt', 'ml', 'mt', 'mr', 'no', 'ne', 'oc', 'fa', 'pl', 'pt', 'pa', 'ro', 'ru', 'sr', 'sk', 'sl', 'so', 'es', 'sw', 'sv', 'ta', 'te', 'tl', 'th', 'tr', 'uk', 'ur', 'vi', 'cy', 'yi']
countries:
type: array
uniqueItems: true
items:
type: string
enum: ['AF', 'AX', 'AL', 'AS', 'DZ', 'AD', 'AO', 'AI', 'AQ', 'AG', 'AR', 'AM', 'AW', 'AT', 'AU', 'BS', 'AZ', 'BH', 'BD', 'BB', 'BY', 'BE', 'BZ', 'BJ', 'BM', 'BT', 'BO', 'BA', 'BQ', 'BW', 'BV', 'BR', 'IO', 'BN', 'BG', 'BF', 'BI', 'KH', 'CM', 'CA', 'CV', 'CF', 'KY', 'TD', 'CL', 'CN', 'CX', 'CC', 'CO', 'KM', 'CG', 'CD', 'CK', 'CR', 'CI', 'HR', 'CU', 'CW', 'CY', 'CZ', 'DK', 'DJ', 'DM', 'EC', 'DO', 'EG', 'SV', 'GQ', 'ER', 'EE', 'ET', 'FK', 'FO', 'FJ', 'FI', 'FR', 'GF', 'PF', 'TF', 'GA', 'GM', 'GE', 'DE', 'GH', 'GI', 'GR', 'GL', 'GD', 'GP', 'GU', 'GT', 'GG', 'GN', 'GW', 'GY', 'HT', 'HM', 'VA', 'HN', 'HK', 'HU', 'IS', 'IN', 'ID', 'IR', 'IQ', 'IE', 'IM', 'IL', 'IT', 'JM', 'JP', 'JE', 'JO', 'KZ', 'KE', 'KI', 'KP', 'KW', 'KR', 'LA', 'KG', 'LV', 'LB', 'LS', 'LR', 'LY', 'LI', 'LT', 'LU', 'MO', 'MK', 'MG', 'MY', 'MW', 'MV', 'ML', 'MT', 'MH', 'MQ', 'MR', 'MU', 'YT', 'MX', 'FM', 'MD', 'MC', 'MN', 'MS', 'ME', 'MA', 'MZ', 'MM', 'NA', 'NR', 'NP', 'NL', 'NC', 'NZ', 'NI', 'NE', 'NG', 'NU', 'NF', 'MP', 'NO', 'OM', 'PK', 'PW', 'PS', 'PA', 'PG', 'PY', 'PE', 'PH', 'PN', 'PL', 'PT', 'PR', 'QA', 'RE', 'RO', 'RU', 'RW', 'BL', 'SH', 'KN', 'LC', 'MF', 'VC', 'PM', 'WS', 'SM', 'ST', 'SA', 'SN', 'RS', 'SC', 'SL', 'SG', 'SX', 'SK', 'SI', 'SB', 'SO', 'ZA', 'GS', 'SS', 'ES', 'LK', 'SD', 'SR', 'SJ', 'SZ', 'SE', 'CH', 'SY', 'TW', 'TJ', 'TZ', 'TH', 'TL', 'TG', 'TK', 'TO', 'TT', 'TN', 'TR', 'TM', 'TC', 'TV', 'UG', 'UA', 'AE', 'GB', 'US', 'UM', 'UY', 'UZ', 'VU', 'VE', 'VN', 'VG', 'VI', 'WF', 'EH', 'YE', 'ZM', 'ZW']
groups:
type: array
description: Search phrase groups (AND)
uniqueItems: true
items:
type: object
required: ['phrases', 'exclude']
description: Search phrases (OR)
properties:
phrases:
type: array
uniqueItems: true
items:
type: string
pattern: ^([^*].*[^*]|\*+[^*].+[^*]|[^*].+[^*]\*+|\*+[^*].{2,}[^*]\*+)$
exclude:
type: boolean
KeywordListSummary:
description: keywordList defining a list of keywords used in smart rules
type: object
properties:
_id:
type: string
pattern: '^[a-f0-9]{24}$'
accountId:
type: string
pattern: '^[a-f0-9]{24}$'
name:
type: string
createdTime:
type: string
format: date-time
InteractorListSummary:
description: InteractorList defining a list of interactors used in smart rules
type: object
properties:
_id:
type: string
pattern: '^[a-f0-9]{24}$'
name:
type: string
accountId:
type: string
pattern: '^[a-f0-9]{24}$'
createdTime:
type: string
format: date-time
KeywordList:
description: keywordList defining a list of keywords used in smart rules
type: object
properties:
_id:
type: string
pattern: '^[a-f0-9]{24}$'
accountId:
type: string
pattern: '^[a-f0-9]{24}$'
name:
type: string
keywords:
type: array
items:
type: string
createdTime:
type: string
format: date-time
InteractorList:
description: InteractorList defining a list of interactors used in smart rules
type: object
properties:
_id:
type: string
pattern: '^[a-f0-9]{24}$'
accountId:
type: string
pattern: '^[a-f0-9]{24}$'
name:
type: string
list:
type: array
items:
type: object
properties:
channelId:
type: string
pattern: '^[a-f0-9]{24}$'
interactorId:
type: string
pattern: '^[a-f0-9]{24}$'
createdTime:
type: string
format: date-time
InteractorListPopulated:
description: InteractorList defining a list of interactors used in smart rules
type: object
properties:
_id:
type: string
pattern: '^[a-f0-9]{24}$'
accountId:
type: string
pattern: '^[a-f0-9]{24}$'
name:
type: string
createdTime:
type: string
format: date-time
updatedTime:
type: string
format: date-time
list:
type: array
items:
type: object
properties:
channelId:
$ref: '#/definitions/ObjectId'
interactorId:
type: object
properties:
_id:
$ref: '#/definitions/ObjectId'
name:
type: string
picture:
type: string
format: url
socialNetworkUserId:
type: string
socialNetwork:
type: string
url:
type: string
format: url
networkSpecific:
type: object
Dashboard:
description: dashboard defining widgets to display metrics
type: object
properties:
_id:
type: string
pattern: '^[a-f0-9]{24}$'
accountId:
type: string
pattern: '^[a-f0-9]{24}$'
createdTime:
type: string
format: date-time
updatedTime:
type: string
format: date-time
default:
type: boolean
hidden:
type: boolean
category:
type: string
enum: ['default', 'custom', 'tags']
name:
type: string
description:
type: string
channelIds:
type: array
items:
type: string
pattern: '^[a-f0-9]{24}$'
networks:
type: array
items:
type: string
enum: ['FACEBOOK', 'TWITTER', 'YOUTUBE', 'INSTAGRAM_BUSINESS', 'WORDPRESS', 'LINKEDIN', 'CUSTOM', 'SEARCHES', 'WHATSAPP', 'GOOGLE_MY_BUSINESS']
timeRange:
type: object
comparisonTimeRange:
type: object
widgets:
type: array
items:
type: object
type:
type: string
EmailReport:
type: object
description: Automated email report configuration. An account can have multiple contacts.
required:
- type
- interval
- emails
properties:
_id:
$ref: '#/definitions/ObjectId'
type:
type: 'string'
enum: [
'inbox_insights_general_csv',
'inbox_insights_monitoring_csv',
'inbox_categories_summary_csv',
'cp_content_csv',
'cp_analytics_channels_csv',
'cp_analytics_tags_csv',
'inbox_categories_tickets_csv',
]
interval:
type: string
enum: [ daily, weekly, monthly ]
emails:
type: array
uniqueItems: true
minItems: 1
maxItems: 1000
items:
type: string
format: email
SharedDashboardLink:
description: shared dashboard link to external user that does not have access to socialhub
type: object
properties:
_id:
type: string
pattern: '^[a-f0-9]{24}$'
accountId:
type: string
pattern: '^[a-f0-9]{24}$'
dashboardId:
type: string
pattern: '^[a-f0-9]{24}$'
channels:
type: array
items:
type: string
pattern: '^[a-f0-9]{24}$'
name:
type: string
timeRange:
type: string
comparisonTimeRange:
type: string
jwt:
type: string
url:
type: string
# Reusable API response definitions.
responses:
BadRequestError: # 400
description: The request was malformed and rejected.
schema:
$ref: '#/definitions/Error'
AccessTokenInvalidError: # 401
description: The specified access token is not or no longer valid.
schema:
$ref: '#/definitions/Error'
AccessDenied: # 403
description: The user does not have access to the requested resource.
schema:
$ref: '#/definitions/Error'
NotAuthorized: # 403
description: The user is not authorized to have access to the requested resource.
schema:
$ref: '#/definitions/Error'
InsufficientPermissions: # 403
description: The user does not have the required permissions for the operation.
schema:
$ref: '#/definitions/Error'
NotFoundError: # 404
description: The requested resource could not be found.
schema:
$ref: '#/definitions/Error'
NotAcceptableError: # 406
description: The requested acceptable response cannot be provided.
schema:
$ref: '#/definitions/Error'
ConflictError: # 409
description: The request is not valid on this entity.
schema:
$ref: '#/definitions/Error'
UnsupportedMediaType: # 415
description: The media type of the request is not supported.
schema:
$ref: '#/definitions/Error'
TooManyRequestsError: # 429
description: Too many requests from this source.
schema:
$ref: '#/definitions/Error'
InternalServerError: # 500
description: There was an unexpected error.
schema:
$ref: '#/definitions/Error'
NotImplementedError: # 501
description: Functionality is not yet implemented.
schema:
$ref: '#/definitions/Error'
ValidationError: #400
description: Errors occurred while validating an entity.
schema:
$ref: '#/definitions/ValidationError'
MultipleValidationErrorsMap: # 400
description: Errors occurred while validating multiple entities.
schema:
description: Validation error.
type: object
properties:
code:
type: string
message:
type: string
errors:
type: object
properties:
$field:
$ref: '#/definitions/ValidationError'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment