Skip to Content
API and MCPResources

Custom channels

Connect your own messaging service, such as LINE or Viber, to the FieldCamp Inbox through a small bridge you run.

A custom channel is an Inbox channel whose carrier is your own service. Use it to bring a messaging app FieldCamp does not connect to directly — LINE, Viber, your own chat widget — into the same Inbox your team already works in.

You run a small service, called the bridge. It does two things:

  • Customer writes on your carrier → the bridge posts the message to FieldCamp.
  • Staff replies in the Inbox → FieldCamp calls the bridge, and the bridge sends the reply on your carrier.
StepRouteScope
Create or manage a channel/api/v1/channels, /api/v1/channels/{id}inbox:read, inbox:write
Post a customer messagePOST /api/v1/channels/{id}/messagesinbox:write
Upload a customer's filePOST /api/v1/channels/{id}/attachmentsinbox:write
Report what happened to a replyPOST /api/v1/channels/{id}/messages/{messageId}/deliveryinbox:write
Catch up after an outageGET /api/v1/channels/{id}/outboundinbox:read
Link a carrier user to a client/api/v1/channels/{id}/contacts/{externalUserId}inbox:read, inbox:write

Create a channel

curl -X POST https://api.fieldcamp.ai/api/v1/channels \
  -H "Authorization: Bearer $FIELDCAMP_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Viber",
    "provider": "viber",
    "callbackUrl": "https://bridge.example.com/fieldcamp"
  }'
FieldRequiredDescription
nameYesThe channel name your team sees. Up to 200 characters.
providerNoA short lowercase label, for example viber.
callbackUrlNoWhere FieldCamp sends staff replies. Must be https://. A channel can be created without it: incoming messages work, and replies are refused until it is set.
isActiveNofalse switches the channel off.
lineNoConnects LINE directly. See LINE without a bridge.

The response includes signingSecret. It is returned only here and by rotate-secret, so store it. The bridge uses it to verify the calls FieldCamp makes to callbackUrl.

Each channel also returns callbackStatus:

ValueWhat it means
not_configuredNo callbackUrl is set, so staff cannot reply.
activeReplies are being sent to the bridge.
degradedSeveral calls to the bridge have failed in a row. FieldCamp keeps trying.

PATCH /api/v1/channels/{id} renames the channel, sets or clears callbackUrl, or switches it on or off. DELETE switches the channel off; its conversations and history are kept.

Post a customer message

curl -X POST https://api.fieldcamp.ai/api/v1/channels/$CHANNEL_ID/messages \
  -H "Authorization: Bearer $FIELDCAMP_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "externalUserId": "U4af4980629",
    "externalMessageId": "468789577898262530",
    "text": "Can you come on Friday?",
    "senderName": "Somchai"
  }'
FieldRequiredDescription
externalUserIdYesThe customer's ID on your carrier. Up to 256 characters.
externalMessageIdYesThe message's ID on your carrier. Used to ignore duplicates.
typeNotext (default), image, file, audio or video.
textSometimesUp to 10,000 characters. Required for text; a message needs text or at least one attachment.
attachmentsNoUp to 10. Each is the object returned by the attachments upload.
timestampNoISO-8601. When the customer sent it.
senderNameNoThe customer's display name.
replyToExternalMessageIdNoThe carrier ID of the message the customer quoted.

The message appears in the Inbox as an incoming message in that customer's conversation. A new conversation is started when there is none.

The response returns message, conversation (id, displayId, status, clientId) and clientId, with status 201.

Posting the same externalMessageId again stores nothing and returns the first result with duplicate: true and status 200. A timed-out request can be retried freely.

Files from the customer

FieldCamp does not download a URL you name, because a carrier's media link usually needs the carrier's token. Download the file in the bridge, then upload it:

curl -X POST https://api.fieldcamp.ai/api/v1/channels/$CHANNEL_ID/attachments \
  -H "Authorization: Bearer $FIELDCAMP_API_KEY" \
  -F "file=@photo.jpg"

Put the returned object, unchanged, into the message's attachments array.

  • One file per request, in a form field named file, up to 25 MB.
  • HTML, SVG, XML and script files are refused with 415.
  • An empty file is refused.

Receive staff replies

When a team member replies, FieldCamp sends a signed POST to callbackUrl:

