openapi: 3.0.0
info:
title: Global Accounts API
description: >-
API used to manage Organizations and Accounts for multiple products. Also
responsible for authorization and authentication processes.
version: 2.0.0
servers:
- url: https://accounts.livechat.com/v2
description: Main production server URL
paths:
/accounts:
get:
summary: List accounts
description: >-
Accounts are listed by using `organization_id` obtained from the access
token. The `accounts.roles--all:ro` scope is required for listing
accounts along with their roles.
security:
- PersonalAccessToken: null
- OAuth2BearerToken:
- accounts--all:ro
- accounts.roles--all:ro
tags:
- Accounts
responses:
"200":
description: "OK: Returns the list of accounts."
content:
application/json:
schema:
type: array
items:
allOf:
- &ref_2
description: >-
An entity of the account, used across all LiveChat
products
type: object
required:
- email
properties:
account_id:
type: string
format: uuid
readOnly: true
description: Unique account identifier
example: 496a94f2-cbbf-444e-a3cb-305b9f5f8cbb
name:
type: string
description: Account name (nick; first, second name; or both)
example: John
exclusiveMaximum: false
maxLength: 191
email: &ref_18
type: string
format: email
description: Account's email address
example: john@example.com
exclusiveMaximum: false
maxLength: 128
email_verified:
type: boolean
readOnly: true
description: >-
Specifies if an email was verified. (The account
performed an email action or was validated by a
third-party identity provider.)
example: false
default_product: &ref_0
type: string
description: Product name
example: LiveChat
enum:
- LiveChat
- Accounts
- ChatBot
- HelpDesk
- OpenWidget
default_organization_id:
type: string
format: uuid
description: ID of default organization the account belongs to.
example: b2185556-634c-4ecf-b4c9-bcf8b65bc853
default: null
nullable: true
avatar_url:
type: string
description: >-
The "Account's avatar" field has been deprecated and
is no longer recommended for use; instead, the
avatar functionality has been relocated to the
account organization settings.
example: null
default: null
nullable: true
exclusiveMaximum: false
maxLength: 255
deprecated: true
roles:
type: array
items: &ref_3
description: >-
Role groups account scopes into one permission
entity.
type: object
properties:
role_id:
type: string
description: Unique role definition ID
example: 728b99be-848c-11ea-9b91-005056a007e9
product: *ref_0
role:
type: string
description: >-
Role name; one of predefined roles or a custom
name for a custom role.
example: administrator
enum:
- owner
- viceowner
- administrator
- normal
- member
type:
type: string
readOnly: true
description: >-
There are three role types: `primary` – an
obligatory Accounts role, `secondary` – a
basic product role, and `custom` – a
customly-defined role.
example: primary
predefined:
readOnly: true
type: boolean
description: >-
If `true`, the role is common across all
organizations. If `false`, the role is defined
per organization.
example: true
description: >-
Array of account roles; returned only when the
access token contains the `accounts.roles--all:ro`
scope.
updated_at:
readOnly: true
type: string
format: date-time
description: Date of the account's last update
example: 2019-09-03T10:53:04.000Z
created_at:
readOnly: true
type: string
format: date-time
description: Date of the account's creation
example: 2019-09-03T10:53:04.000Z
- type: object
properties:
properties:
type: object
allOf:
- &ref_7
type: object
description: >-
A nullable object that holds account properties
and statuses, with the properties being specific
to the organization and dependent on the
`organization_id` value obtained through
authorization.
properties:
active:
type: boolean
description: >-
Shows if an account already logged into the
organization.
example: true
mfa:
type: boolean
description: Shows if an account has MFA turned on.
example: true
productName:
type: object
description: Specific product properties.
properties:
suspended:
type: boolean
description: >-
Shows if an account is suspended in a
specific product.
example: true
avatar_url:
description: >-
Organization-specific avatar url. The same
value is returned from the account
organization settings.
type: string
format: url
nullable: true
example: >-
https://api.text.com/file/accounts/avatars/b2185556-634c-4ecf-b4c9-bcf8b65bc853/ae5bd37f-64b2-416b-bbb3-4623f53e6fb8/37a190dd-77a5-4fba-a7d3-2e89eab0e8fd.jpg
"401":
description: Unauthorized, missing, or invalid authorization.
content:
application/json:
schema: &ref_4
allOf:
- &ref_1
description: Default error object
type: object
properties:
error:
description: Error code
type: string
example: unauthorized
enum:
- bad_request
- invalid_request
- unauthorized_client
- unauthorized
- access_denied
- unsupported_response_type
- invalid_scope
- server_error
- temporarily_unavailable
- unsupported_grant_type
- invalid_grant
- invalid_client
- conflict
- resource_not_found
- join_link_expired
- traffic_blocked
- not_implemented
error_description:
type: string
example: The account is not authorized.
sub_error:
description: Error subcode
type: string
nullable: true
request_id:
description: Unique request identifier
type: string
format: uuid
example: 5903c51b-89f0-41a9-a25d-4f39af100353
- type: object
properties:
error:
type: string
example: unauthorized
error_description:
type: string
example: The account is not authorized.
"403":
description: "Forbidden: Insufficient scope."
content:
application/json:
schema: &ref_5
allOf:
- *ref_1
- type: object
properties:
error:
type: string
example: access_denied
sub_error:
type: string
example: insufficient_scope
error_description:
type: string
example: >-
The resource owner or authorization server denied the
request.
"500":
description: Server Error.
content:
application/json:
schema: &ref_6
allOf:
- *ref_1
- type: object
properties:
error:
type: string
example: server_error
error_description:
type: string
example: >-
The server encountered an unexpected condition that
prevented it from fulfilling the request.
post:
tags:
- Accounts
summary: Create a new account
description: >-
Create an account for a given `organization_id`. This endpoint is
idempotent. The `accounts.roles--all:rw` scope is required to create an
account with a role.
security:
- PersonalAccessToken: null
- OAuth2BearerToken:
- accounts--all:rw
- accounts--all:rc
- accounts.roles--all:rw
requestBody:
required: true
content:
application/json:
schema:
allOf:
- *ref_2
- type: object
properties:
email:
type: string
password: &ref_14
type: string
writeOnly: true
exclusiveMaximum: false
maxLength: 255
exclusiveMinimum: false
minLength: 8
example: BG0SaleEBL
description: Password for a given account
roles:
type: array
items:
description: >-
The list of role definitions, which will be set for
the account.
type: object
oneOf: &ref_12
- allOf:
- *ref_3
- type: object
properties:
role_id:
readOnly: true
required:
- role_id
- allOf:
- *ref_3
- type: object
properties:
product:
readOnly: true
role:
readOnly: true
required:
- product
- role
responses:
"200":
description: "OK: Returns the already existing account."
content:
application/json:
schema: *ref_2
"201":
description: "OK: Returns the created account."
content:
application/json:
schema: *ref_2
"400":
description: Bad Request
content:
application/json:
schema: &ref_10
allOf:
- *ref_1
- type: object
properties:
error:
type: string
example: bad_request
error_description:
type: string
example: >-
The server cannot or will not process the request due
to an apparent client error (for example, malformed
request syntax, size too large).
"401":
description: Unauthorized, missing, or invalid authorization.
content:
application/json:
schema: *ref_4
"403":
description: "Forbidden: Insufficient scope."
content:
application/json:
schema: *ref_5
"409":
description: >-
Conflict: The account already exists in a different organization.
This constraint is temporary.
content:
application/json:
schema: &ref_15
allOf:
- &ref_8
description: Returned on validation errors
allOf:
- *ref_1
- type: object
properties:
resource_name:
description: Name of resource related to the error
type: string
example: account
resource_id:
description: Identifier of resource related to the error
type: string
example: 5903c51b-89f0-41a9-a25d-4f39af100353
- type: object
properties:
error:
type: string
example: conflict
error_description:
type: string
example: >-
The request couldn't be processed because of conflict
in the current state of the resource.
"422":
description: "Validation error: Invalid email address, name too long, etc."
content:
application/json:
schema:
allOf:
- &ref_9
allOf:
- *ref_1
- type: object
properties:
error:
type: string
example: invalid_request
error_description:
type: string
example: >-
The request is missing a required parameter,
includes an invalid parameter value, includes a
parameter more than once, or is otherwise
malformed.
invalid_fields:
type: object
example: '{"name":"is required"}'
additionalProperties:
type: string
- type: object
properties:
invalid_fields:
type: object
properties:
email:
type: string
example: value too long
"500":
description: Server Error.
content:
application/json:
schema: *ref_6
/accounts/{account_id}:
get:
summary: Get an account
description: >-
Get an account for a given `account_id`. The ID can be replaced with
`me` to get the account that performs the request. To get an account
along with its role, you need the `accounts.roles--all:ro` scope.
security:
- PersonalAccessToken: null
- OAuth2BearerToken:
- accounts--my:ro
- accounts.roles--all:ro
tags:
- Accounts
parameters:
- in: path
name: account_id
schema:
type: string
format: uuid
required: true
description: Unique account ID or `me`.
responses:
"200":
description: "OK: Returns the account."
content:
application/json:
schema:
allOf:
- *ref_2
- type: object
properties:
properties:
type: object
allOf:
- *ref_7
"401":
description: Unauthorized, missing, or invalid authorization
content:
application/json:
schema: *ref_4
"403":
description: "Forbidden: Insufficient scope"
content:
application/json:
schema: *ref_5
"404":
description: "Not found: The account doesn't exist."
content:
application/json:
schema:
allOf:
- &ref_11
allOf:
- *ref_8
- type: object
properties:
error:
type: string
example: resource_not_found
error_description:
type: string
example: The requested resource couldn't be found.
- type: object
properties:
resource_name:
type: string
example: account
resource_id:
type: string
format: uuid
example: def31e95-5ca4-4817-b176-732e4544daca
"422":
description: "Validation error: Invalid uuid"
content:
application/json:
schema:
allOf:
- *ref_9
- type: object
properties:
invalid_fields:
type: object
properties:
account_id:
type: string
example: invalid uuid
"500":
description: Server Error.
content:
application/json:
schema: *ref_6
patch:
tags:
- Accounts
summary: Update an account
description: >-
Update an account for a given `account_id`. The ID can be replaced with
`me` to update the account that performs the request. To set a role for
an account, you need the `accounts.roles--all:rw` scope.
security:
- PersonalAccessToken: null
- OAuth2BearerToken:
- accounts--all:rw
- accounts.roles--all:rw
parameters:
- in: path
name: account_id
schema:
type: string
format: uuid
required: true
description: Unique account ID or `me`
requestBody:
required: true
content:
application/json:
schema:
allOf:
- *ref_2
- type: object
properties:
email:
readOnly: true
roles:
readOnly: true
responses:
"200":
description: "OK: Returns the updated account."
content:
application/json:
schema: *ref_2
"400":
description: Bad Request
content:
application/json:
schema: *ref_10
"401":
description: Unauthorized, missing, or invalid authorization.
content:
application/json:
schema: *ref_4
"403":
description: "Forbidden: Insufficient scope."
content:
application/json:
schema: *ref_5
"404":
description: "Not found: The account doesn't exist."
content:
application/json:
schema:
allOf:
- *ref_11
- type: object
properties:
resource_name:
type: string
example: account
resource_id:
type: string
format: uuid
example: def31e95-5ca4-4817-b176-732e4544daca
"422":
description: "Validation error: Invalid email address, name too long, etc."
content:
application/json:
schema:
allOf:
- *ref_9
- type: object
properties:
invalid_fields:
type: object
properties:
account_id:
type: string
example: value too long
"500":
description: Server Error.
content:
application/json:
schema: *ref_6
delete:
tags:
- Accounts
summary: Delete an account
description: >-
Deletes an account for a given `account_id`. The ID can be replaced with
`me` to delete the account that performs the request.
security:
- PersonalAccessToken: null
- OAuth2BearerToken:
- accounts--my:rw
parameters:
- in: path
name: account_id
schema:
type: string
format: uuid
required: true
description: Unique account ID or `me`.
responses:
"200":
description: "OK: Returns no content."
"401":
description: Unauthorized, missing, or invalid authorization
content:
application/json:
schema: *ref_4
"403":
description: "Forbidden: Insufficient scope."
content:
application/json:
schema: *ref_5
"404":
description: Not found
content:
application/json:
schema:
allOf:
- *ref_11
- type: object
properties:
resource_name:
type: string
example: account
resource_id:
type: string
format: uuid
example: def31e95-5ca4-4817-b176-732e4544daca
"422":
description: "Validation error: Invalid email address, name too long, etc."
content:
application/json:
schema:
allOf:
- *ref_9
- type: object
properties:
invalid_fields:
type: object
properties:
account_id:
type: string
example: value too long
"500":
description: Server Error.
content:
application/json:
schema: *ref_6
/accounts/{account_id}/roles:
put:
summary: Set account roles
description: >-
Set or delete roles for a given `account_id`. Set overwrites a role
group in case of conflicts.
security:
- PersonalAccessToken: null
- OAuth2BearerToken:
- accounts.roles--all:rw
tags:
- Accounts
parameters:
- in: path
name: account_id
schema:
type: string
format: uuid
required: true
description: Unique account ID or `me`.
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
set_roles:
type: array
items: &ref_13
type: object
oneOf: *ref_12
description: >-
The list of role definitions that will be set for the
account.
delete_roles:
type: array
items: *ref_13
description: >-
The list of role definitions that will be deleted from the
account.
responses:
"200":
description: "OK: Returns the updated account."
content:
application/json:
schema: *ref_2
"400":
description: Bad Request
content:
application/json:
schema: *ref_10
"401":
description: Unauthorized, missing, or invalid authorization.
content:
application/json:
schema: *ref_4
"403":
description: "Forbidden: Insufficient scope."
content:
application/json:
schema: *ref_5
"404":
description: "Not found: Account ID or role ID were not found."
content:
application/json:
schema:
allOf:
- *ref_11
- type: object
properties:
resource_name:
type: string
example: account
resource_id:
type: string
format: uuid
example: def31e95-5ca4-4817-b176-732e4544daca
"422":
description: "Validation error: Invalid uuid, etc."
content:
application/json:
schema:
allOf:
- *ref_9
- type: object
properties:
invalid_fields:
type: object
properties:
account_id:
type: string
example: value too long
"500":
description: Server Error.
content:
application/json:
schema: *ref_6
/accounts/{account_id}/password/reset:
post:
summary: Set a password
description: >-
This method sets a new password. A successful call revokes all session
tokens. It's possible to set a password for other accounts only when
they belong to a single organization.
security:
- PersonalAccessToken: null
- OAuth2BearerToken:
- accounts.password--my:rw
tags:
- Accounts
parameters:
- in: path
name: account_id
schema:
type: string
format: uuid
required: true
description: Unique account ID or `me`.
requestBody:
content:
application/json:
schema:
type: object
properties:
password: *ref_14
required:
- password
responses:
"200":
description: "OK: Returns an empty object."
content:
application/json:
schema: *ref_2
"400":
description: Bad Request
content:
application/json:
schema: *ref_10
"401":
description: Unauthorized, missing, or invalid authorization.
content:
application/json:
schema: *ref_4
"403":
description: "Forbidden: Insufficient scope."
content:
application/json:
schema: *ref_5
"404":
description: "Not found: The account ID was not found."
content:
application/json:
schema:
allOf:
- *ref_11
- type: object
properties:
resource_name:
type: string
example: account
resource_id:
type: string
format: uuid
example: def31e95-5ca4-4817-b176-732e4544daca
"409":
description: "Conflict: The account is assigned to more than one organization."
content:
application/json:
schema:
allOf:
- *ref_15
- type: object
properties:
resource_name:
type: string
example: account
resource_id:
type: string
format: uuid
example: def31e95-5ca4-4817-b176-732e4544daca
"422":
description: "Validation error: Invalid uuid, etc."
content:
application/json:
schema:
allOf:
- *ref_9
- type: object
properties:
invalid_fields:
type: object
properties:
account_id:
type: string
example: value too long
"500":
description: Server Error.
content:
application/json:
schema: *ref_6
/accounts/invitations:
get:
summary: Get an account invitations
description: >-
This method gets all invitations issued within an organization. If the
`email` parameter is provided, it returns only the invitations sent for
the account assigned with the `email` (within the requester's
organization).
security:
- PersonalAccessToken: null
- OAuth2BearerToken:
- accounts.invitations--all:ro
tags:
- Accounts
parameters:
- in: path
name: email
schema:
type: string
format: email
description: Email address of the invited account.
responses:
"200":
description: "OK: Returns a list of account invitations."
content:
application/json:
schema:
type: array
items:
description: An entity of the account invitation.
type: object
required:
- email
properties:
invitation_id:
type: string
format: uuid
readOnly: true
description: Unique account invitation identifier.
example: 496a94f2-cbbf-444e-a3cb-305b9f5f8cbb
name:
type: string
description: >-
Invited account's name (nick; first, second name; or
both). If the invitation was issued to an existing
account, this parameter will be replaced with the
existing name.
example: John
exclusiveMaximum: false
maxLength: 191
email:
type: string
format: email
description: Invited account's email address.
example: john@example.com
exclusiveMaximum: false
maxLength: 128
product:
type: string
readOnly: true
description: Specifies to which product the account is invited.
example: false
creator_id:
type: string
format: uuid
readOnly: true
description: Unique account identifier which created an invitation.
example: 496a94f2-cbbf-444e-a3cb-305b9f5f8cbb
organization_id:
type: string
format: uuid
description: ID of the organization to which the account is invited.
example: b2185556-634c-4ecf-b4c9-bcf8b65bc853
default: null
nullable: true
updated_at:
readOnly: true
type: string
format: date-time
description: Date of the account's invitation's last update.
example: 2019-09-03T10:53:04.000Z
created_at:
readOnly: true
type: string
format: date-time
description: Date of the account's invitation's creation.
example: 2019-09-03T10:53:04.000Z
"401":
description: Unauthorized, missing, or invalid authorization.
content:
application/json:
schema: *ref_4
"422":
description: "Validation error: Invalid email, etc."
content:
application/json:
schema:
allOf:
- *ref_9
- type: object
properties:
invalid_fields:
type: object
properties:
email:
type: string
example: invalid email address
"500":
description: Server Error.
content:
application/json:
schema: *ref_6
post:
summary: Create an account invitation
description: >-
Create an account invitation for the given `email`, `organization_id`,
and `product`. After the successful creation, it sends an email to all
users with the invitation approval scopes, informing them about the new
account awaiting the approval. `organization_id` and `creator_id` are
retrieved from the access token.
security:
- PersonalAccessToken: null
- OAuth2BearerToken:
- accounts.invitations--my:rw
tags:
- Accounts
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- email
properties:
email:
type: string
description: Email address of the invited account.
example: john@example.com
name:
type: string
description: >-
Name of the invited account (nick; first, second name; or
both). If an invitation was issued to an existing account,
this field will be replaced with the name assigned to that
account.
example: John
product:
type: string
description: The product to which an account is invited.
example: LiveChat
responses:
"200":
description: "OK: Returns an existing account's invitation ID."
content:
application/json:
schema:
type: object
properties:
invitation_id:
type: string
format: uuid
description: Unique account invitation identifier.
example: 496a94f2-cbbf-444e-a3cb-305b9f5f8cbb
"201":
description: "Created: Account invitation was created."
content:
application/json:
schema:
type: object
properties:
invitation_id:
type: string
format: uuid
description: Unique account invitation identifier.
example: 496a94f2-cbbf-444e-a3cb-305b9f5f8cbb
"400":
description: >-
Bad Request: Invalid request; the invitation name for the new
account is empty.
content:
application/json:
schema: *ref_10
"401":
description: Unauthorized, missing, or invalid authorization.
content:
application/json:
schema: *ref_4
"409":
description: "Conflict: Account already added to the product."
content:
application/json:
schema: *ref_15
"422":
description: "Validation error: Invalid email, etc."
content:
application/json:
schema:
allOf:
- *ref_9
- type: object
properties:
invalid_fields:
type: object
properties:
email:
type: string
example: invalid email address
"500":
description: Server Error.
content:
application/json:
schema: *ref_6
/accounts/invitations/{invitation_id}:
put:
summary: Approve an account invitation
description: Approve an account invitation.
security:
- PersonalAccessToken: null
- OAuth2BearerToken:
- >-
accounts.invitations--all:rw (allows to approve invitations for
all products)
- accounts.invitations.lc--all:rw (for LC invitations)
- accounts.invitations.hd--all:rw (for HD invitations)
tags:
- Accounts
parameters:
- in: path
name: invitation_id
schema:
type: string
format: uuid
required: true
description: Unique account invitation ID.
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
role:
type: string
description: The approved account's role in a given product.
example: administrator
responses:
"200":
description: "OK: Returns the account ID."
content:
application/json:
schema:
type: object
properties:
account_id:
type: string
format: uuid
description: Unique account identifier
example: 496a94f2-cbbf-444e-a3cb-305b9f5f8cbb
"400":
description: >-
Bad Request: Invalid request; the invitation name for the new
account is empty.
content:
application/json:
schema: *ref_10
"401":
description: Unauthorized, missing, or invalid authorization.
content:
application/json:
schema: *ref_4
"403":
description: >-
Forbidden: Invalid organization; the scope is invalid, unknown, or
malformed.
content:
application/json:
schema: *ref_5
"404":
description: Requested resource (account invitation) could not be found.
content:
application/json:
schema: *ref_11
"409":
description: >-
Conflict: Account is already added to the product; invalid product
subscription.
content:
application/json:
schema: *ref_15
"422":
description: "Validation error: Invalid email, etc."
content:
application/json:
schema:
allOf:
- *ref_9
- type: object
properties:
invalid_fields:
type: object
properties:
email:
type: string
example: invalid email address
"500":
description: Server Error.
content:
application/json:
schema: *ref_6
delete:
summary: Decline an account invitation
description: Decline and delete an account invitation.
security:
- PersonalAccessToken: null
- OAuth2BearerToken:
- >-
accounts.invitations--all:rw (allows to decline invitations for
all products)
- accounts.invitations.lc--all:rw (for LC invitations)
- accounts.invitations.hd--all:rw (for HD invitations)
tags:
- Accounts
parameters:
- in: path
name: invitation_id
schema:
type: string
format: uuid
required: true
description: Unique account invitation ID
responses:
"204":
description: "No Content: Account invitation was deleted."
"401":
description: Unauthorized, missing, or invalid authorization.
content:
application/json:
schema: *ref_4
"403":
description: >-
Forbidden: Invalid organization; the scope is invalid, unknown, or
malformed.
content:
application/json:
schema: *ref_5
"404":
description: Requested resource (account invitation) could not be found.
content:
application/json:
schema: *ref_11
"500":
description: Server Error.
content:
application/json:
schema: *ref_6
/roles:
get:
summary: List roles
description: >-
List the roles available for an organization. The result combines
predefined and user-defined roles.
security:
- PersonalAccessToken: null
- OAuth2BearerToken:
- accounts.roles--all:ro
tags:
- Roles
responses:
"200":
description: "OK: Returns the list of roles."
content:
application/json:
schema:
type: array
items: *ref_3
"401":
description: Unauthorized, missing, or invalid authorization
content:
application/json:
schema: *ref_4
"403":
description: "Forbidden: Insufficient scope"
content:
application/json:
schema: *ref_5
"500":
description: Server Error.
content:
application/json:
schema: *ref_6
/roles/{role_id}:
get:
summary: Get a role
description: >-
Get a single role for a given `role_id`. The role is returned with the
scopes assigned to it.
security:
- PersonalAccessToken: null
- OAuth2BearerToken:
- accounts.roles--all:ro
tags:
- Roles
parameters:
- in: path
name: role_id
schema:
type: string
format: uuid
required: true
description: Unique role ID
responses:
"200":
description: "OK: Returns the role."
content:
application/json:
schema:
allOf:
- *ref_3
- type: object
properties:
scope:
type: string
description: >-
Scopes assigned to the role, separated by a comma
(`,`)
example: accounts--all:rw,accounts.roles--all:ro
"401":
description: Unauthorized, missing, or invalid authorization
content:
application/json:
schema: *ref_4
"403":
description: "Forbidden: Insufficient scope"
content:
application/json:
schema: *ref_5
"404":
description: "Not found: The role doesn't exist."
content:
application/json:
schema:
allOf:
- *ref_11
- type: object
properties:
resource_name:
type: string
example: role
resource_id:
type: string
format: uuid
example: 97f365b7-5e7d-4e6d-bf48-ef7bb96580a4
"422":
description: "Validation error: Invalid uuid"
content:
application/json:
schema:
allOf:
- *ref_9
- type: object
properties:
invalid_fields:
type: object
properties:
role_id:
type: string
example: invalid uuid
"500":
description: Server Error.
content:
application/json:
schema: *ref_6
delete:
summary: Delete a role
description: >-
Delete a single role for a given `role_id`. Only the `custom` role can
be deleted. All tokens related to a given role will be revoked.
security:
- PersonalAccessToken: null
- OAuth2BearerToken:
- accounts.roles--all:rw
tags:
- Roles
parameters:
- in: path
name: role_id
schema:
type: string
required: true
description: Unique role ID
responses:
"200":
description: "OK: Returns no content."
"401":
description: Unauthorized, missing or invalid authorization
content:
application/json:
schema: *ref_4
"403":
description: "Forbidden: Insufficient scope"
content:
application/json:
schema: *ref_5
"404":
description: "Not found: The role doesn't exist."
content:
application/json:
schema:
allOf:
- *ref_11
- type: object
properties:
resource_name:
type: string
example: role
resource_id:
type: string
format: uuid
example: 97f365b7-5e7d-4e6d-bf48-ef7bb96580a4
"422":
description: "Validation error: Invalid uuid"
content:
application/json:
schema:
allOf:
- *ref_9
- type: object
properties:
invalid_fields:
type: object
properties:
role_id:
type: string
example: invalid uuid
"500":
description: Server Error.
content:
application/json:
schema: *ref_6
/sessions:
get:
summary: List sessions
description: >-
Returns all sessions for a given account ID. The account ID is obtained
from an authorization grant.
security:
- OAuth2BearerToken:
- sessions--my:ro
tags:
- Sessions
responses:
"200":
description: "OK: Returns the list of sessions."
content:
application/json:
schema:
type: array
items:
description: Scope describe user single permission
type: object
properties:
account_id:
type: string
format: uuid
description: Unique account identifier
example: 28df1a50-84fa-490c-9615-5b77d507c393
readOnly: true
session_id: &ref_16
type: string
format: uuid
description: Unique session identifier
example: bfeeb033-bc8e-467f-982d-22dcef274fa1
readOnly: true
current:
type: boolean
description: >-
Returns `true` if the access token that was used to
request the data belongs to the current session.
example: true
readOnly: true
user_agent:
type: string
description: >-
Name of the user agent (device) on which the session was
established.
example: >-
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:69.0)
Gecko/20100101 Firefox/69.0
readOnly: true
identity_source:
type: string
description: Type of identity source
enum:
- credentials
- explicit
- google
- token
- microsoft
- apple
example: credentials
readOnly: true
ip:
type: string
description: >-
IP address of the computer on which the session was
established.
example: 194.181.146.158
readOnly: true
applications:
type: array
items:
description: Basic information about application
properties:
name:
type: string
readOnly: true
example: LiveChat Application
client_id:
type: string
readOnly: true
example: 238ac4c3c3628880aca289c6d700d2c5
session_id: *ref_16
"401":
description: Unauthorized, missing or invalid authorization
content:
application/json:
schema: *ref_4
"403":
description: "Forbidden: Insufficient scope"
content:
application/json:
schema: *ref_5
"500":
description: Server Error.
content:
application/json:
schema: *ref_6
delete:
summary: Remove all sessions
description: >-
Removes all sessions for a given account ID. The account ID is obtained
from an authorization grant. It's impossible to remove a session for
other accounts. All access tokens related to the sessions will be
revoked.
security:
- OAuth2BearerToken:
- accounts--all:ro
- accounts.roles--all:ro
tags:
- Sessions
responses:
"200":
description: "OK: Returns no content."
"401":
description: Unauthorized, missing or invalid authorization
content:
application/json:
schema: *ref_4
"403":
description: "Forbidden: Insufficient scope"
content:
application/json:
schema: *ref_5
"500":
description: Server Error.
content:
application/json:
schema: *ref_6
/sessions/{session_id}:
delete:
summary: Remove a session
description: >-
Removes a specific session for a given account ID. The account ID is
obtained from an authorization grant. It's impossible to remove a
session for other accounts. All access tokens related to the sessions
will be revoked.
security:
- OAuth2BearerToken:
- sessions--my:rw
tags:
- Sessions
parameters:
- in: path
name: session_id
schema:
type: string
format: uuid
required: true
description: Unique session ID
responses:
"200":
description: "OK: Returns no content."
"401":
description: Unauthorized, missing or invalid authorization
content:
application/json:
schema: *ref_4
"403":
description: "Forbidden: Insufficient scope"
content:
application/json:
schema: *ref_5
"404":
description: "Not found: The session doesn't exist"
content:
application/json:
schema:
allOf:
- *ref_11
- type: object
properties:
resource_name:
type: string
example: session
resource_id:
type: string
format: uuid
example: b68698d6-fdac-4fb5-9ac1-017cf13ca221
"500":
description: Server Error.
content:
application/json:
schema: *ref_6
/organizations:
get:
tags:
- Organizations
summary: List organizations
description: >
Lists all organizations that an account belongs to, based on
authorization. This request doesn't need any specific scope.
security:
- PersonalAccessToken: null
- OAuth2BearerToken: null
responses:
"200":
description: "OK: Returns organizations."
content:
application/json:
schema:
type: array
items: &ref_19
description: >-
Organization groups accounts into a single unit. Each
organization must contain at least one account and one
owner. An account can be assigned to many organizations at
once. The default organization is the first assigned to a
given account.
type: object
properties:
organization_id: &ref_26
type: string
format: uuid
default: my
readOnly: true
description: Unique organization identifier
example: 59aa5076-13c5-4ce5-b13a-07d33e838acf
name:
type: string
description: Organization name
example: Organization Name
exclusiveMaximum: false
maxLength: 127
invitation_mode:
type: string
description: >-
Invitation mode setting of organization. If lax all paid
roles can invite to products. Strict cause that only
privileged roles can invite.
example: lax
enum:
- lax
- strict
default: lax
domain_whitelist:
type: boolean
description: If true, email address domain whitelisting is enabled.
example: true
default: false
products:
type: array
description: List of installed products in the organization.
readOnly: true
items:
type: object
properties:
product: *ref_0
created_at: &ref_17
readOnly: true
type: string
format: date-time
description: Creation date of the resource.
example: 2019-09-03T10:53:04.000Z
updated_at:
readOnly: true
type: string
format: date-time
description: Date of the most recent modification to the resource.
example: 2019-09-03T10:53:04.000Z
created_at: *ref_17
"401":
description: Unauthorized, missing, or invalid authorization
content:
application/json:
schema: *ref_4
"500":
description: Server Error.
content:
application/json:
schema: *ref_6
post:
tags:
- Organizations
summary: Create an organization
description: >-
Creates an organization and an account. Calling this endpoint won't
result in email notifications. Alternatively, you can use Bearer/Basic
authorization instead of creating a new account for an organization; it
will create a new organization for the account associated with the
token.
requestBody:
required: true
content:
application/json:
schema:
properties:
email: *ref_18
password: *ref_14
organization: &ref_20
allOf:
- *ref_19
- type: object
properties:
company:
description: Basic company information
type: object
properties:
phone:
type: string
description: Company phone number
example: +48 123 456 789
exclusiveMaximum: false
maxLength: 20
website:
type: string
description: Primary company website
example: example.com
exclusiveMaximum: false
maxLength: 255
name:
type: string
description: Company name
example: Example Company
exclusiveMaximum: false
maxLength: 255
industry:
type: string
description: Company industry
example: Software
exclusiveMaximum: false
maxLength: 255
company_size:
type: string
description: Company size
example: 1-10
exclusiveMaximum: false
maxLength: 255
audience:
type: array
description: Company audience
example:
- B2B
- B2C
items:
type: string
enum:
- B2B
- B2C
- Internal use
uniqueItems: true
street:
type: string
description: Company street address
example: 123 Example Street
exclusiveMaximum: false
maxLength: 255
city:
type: string
description: Company city
example: New York
exclusiveMaximum: false
maxLength: 255
state:
type: string
description: Company state
example: Example State
exclusiveMaximum: false
maxLength: 255
zipcode:
type: string
description: Company zipcode
example: 00-000
exclusiveMaximum: false
maxLength: 20
country:
type: string
description: Company country
example: Poland
exclusiveMaximum: false
maxLength: 255
logo:
type: string
description: Company logo URL
example: https://example.com/logo.png
exclusiveMaximum: false
maxLength: 65535
tagline:
type: string
description: Company tagline
example: Example tagline
exclusiveMaximum: false
maxLength: 65535
twitter:
type: string
description: Company Twitter profile
maxLength: 255
exclusiveMaximum: false
instagram:
type: string
description: Company Instagram profile
maxLength: 255
exclusiveMaximum: false
linkedin:
type: string
description: Company Linkedin profile
maxLength: 255
exclusiveMaximum: false
facebook:
type: string
description: Company Facebook profile
maxLength: 255
exclusiveMaximum: false
required:
- email
responses:
"200":
description: "OK: Returns the account and the organization."
content:
application/json:
schema:
allOf:
- *ref_2
- type: object
properties:
organization: *ref_20
access_token:
type: string
example: dal:eDqDuTRZoK03C3rzD2dcfA==
"400":
description: Bad Request
content:
application/json:
schema: *ref_10
"409":
description: "Conflict: The account already exists."
content:
application/json:
schema: *ref_15
"422":
description: "Validation error: Invalid email address, name too long, etc."
content:
application/json:
schema:
allOf:
- *ref_9
- type: object
properties:
invalid_fields:
type: object
properties:
email:
type: string
example: invalid email format
"500":
description: Server Error.
content:
application/json:
schema: *ref_6
/organizations/{organization_id}:
get:
summary: Get an organization
description: >
This function retrieves a single organization based on the provided
organization ID. You can use `my` instead of an ID to get the
organization linked with the access token used in the request.
security:
- PersonalAccessToken: null
- OAuth2BearerToken: null
tags:
- Organizations
parameters:
- in: path
name: organization_id
schema:
type: string
format: uuid
required: true
description: Unique organization ID or `my`
responses:
"200":
description: "OK: Returns the organization."
content:
application/json:
schema: *ref_20
"401":
description: Unauthorized, missing, or invalid authorization.
content:
application/json:
schema: *ref_4
"404":
description: "Not found: The organization doesn't exist."
content:
application/json:
schema:
allOf:
- *ref_11
- type: object
properties:
resource_name:
type: string
example: organization
resource_id:
type: string
format: uuid
example: def31e95-5ca4-4817-b176-732e4544daca
"500":
description: Server Error.
content:
application/json:
schema: *ref_6
patch:
tags:
- Organizations
summary: Update an organization
description: >-
Updates an organization. You can use `my` instead of an ID to get the
organization linked with the access token used in the request.
security:
- PersonalAccessToken:
- organization--my:rw
- OAuth2BearerToken:
- organization--my:rw
parameters:
- in: path
name: organization_id
schema:
type: string
format: uuid
required: true
description: Unique account ID or `my`
requestBody:
required: true
content:
application/json:
schema: *ref_20
responses:
"200":
description: "OK: Returns the updated organization."
content:
application/json:
schema: *ref_20
"401":
description: Unauthorized, missing, or invalid authorization
content:
application/json:
schema: *ref_4
"403":
description: "Forbidden: Insufficient scope"
content:
application/json:
schema: *ref_5
"404":
description: "Not found: The organization doesn't exist."
content:
application/json:
schema:
allOf:
- *ref_11
- type: object
properties:
resource_name:
type: string
example: organization
resource_id:
type: string
format: uuid
example: def31e95-5ca4-4817-b176-732e4544daca
"422":
description: "Validation error: Name too long, etc."
content:
application/json:
schema:
allOf:
- *ref_9
- type: object
properties:
invalid_fields:
type: object
properties:
name:
type: string
example: value too long
"500":
description: Server Error.
content:
application/json:
schema: *ref_6
/info:
get:
summary: Introspect
description: >-
Returns detailed information about the provided OAuth access token.
Useful for token validation and introspection. The access token can be
provided via authorization or a query string.
parameters:
- &ref_24
in: query
name: code
description: Token string
required: false
schema:
type: string
example: fra-a:vky95357S7KM1E4dXwv1DQ
- in: header
name: Authorization
schema:
type: string
example: Bearer fra-a:vky95357S7KM1E4dXwv1DQ
tags:
- Tokens
responses:
"200":
description: "OK: Returns token details."
content:
application/json:
schema: &ref_23
description: >-
Represents an OAuth 2 token with details about its scope,
validity, and associated account.
type: object
properties:
access_token:
type: string
description: >-
The actual token string that is used for authorization in
API requests.
example: fra-a:vky95357S7KM1E4dXwv1DQ
account_id:
type: string
format: uuid
description: >-
The unique identifier of the account for which the token
has been issued.
example: 28df1a50-84fa-490c-9615-5b77d507c393
client_id:
type: string
description: >-
The unique identifier of the OAuth client for which the
token has been issued.
example: d4c4377b0e8fa82d5d737facd9475efa
expires_in:
type: integer
format: uint64
description: Duration (in seconds) after which the token will expire.
example: 432000
organization_id:
type: string
format: uuid
description: >-
The unique identifier of the organization for which the
token has been issued.
example: 59aa5076-13c5-4ce5-b13a-07d33e838acf
refresh_token:
type: string
description: >-
An optional token that can be used to obtain a new access
token once the current one expires. Not available for
tokens minted with implicit grant flow.
example: test0SEkeLZ2Qy2Nm2cg42xIyg
nullable: true
scope:
type: string
description: >-
List of permissions granted to the token, separated by
commas.
example: accounts--all:rc,accounts--all:ro
token_type:
type: string
description: The type of the access token.
example: Bearer
"422":
description: Invalid request
content:
application/json:
schema: *ref_9
"500":
description: Server Error.
content:
application/json:
schema: *ref_6
/token:
post:
summary: Token
description: >
This endpoint is used by confidential and public clients to exchange an
authorization code for an access token.
Depending on the application type, the following parameters are required
for `grant_type=code`:
* Confidental (private) client – `client_secret` is required
* Public client – matching `code_verifier` is required for
`code_challenge` sent during the authentication request.
Refresh tokens issued for public clients are single-use only – a new
refresh token is issued upon successful authorization.
tags:
- Tokens
requestBody:
required: false
content:
application/json:
schema:
oneOf:
- title: Code Exchange
allOf:
- description: >-
The set of parameters required for the exchange of the
code to an access token.
type: object
required:
- client_id
- grant_type
- redirect_uri
- code
properties:
client_id: &ref_21
description: >-
The unique ID of the OAuth client that makes the
authorization request.
type: string
example: be4ac276b81af255624473a222e1155c
grant_type:
description: The selected authorization grant type.
enum:
- code
type: string
redirect_uri:
description: >-
The application's `redirect_uri` for which the grant
was requested.
type: string
example: https://my-app.com/callback
code:
description: The authorization code.
type: string
example: fra-a:apk420S7KM1E4dXwv1DH
client_secret: &ref_22
description: >-
The secret associated with the OAuth client that
makes the request.
type: string
example: dsbuHDHA212jcbubds-)($nb5334@dsad
code_verifier:
description: >-
The authorization code verifier used to verify if
the requester is a legitimate authorization code
recipient.
type: string
example: >-
zo6yP8H9te4I0lk2Uclcry47yPbTT9jRbdnIZPdMUfazH5iD8vkNw
- title: Refresh Token Exchange
allOf:
- description: >-
The set of parameters required for the exchange of a
refresh token to an access token.
type: object
required:
- refresh_token
- client_id
- client_secret
- grant_type
properties:
refresh_token:
description: Refresh token
type: string
example: testapk420S7KM1E4dXwv1DH
client_id: *ref_21
client_secret: *ref_22
grant_type:
description: The selected authorization grant type.
enum:
- refresh_token
type: string
responses:
"200":
description: OK, returns a new token
content:
application/json:
schema: *ref_23
"401":
description: >-
Client isn't authorized to request a token using this method or the
provided parameters are invalid.
content:
application/json:
schema: *ref_4
"403":
description: >-
Request not authorized. Resource owner could unauthorize request;
wrong or unsupported `grant_type` provided; wrong `scope` provided.
content:
application/json:
schema: *ref_5
"422":
description: Invalid request, missing required parameters
content:
application/json:
schema: *ref_9
"429":
description: >-
Temporarily unavailable. The server cannot currently handle the
request.
content:
application/json:
schema:
allOf:
- *ref_1
- type: object
properties:
error:
type: string
example: temporarily_unavailable
error_description:
type: string
example: >-
The server is currently unable to handle the request
due to a temporary overloading or maintenance of the
server.
"500":
description: Server Error
content:
application/json:
schema: *ref_6
delete:
summary: Revoke
description: >-
Access tokens that come in pairs with a refresh token are revoked in
pairs.
security:
- oAuth2 Bearer Token: null
parameters:
- *ref_24
tags:
- Tokens
responses:
"200":
description: OK, tokens are revoked, returns no content.
"404":
description: Not found, the token doesn't exist.
content:
application/json:
schema: *ref_11
"500":
description: Server Error
content:
application/json:
schema: *ref_6
/accounts/{account_id}/organization_settings/{organization_id}:
get:
summary: Get account settings for an organization
description: >
This HTTP endpoint allows you to retrieve a list of account organization
settings.
These settings are tailored to each organization, providing customized
configurations for their accounts.
For global settings, you can use the `/accounts` endpoint.
The `account_id` parameter is interchangeable with `me`, the
`organization_id` parameter is interchangeable with `my`. The values
will be sourced from authorization in such cases.
security:
- PersonalAccessToken: null
- OAuth2BearerToken:
- accounts--my:ro
- accounts--all:ro
tags:
- AccountOrganizationSettings
parameters:
- name: account_id
in: path
required: true
schema:
type: string
format: uuid4
default: me
- name: organization_id
in: path
required: true
schema:
type: string
format: uuid4
default: my
responses:
"200":
description: Object with account properties specific for a given organization
content:
application/json:
schema: &ref_25
type: object
properties:
avatar_url:
type: string
format: url
nullable: true
example: >-
https://api.text.com/file/accounts/avatars/b2185556-634c-4ecf-b4c9-bcf8b65bc853/ae5bd37f-64b2-416b-bbb3-4623f53e6fb8/37a190dd-77a5-4fba-a7d3-2e89eab0e8fd.jpg
"401":
description: Unauthorized, missing, or invalid authorization.
content:
application/json:
schema: *ref_4
"403":
description: "Forbidden: Insufficient scope."
content:
application/json:
schema: *ref_5
"404":
description: Resource not found.
content:
application/json:
schema: *ref_11
"422":
description: Validation error.
content:
application/json:
schema: *ref_9
"500":
description: Server Error.
content:
application/json:
schema: *ref_6
patch:
summary: Update account settings for an organization
security:
- PersonalAccessToken: null
- OAuth2BearerToken:
- accounts--my:rw
- accounts--all:rw
description: >
This HTTP endpoint allows you to update various organization settings of
an account.
Limitations:
* You cannot provide both an avatar image and an avatar URL simultaneously.
* If the provided avatar is not a square, it will be automatically cropped to fit into a square shape.
* The avatar's size should be within the range of 50x50 pixels (minimum) to 1024x1024 pixels (maximum).
* The supported formats for avatars are PNG and JPEG, with a maximum file size of 1MB.
The `account_id` parameter is interchangeable with `me`, the
`organization_id` parameter is interchangeable with `my`. The values
will be sourced from the authorization in such cases.
tags:
- AccountOrganizationSettings
parameters:
- name: account_id
in: path
required: true
schema:
type: string
format: uuid4
default: me
- name: organization_id
in: path
required: true
schema:
type: string
format: uuid4
default: my
requestBody:
content:
application/json:
schema: *ref_25
application/x-www-form-urlencoded:
example:
avatar_url: >-
https://api.text.com/file/accounts/avatars/b2185556-634c-4ecf-b4c9-bcf8b65bc853/ae5bd37f-64b2-416b-bbb3-4623f53e6fb8/37a190dd-77a5-4fba-a7d3-2e89eab0e8fd.jpg
schema: *ref_25
multipart/form-data:
schema:
type: object
properties:
avatar:
type: string
format: binary
responses:
"200":
description: Object with account properties specific for a given organization.
content:
application/json:
schema: *ref_25
"401":
description: Unauthorized, missing, or invalid authorization.
content:
application/json:
schema: *ref_4
"403":
description: "Forbidden: Insufficient scope."
content:
application/json:
schema: *ref_5
"404":
description: Resource not found.
content:
application/json:
schema: *ref_11
"422":
description: Validation error.
content:
application/json:
schema: *ref_9
"500":
description: Server Error.
content:
application/json:
schema: *ref_6
/organizations/{organization_id}/domains:
get:
tags:
- OrganizationDomains
summary: List organization domains
description: >-
Lists all organization domains. The list is used for whitelisting email
address domains, that are free to join to given organization.
security:
- PersonalAccessToken: null
- OAuth2BearerToken: null
parameters:
- in: path
name: organization_id
schema: *ref_26
required: true
description: Unique organization ID
responses:
"200":
description: "OK: Returns a list of organization domains."
content:
application/json:
schema:
type: array
items: &ref_29
description: Organization domain.
type: object
properties:
organization_id: *ref_26
domain_id: &ref_30
type: string
format: uuid
readOnly: true
description: Unique domain identifier
example: 59aa5076-13c5-4ce5-b13a-07d33e838acf
domain: &ref_27
type: string
description: Domain name
example: example.com
type:
readOnly: true
type: string
description: >-
Type of the domain assigned to the organization. Only
one type is available - `open`. Open domains are email
domains that are able to join a given organization
without additional confirmation.
example: open
created_at:
readOnly: true
type: string
format: date-time
description: Date of the creation of organization domain
example: 2019-09-03T10:53:04.000Z
"401":
description: Unauthorized, missing, or invalid authorization
content:
application/json:
schema: *ref_4
"404":
description: Resource not found.
content:
application/json:
schema: *ref_11
"422":
description: "Validation error: Invalid uuid, etc."
content:
application/json:
schema:
allOf:
- *ref_9
- type: object
properties:
invalid_fields:
type: object
properties:
domain:
type: string
example: Disposable domain.
"500":
description: Server Error.
content:
application/json:
schema: *ref_6
post:
tags:
- OrganizationDomains
summary: Create organization domain
description: >-
This endpoint adds a new domain to the organization's email address
domains whitelist. It's forbidden to add domains used for disposable
email addresses or used by free email providers. Maximum number of
domains added to an organization is 10.
security:
- PersonalAccessToken: null
- OAuth2BearerToken: null
parameters:
- in: path
name: organization_id
schema: *ref_26
required: true
description: Unique organization ID
requestBody:
content:
application/json:
schema: &ref_28
description: Create organization domain parameters
type: object
properties:
domain: *ref_27
required:
- domain
application/x-www-form-urlencoded:
example:
avatar_url: example.com
schema: *ref_28
responses:
"201":
description: "Created: Returns created organization domain."
content:
application/json:
schema: *ref_29
"401":
description: Unauthorized, missing, or invalid authorization
content:
application/json:
schema: *ref_4
"404":
description: Resource not found.
content:
application/json:
schema: *ref_11
"409":
description: "Conflict: The domain already exists."
content:
application/json:
schema: *ref_15
"422":
description: "Validation error: Invalid uuid, etc."
content:
application/json:
schema:
allOf:
- *ref_9
- type: object
properties:
invalid_fields:
type: object
properties:
domain:
type: string
example: Disposable domain.
"500":
description: Server Error.
content:
application/json:
schema: *ref_6
/organizations/{organization_id}/domains/{domain_id}:
delete:
tags:
- OrganizationDomains
summary: Delete organization domain
description: Delete organization domain by its id
security:
- PersonalAccessToken: null
- OAuth2BearerToken: null
parameters:
- in: path
name: organization_id
schema: *ref_26
required: true
description: Unique organization ID
- in: path
name: domain_id
schema: *ref_30
required: true
description: Unique domain id
responses:
"210":
description: "Gone: The domain has been deleted."
"401":
description: Unauthorized, missing, or invalid authorization
content:
application/json:
schema: *ref_4
"404":
description: Resource not found.
content:
application/json:
schema: *ref_11
"422":
description: "Validation error: Invalid uuid, etc."
content:
application/json:
schema:
allOf:
- *ref_9
- type: object
properties:
invalid_fields:
type: object
properties:
domain:
type: string
example: Disposable domain.
"500":
description: Server Error.
content:
application/json:
schema: *ref_6
/organizations/my/saml:
get:
tags:
- SAML
summary: Get configuration
description: Returns SAML configuration for organization
parameters:
- in: header
name: Authorization
schema:
type: string
example: Bearer fra-a:vky95357S7KM1E4dXwv1DQ
responses:
"200":
description: "OK: Returns organization SAML configuration."
content:
application/json:
schema: &ref_36
description: Organization's SAML configuration
type: object
properties:
entrypoint: &ref_31
type: string
description: >-
Entrypoint URL of identity provider; SSO redirect there
AuthnRequest
example: >-
https://dev-00000.example.com/app/dev-00000_appname_1/abcdefeascdaserdsawe/sso/saml
certificate: &ref_32
type: string
description: SAML certificate configured on IDP side in PEM format
example: >-
-----BEGIN CERTIFICATE-----
MIIC9TCCAl6gAwIBAgIJANL8E4epRNznMA0GCSqGSIb3DQEBBQUAMFsxGDAWBgNV
BAoTD1N1cGVyZmlzaCwgSW5jLjELMAkGA1UEBxMCU0YxCzAJBgNVBAgTAkNBMQsw
CQYDVQQGEwJVUzEYMBYGA1UEAxMPU3VwZXJmaXNoLCBJbmMuMB4XDTE0MDUxMjE2
MjUyNloXDTM0MDUwNzE2MjUyNlowWzEYMBYGA1UEChMPU3VwZXJmaXNoLCBJbmMu
MQswCQYDVQQHEwJTRjELMAkGA1UECBMCQ0ExCzAJBgNVBAYTAlVTMRgwFgYDVQQD
Ew9TdXBlcmZpc2gsIEluYy4wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAOjz
Shh2Xxk/sc9Y6X9DBwmVgDXFD/5xMSeBmRImIKXfj2r8QlU57gk4idngNsSsAYJb
1Tnm+Y8HiN/+7vahFM6pdEXY/fAXVyqC4XouEpNarIrXFWPRt5tVgA9YvBxJ7SBi
3bZMpTrrHD2g/3pxptMQeDOuS8Ic/ZJKocPnQaQtAgMBAAGjgcAwgb0wDAYDVR0T
BAUwAwEB/zAdBgNVHQ4EFgQU+5izU38URC7o7tUJml4OVoaoNYgwgY0GA1UdIwSB
hTCBgoAU+5izU38URC7o7tUJml4OVoaoNYihX6RdMFsxGDAWBgNVBAoTD1N1cGVy
ZmlzaCwgSW5jLjELMAkGA1UEBxMCU0YxCzAJBgNVBAgTAkNBMQswCQYDVQQGEwJV
UzEYMBYGA1UEAxMPU3VwZXJmaXNoLCBJbmMuggkA0vwTh6lE3OcwDQYJKoZIhvcN
AQEFBQADgYEApHyg7ApKx3DEcWjzOyLi3JyN0JL+c35yK1VEmxu0Qusfr76645Oj
1IsYwpTws6a9ZTRMzST4GQvFFQra81eLqYbPbMPuhC+FCxkUF5i0DNSWi+kczJXJ
TtCqSwGl9t9JEoFqvtW+znZ9TqyLiOMw7TGEUI+88VAqW0qmXnwPcfo=
-----END CERTIFICATE-----
idp_entity_id: &ref_33
type: string
description: >-
Entity ID of external identity provider; Usually it will
be an URL
example: http://www.example.com/abcdefeascdaserdsawe
sp_entity_id: &ref_34
type: string
description: >-
Entity ID of Text Accounts; it has default value that can
be changed
example: https://text.livechat.com
active: &ref_35
type: boolean
description: Indicates if SAML configuration is enabled
example: true
version:
type: integer
description: >-
Version of SAML configuration; For now there are two
versions 1 and 2
example: 2
"400":
description: Bad Request
content:
application/json:
schema: *ref_10
"404":
description: "Not found: SAML configuration not found."
content:
application/json:
schema: *ref_11
"422":
description: Invalid request
content:
application/json:
schema: *ref_9
"500":
description: Server Error.
content:
application/json:
schema: *ref_6
post:
tags:
- SAML
summary: Create SAML configuration
description: >-
Creates SAML configuration for organization. To create SAML
configurtion, organization needs to have at least one product with
enterprise subscription.
parameters:
- in: header
name: Authorization
schema:
type: string
example: Bearer fra-a:vky95357S7KM1E4dXwv1DQ
requestBody:
required: true
content:
application/json:
schema:
properties:
entrypoint: *ref_31
certificate: *ref_32
idp_entity_id: *ref_33
sp_entity_id: *ref_34
required:
- entrypoint
- certificate
- idp_entity_id
responses:
"201":
description: "Created: SAML configuration was created."
"400":
description: >-
Bad Request: Accounts are connected with other organizations or
Insufficient products subscriptions
content:
application/json:
schema: *ref_10
"409":
description: "Conflict: Saml configuration already created."
content:
application/json:
schema: *ref_15
"422":
description: Invalid request
content:
application/json:
schema: *ref_9
"500":
description: Server Error.
content:
application/json:
schema: *ref_6
patch:
tags:
- SAML
summary: Modify SAML configuration
description: >-
Modifies SAML configuration for organization.
When changing active parameter it will enable SAML configuration. This
will cause other authentication(login/password etc.) methods to be
disabled for that organization. Acivation of SAML configuration will be
blocked if there is no product on enterprise plan or organization
contains account that is added to other organization.
parameters:
- in: header
name: Authorization
schema:
type: string
example: Bearer fra-a:vky95357S7KM1E4dXwv1DQ
requestBody:
required: true
content:
application/json:
schema:
properties:
entrypoint: *ref_31
certificate: *ref_32
idp_entity_id: *ref_33
sp_entity_id: *ref_34
active: *ref_35
responses:
"200":
description: SAML configuration was modified.
content:
application/json:
schema: *ref_36
"400":
description: >-
Bad Request: Accounts are connected with other organizations or
Insufficient products subscriptions; in case of enabling
configuration
content:
application/json:
schema: *ref_10
"403":
description: "Forbidden: Edition of v1 SAML configuration is forbidden"
content:
application/json:
schema: *ref_5
"404":
description: "Not found: SAML configuration not found."
content:
application/json:
schema: *ref_11
"409":
description: "Conflict: Account exists in other organization"
content:
application/json:
schema: *ref_15
"422":
description: Invalid request
content:
application/json:
schema: *ref_9
"500":
description: Server Error.
content:
application/json:
schema: *ref_6
delete:
tags:
- SAML
summary: Delete SAML configuration
description: >-
Removes SAML configuration for organization. It will enable other
authentication methods for organization.
parameters:
- in: header
name: Authorization
schema:
type: string
example: Bearer fra-a:vky95357S7KM1E4dXwv1DQ
responses:
"200":
description: SAML configuration was deleted.
"400":
description: Bad Request
content:
application/json:
schema: *ref_10
"404":
description: "Not found: SAML configuration not found"
content:
application/json:
schema: *ref_11
"422":
description: Invalid request
content:
application/json:
schema: *ref_9
"500":
description: Server Error.
content:
application/json:
schema: *ref_6
/organizations/my/login_methods:
get:
tags:
- OrganizationLoginMethods
summary: Get login methods
description: Returns login methods for organization
parameters:
- in: header
name: Authorization
schema:
type: string
example: Bearer fra-a:vky95357S7KM1E4dXwv1DQ
responses:
"200":
description: "OK: Returns organization login methods."
content:
application/json:
schema:
type: array
items:
type: object
properties:
login_method: &ref_37
description: Login method object
type: object
properties:
login_method:
type: string
description: Login method enforced for organization
enum:
- google
- microsoft
- saml
example: saml
organization_id:
type: string
format: uuid
description: Organization ID
example: 00000000-0000-0000-0000-000000000000
"500":
description: Server Error.
content:
application/json:
schema: *ref_6
post:
tags:
- OrganizationLoginMethods
summary: Enforce login method
description: Enforces login method for organization
parameters:
- in: header
name: Authorization
schema:
type: string
example: Bearer fra-a:vky95357S7KM1E4dXwv1DQ
requestBody:
required: true
content:
application/json:
schema: *ref_37
description: Login methods object
responses:
"200":
description: "OK: Returns organization login methods."
"400":
description: "Bad Request: invalid login method or missing required fields."
content:
application/json:
schema: *ref_10
"404":
description: |
It may happen in the following cases:
- Login method not found
- (SAML) configuration not found
content:
application/json:
schema: *ref_11
"409":
description: |
It may happen in the following cases:
- Login method enabled or
- Feature conflict (Eg. Domain whitelist is enabled)
- (SAML) Account is in more than one organization
- (SAML) Insufficient product subscription level
content:
application/json:
schema: *ref_15
"500":
description: Server Error.
content:
application/json:
schema: *ref_6
/organizations/my/login_methods/{login_method}:
delete:
tags:
- OrganizationLoginMethods
summary: Disable login method
description: Disables login method for organization
parameters:
- in: header
name: Authorization
schema:
type: string
example: Bearer fra-a:vky95357S7KM1E4dXwv1DQ
- in: path
name: login_method
required: true
schema:
type: string
example: google
responses:
"200":
description: "OK: login methods has been deleted."
"400":
description: "Bad Request: invalid login method"
content:
application/json:
schema: *ref_10
"404":
description: "Not found: Login methods not found."
content:
application/json:
schema: *ref_11
"500":
description: Server Error.
content:
application/json:
schema: *ref_6
components:
schemas: {}
securitySchemes:
PersonalAccessToken:
description: >-
Use your `account_id` as the username and the PersonalAccessToken (PAT)
as the password. Learn
how to get a PAT.
type: http
scheme: basic
OAuth2BearerToken:
description: >-
This API uses OAuth2 with the implicit grant flow. Learn
about the implicit grant flow.
type: oauth2
flows:
implicit:
authorizationUrl: https://accounts.livechat.com
scopes: {}
authorizationCode:
authorizationUrl: https://accounts.livechat.com
tokenUrl: https://accounts.livechat.com/token
scopes: {}