Accounts and custom integrations
An account is one integration of your company in Replyco: an email inbox, a marketplace store, a messenger, or your own
system connected as a custom integration. Tickets, chats and customers record the account they came from, and other
operations refer to it by its id, for example integrationId when you create a customer. Your own system becomes an account when
you register it as a custom integration.
Fields that matter
Section titled “Fields that matter”| Field | Meaning |
|---|---|
id |
The account’s id. Pass it as integrationId or accountId to other operations. |
marketplace |
Which channel the account is, as a number. 20 is a custom integration; the API reference lists the others. |
name |
The name you gave the integration. |
displayName |
A second name for the account, when one is set. |
icon |
The integration’s icon, when one was uploaded. |
marketplaceMessagesLastSync |
When Replyco last fetched messages from the channel. Other …LastSync fields do the same for orders, returns and so on. |
A custom integration has a smaller body of its own: id, name and icon. Its marketplace is always set to 20,
whatever you send.
Custom integrations
Section titled “Custom integrations”Register your system once and keep the id you get back: it is the integrationId of every customer you create for it,
and the account of every ticket you open from it. See Connect your own system for the
whole flow.
curl -X POST https://open-api.replyco.com/openapi/account/addcustomintegration \ -H "Authorization: Bearer $ACCESS_TOKEN" -H "Content-Type: application/json" \ -d '{"name": "Northwind order portal"}'{ "name": "Northwind order portal" }The answer is the new account’s id as a bare JSON string:
"3f1c2a9e-7b4d-4e8a-9c21-5d6f0a1b2c3d"Each call creates a new account, so a retried create leaves a second integration. Before you create one, call
GET /openapi/account/getallcustomintegrations to see whether it already exists. That list holds only custom
integrations, never your email or marketplace accounts, and is an empty array when you have none.
[ { "id": "3f1c2a9e-7b4d-4e8a-9c21-5d6f0a1b2c3d", "name": "Northwind order portal", "displayName": null }]PUT /openapi/account/updatecustomintegration replaces a custom integration with the body you send. The body’s id
says which integration to change, and a field you leave out is cleared, so send every field each time.
DELETE /openapi/account/{id} deletes a custom integration. It deletes only custom integrations: any other id,
including the id of an email or marketplace account, is answered with 404.
Listing and filtering
Section titled “Listing and filtering”GET /openapi/account/paged returns one page of every account of your company, custom integrations included. Each page
carries totalRecords, pageSize, pagesCount, currentPage and the accounts in data.
| Parameter | What it does | Default | Limits |
|---|---|---|---|
page |
The page to return, from 1. | 1 | Stop at pagesCount. |
count |
Accounts per page. | 10 | At most 100; a larger value is rejected with 400. |
term |
Only accounts whose name or displayName contains this text, ignoring case. |
none | — |
sort |
The field to order by. | none: an order that has no meaning | marketplace, displayName, needRelogin, marketplaceMessagesLastSync, marketplaceOrdersLastSync or marketplaceReturnsLastSync; any other value is rejected with 400. |
asc |
true for ascending, false for descending. |
true |
— |
curl "https://open-api.replyco.com/openapi/account/paged?term=northwind&sort=displayName&count=50" \ -H "Authorization: Bearer $ACCESS_TOKEN"Each operation whose path ends in /paged allows one user 15 calls a minute, so ask for larger
pages rather than more of them (see Rate limits).
GET /openapi/account/{id} returns one account. An id that matches no account is answered with 204 and no body, and a
value that is not a GUID with 400.
Operations
Section titled “Operations”| Method | Path | Summary | Scopes |
|---|---|---|---|
| POST | /openapi/account/addcustomintegration |
Create a new custom integration | — |
| GET | /openapi/account/getallcustomintegrations |
Get all custom integrations for the current company | — |
| GET | /openapi/account/paged |
Get all records with paging | — |
| PUT | /openapi/account/updatecustomintegration |
Update an existing custom integration | — |
| GET | /openapi/account/{id} |
Get element by id | — |
| DELETE | /openapi/account/{id} |
Delete a custom integration by ID | — |
Errors
Section titled “Errors”| Status | Meaning | Returned by |
|---|---|---|
| 400 | Invalid request data (e.g., missing required fields, invalid marketplace type); Invalid request data or attempting to update non-custom integration; Cannot delete - account is not a custom integration | POST /openapi/account/addcustomintegration, PUT /openapi/account/updatecustomintegration, DELETE /openapi/account/{id} |
| 401 | User is not authenticated or authorized; Unauthorized | POST /openapi/account/addcustomintegration, GET /openapi/account/getallcustomintegrations, GET /openapi/account/paged, PUT /openapi/account/updatecustomintegration, GET /openapi/account/{id}, DELETE /openapi/account/{id} |
| 403 | User does not have permission to create integrations; User does not have permission to view integrations; User does not have permission to update integrations; User does not have permission to delete integrations | POST /openapi/account/addcustomintegration, GET /openapi/account/getallcustomintegrations, PUT /openapi/account/updatecustomintegration, DELETE /openapi/account/{id} |
| 404 | Integration with the specified ID was not found | PUT /openapi/account/updatecustomintegration, DELETE /openapi/account/{id} |
Related
Section titled “Related”- Connect your own system: register an integration and bring its customers and messages in.
- Customers: customers belong to an account through
integrationId. - Pagination and filtering: how every paged list works.
- API reference: every field of
AccountModelandCustomIntegrationModel.