{
  "id": "evt_01JD...",
  "type": "channel.message.outbound",
  "created_at": "2026-11-18T07:15:00.000Z",
  "data": {
    "workspaceId": "665f...",
    "channelId": "665f...",
    "provider": "viber",
    "conversationId": "665f...",
    "clientId": "665f...",
    "messageId": "665f...",
    "recipient": { "externalUserId": "U4af4980629" },
    "message": {
      "type": "text",
      "text": "Yes, Friday at 10 works.",
      "attachments": [],
      "replyTo": null,
      "sentAt": "2026-11-18T07:15:00.000Z",
      "sender": { "id": "665f...", "name": "Dana", "type": "agent" }
    }
  }
}
FieldDescription
idThe same on every retry of one reply. Use it to ignore a repeat.
data.messageIdPass this in the delivery report.
data.recipient.externalUserIdWho to send the reply to on your carrier.
data.message.typetext, image, audio, video or file.
data.message.attachmentsurl, filename, mimeType, size. The url can be fetched without credentials.
data.message.replyToSet when staff quoted a message: messageId, externalMessageId, text.

The request is signed the same way as every FieldCamp webhook. Verify it with the channel's signingSecret; see Verify the signature.

FieldCamp keeps retrying a reply for 24 hours until the bridge answers 2xx. After that the reply is shown to staff as Not delivered.

Report what happened

After your carrier accepts or refuses the reply, tell FieldCamp:

curl -X POST https://api.fieldcamp.ai/api/v1/channels/$CHANNEL_ID/messages/$MESSAGE_ID/delivery \
  -H "Authorization: Bearer $FIELDCAMP_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "status": "accepted", "externalMessageId": "468789999999" }'
statusExtra fieldsWhat staff see
acceptedexternalMessageId (optional): the carrier's ID for the sent message.Sent. Never Delivered or Read.
failedreason (required, up to 500 characters) and code (optional).Not delivered, with your reason as written.

There are two ways to report:

  • In the response to the webhook. Answer the webhook with 2xx and put the report ({ "status": "accepted", ... } or { "status": "failed", ... }) in the response body. One round trip is enough when the bridge calls its carrier straight away.
  • Later, with the delivery route above. Use this when the carrier answers after the webhook has been acknowledged.

A 2xx with an empty or unrelated body means the bridge took the reply, and it is shown to staff as Sent. The reply shows as Sending… only until the bridge answers 2xx.

A later report replaces an earlier one, in both directions: a reply marked Sent can still be reported as failed, and a failed one as accepted.

Catch up after an outage

GET /api/v1/channels/{id}/outbound lists staff replies on the channel, oldest first. Each row has eventId (the webhook's id), state, failure and data — the same data as the webhook, so the bridge can run the list through its normal handler.

ParameterDescription
statepending, accepted or failed. pending returns every reply the bridge has not yet answered with 2xx.
sinceISO-8601 timestamp.
limit, cursorlimit 1–100, default 50. cursor is meta.next.cursor from the previous response.

PUT /api/v1/channels/{id}/contacts/{externalUserId} creates or updates the carrier user in FieldCamp. URL-encode externalUserId.

FieldDescription
nameThe user's display name.
clientIdA FieldCamp client ID links the user to that client. null unlinks. Leave it out to keep the current link.

GET on the same path returns externalUserId, name, clientId, client and the user's current conversation.

Rotate the signing secret

POST /api/v1/channels/{id}/rotate-secret returns a new signingSecret once. The previous secret keeps signing alongside it for 24 hours, so the bridge can switch over without a gap.

LINE without a bridge

For LINE, FieldCamp can talk to LINE itself, so no bridge is needed. Send the LINE channel's own credentials instead of a callbackUrl:

{
  "name": "LINE",
  "line": {
    "channelSecret": "<from LINE Developers console → Basic settings>",
    "accessToken": "<from LINE Developers console → Messaging API>"
  }
}

The response returns webhookUrl. Set it as the webhook URL in the LINE Developers console. You cannot set a callbackUrl on a LINE channel, and it has no signing secret; in responses its callbackUrl shows that same FieldCamp webhook URL. To change the LINE credentials, send a new line object with PATCH.

Endpoints

GET/api/v1/channels

Response Body

application/json

application/json

application/json

curl -X GET "https://example.com/api/v1/channels"
{  "success": true,  "code": "success.created",  "message": "Client created successfully",  "data": null}
POST/api/v1/channels

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/api/v1/channels" \  -H "Content-Type: application/json" \  -d '{    "name": "LINE",    "provider": "line",    "callbackUrl": "https://bridge.example.com/fieldcamp/replies"  }'
{  "success": true,  "code": "success.created",  "message": "Client created successfully",  "data": null}
GET/api/v1/channels/{id}

Path Parameters

id*string

Channel id

Response Body

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/api/v1/channels/665f1c2ab3e4d5f6a7b8c9d0"
{  "success": true,  "code": "success.created",  "message": "Client created successfully",  "data": null}
PATCH/api/v1/channels/{id}

Path Parameters

id*string

Channel id

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X PATCH "https://example.com/api/v1/channels/665f1c2ab3e4d5f6a7b8c9d0" \  -H "Content-Type: application/json" \  -d '{    "callbackUrl": "https://bridge.example.com/fieldcamp/replies"  }'
{  "success": true,  "code": "success.created",  "message": "Client created successfully",  "data": null}
DELETE/api/v1/channels/{id}

Path Parameters

id*string

Channel id

Response Body

application/json

application/json

application/json

application/json

curl -X DELETE "https://example.com/api/v1/channels/665f1c2ab3e4d5f6a7b8c9d0"
{  "success": true,  "code": "success.created",  "message": "Client created successfully",  "data": null}
POST/api/v1/channels/{id}/messages

Path Parameters

id*string

Channel id

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/api/v1/channels/665f1c2ab3e4d5f6a7b8c9d0/messages" \  -H "Content-Type: application/json" \  -d '{    "externalUserId": "U4af4980629",    "externalMessageId": "468789577898262530",    "type": "text",    "text": "Do you treat termites?",    "senderName": "Somchai P.",    "timestamp": "2026-11-18T07:14:00Z"  }'
{  "success": true,  "code": "success.created",  "message": "Client created successfully",  "data": null}
POST/api/v1/channels/{id}/attachments

Path Parameters

id*string

Channel id

Request Body

multipart/form-data

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/api/v1/channels/665f1c2ab3e4d5f6a7b8c9d0/attachments" \  -F file="string"
{  "success": true,  "code": "success.created",  "message": "Client created successfully",  "data": null}
POST/api/v1/channels/{id}/messages/{messageId}/delivery

Path Parameters

id*string

Channel id

messageId*string

FieldCamp message id of the reply

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/api/v1/channels/665f1c2ab3e4d5f6a7b8c9d0/messages/665f1c2ab3e4d5f6a7b8c9d0/delivery" \  -H "Content-Type: application/json" \  -d '{    "status": "failed",    "code": "user_blocked",    "reason": "The customer has blocked this LINE account"  }'
{  "success": true,  "code": "success.created",  "message": "Client created successfully",  "data": null}
GET/api/v1/channels/{id}/outbound

Path Parameters

id*string

Channel id

Query Parameters

state?string

pending: not reported on yet.

since?string

Only replies created at or after this time.

cursor?string
limit?integer

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/api/v1/channels/665f1c2ab3e4d5f6a7b8c9d0/outbound"
{  "success": true,  "code": "success.created",  "message": "Client created successfully",  "data": null}
GET/api/v1/channels/{id}/contacts/{externalUserId}

Path Parameters

id*string

Channel id

externalUserId*string

The user's id on your carrier (for LINE, the userId). URL-encode it.

Response Body

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/api/v1/channels/665f1c2ab3e4d5f6a7b8c9d0/contacts/string"
{  "success": true,  "code": "success.created",  "message": "Client created successfully",  "data": null}
PUT/api/v1/channels/{id}/contacts/{externalUserId}

Path Parameters

id*string

Channel id

externalUserId*string

The user's id on your carrier (for LINE, the userId). URL-encode it.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X PUT "https://example.com/api/v1/channels/665f1c2ab3e4d5f6a7b8c9d0/contacts/string" \  -H "Content-Type: application/json" \  -d '{    "name": "Somchai P.",    "clientId": "6ad87483461ccd73da576be2"  }'
{  "success": true,  "code": "success.created",  "message": "Client created successfully",  "data": null}
POST/api/v1/channels/{id}/rotate-secret

Path Parameters

id*string

Channel id

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/api/v1/channels/665f1c2ab3e4d5f6a7b8c9d0/rotate-secret"
{  "success": true,  "code": "success.created",  "message": "Client created successfully",  "data": null}

On this page