Entry Points API
An Entry Point is a routing rule: “when this happens on this channel, hand the conversation to this Agent”. Connecting a channel gets messages into the account and creating an Agent gives you something that can reply, but neither decides who answers a stranger’s first message. Entry Points do. For the product itself, see the Entry Points guide.
- Base URL:
https://api.dmchamp.com/v1 - Authentication: your API key (see Authentication). Examples use the
?apiKey=query form; theX-API-Keyheader works too. - Errors and paging: see Errors & Pagination
- Every field, request and response: the API Reference
Agencies: every endpoint here accepts
sub_account_id(in the body onPOST/PUT, as a query parameter onGET/DELETE) so you can set up a client’s routing with your agency key. See API for Agencies.
The one call most integrations need
Connect a channel, create an Agent, then point the channel at the Agent:
curl -X PUT "https://api.dmchamp.com/v1/entry-points/channel-defaults?apiKey=YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "channel": "whatsapp", "agent_id": "ag7HkQ2ZpLxR3mNb" }'
That is the whole setup for “this Agent answers WhatsApp”. Everything else on this page is for narrower rules (keywords, comments, new followers), several numbers on one channel, and reading back what is configured.
How routing is decided
When a message arrives, the platform walks a fixed ladder and the first step that decides wins:
- A human has taken over the conversation: no AI.
- The contact is already assigned to an Agent, manually or because a conversation with that Agent is under way: the same Agent keeps it. Entry Points never move an existing conversation; to hand a chat to a different Agent, assign it (in the app, or with the Automations action).
- The contact is replying to a broadcast: the broadcast’s Agent answers, or nobody if the broadcast had none.
- A narrow Entry Point matches. Keyword rules beat comment rules, which beat follower rules. Between two rules of the same kind, the most recently updated one wins.
- The channel default for the channel the message arrived on. A default scoped to the specific number the contact wrote to beats the channel-wide default.
- Nothing matched: the message lands in the inbox for your team and no assistant replies.
Two things soften step 6. An account with exactly one active Agent and no default configured for the channel still gets that Agent as the answerer, so a fresh account that connects WhatsApp and sends a test message does not get silence. That floor never applies to a channel that has a keyword rule (there, a message that matches no keyword is deliberately left for a human) and never overrides a channel you set to nobody (see Leave a channel with nobody answering).
Whether the ladder is live for an account is reported by GET /entry-points/routing-status (cutover_enabled). It is true on every account today; the call exists so an integration can check before telling someone their routing change is live. It needs only view access, so a teammate sees the same answer as the owner.
The Entry Point object
Every rule has a type, the channels it covers, the agent_id it routes to, an enabled flag and a type-specific match_config. The full schema is in the API Reference. What the schema does not tell you:
enabled: falsemeans retired. Retired rules are history, not live settings, and they still come back from the list endpoints. Filter onenabledyourself for the current picture.agent_idis empty andno_oneistrueon a channel default deliberately set to nobody.- First response.
first_response_mode: "exact_text"sendsfirst_response_exact_textverbatim instead of letting the Agent write the first reply.{{first_name}}in it is replaced with the person’s first name, or “there” when it is unknown. This is honoured on comment rules today; keyword rules accept and store it but do not use it yet. public_comment_reply_exact_text(comment rules only) is the fixed public reply under the comment. Blank skips the public reply; the DM still goes out.- Timestamps are epoch milliseconds.
Rule types
type |
Fires when | match_config |
|---|---|---|
channel_default |
A new, unknown contact writes in on one of the channels. |
phone_numbers (optional): scope the default to one connected number. See One Agent per WhatsApp number. |
keyword |
A new contact’s first message, or its first non-empty line, is one of the keywords. Matching ignores case and spaces, and a near miss (“info pls” against INFO) is still resolved by AI unless you set fuzzy_match: false. Do that for promo codes and SKUs where a near miss must not count. Not applied on sms or imessage. |
keywords (at least one), fuzzy_match (default true). |
instagram_comment / facebook_comment |
Someone comments on one of your posts. channels must include instagram or facebook respectively. |
keywords (empty: every comment counts), post_ids (empty: all posts), delay_minutes (wait before the DM), reply_instructions (how the Agent words its reply). |
instagram_follower |
Someone new follows your Instagram account. Needs the Instagram (Personal) connection; the official Instagram DMs connection cannot see followers. | reply_instructions (optional). |
A keyword rule on a channel with no channel default also works as a gate: messages that match none of the keywords get no automatic reply and land in your inbox, even on an account with a single Agent.
Endpoints
| Task | Method and path | Details |
|---|---|---|
| Check that routing is live | GET /entry-points/routing-status |
Open in API Reference |
| See who answers each channel | GET /entry-points/channel-defaults |
Open in API Reference |
| Point a channel at an Agent | PUT /entry-points/channel-defaults |
Open in API Reference |
| Set a channel to No one’s answering | PUT /entry-points/channel-defaults with no_one: true |
Open in API Reference |
| Unset a channel’s default | DELETE /entry-points/channel-defaults |
Open in API Reference |
| List an Agent’s rules | GET /agents/{agentId}/entry-points |
Open in API Reference |
| Add a narrower rule | POST /agents/{agentId}/entry-points |
Open in API Reference |
| Change a rule | PUT /entry-points/{entryPointId} |
Open in API Reference |
| Delete a rule | DELETE /entry-points/{entryPointId} |
Open in API Reference |
| Route a channel to a campaign (older) | PUT /channel-routing/{channel} |
Open in API Reference |
| Free several channels (older) | POST /channel-routing/clear |
Open in API Reference |
Point a channel at an Agent
PUT /entry-points/channel-defaults with channel and agent_id (see the one call). It makes one Agent the answerer for new contacts on that channel.
- Any other Agent set as that channel’s default is retired in the same call, so a channel always has exactly one answerer. The response lists them in
disabled_entry_point_ids. Setting the Agent that already is the default changes nothing. - Only contacts you have never spoken to are affected. Anyone already in a conversation with an Agent keeps that Agent.
400whenchanneloragent_idis missing, the Agent belongs to another account, orphone_numberis not one of your connected numbers.
See who answers each channel
GET /entry-points/channel-defaults returns every channel default on the account, newest first, including retired ones and a channel set to nobody (no_one: true, agent_id: ""). This is the account-wide read: an Agent’s own list (GET /agents/{agentId}/entry-points) cannot show a channel set to nobody, because that rule belongs to no Agent.
Leave a channel with nobody answering
curl -X DELETE "https://api.dmchamp.com/v1/entry-points/channel-defaults?channel=instagram&apiKey=YOUR_API_KEY"
- The channel is a query parameter, not a body. Add
&phone_number=%2B31685101091to clear only that number’s default and let the number go back to whoever answers the channel. - Safe to repeat: clearing a channel with no default is a
200with an emptydisabled_entry_point_ids. - Clearing means unset, not silence. On an account with exactly one active Agent, an unconfigured channel still falls back to that Agent. To keep the AI off a channel entirely, send
PUT /entry-points/channel-defaultswith{"channel": "instagram", "no_one": true}(addphone_numberfor one number). That is the same No one’s answering choice as the app’s Who Answers New Conversations panel: an explicit “nobody” default the fallback never overrides. Sending anagent_idlater switches the channel back on.
One Agent per WhatsApp number
Routing is per channel by default: all your WhatsApp numbers share one answerer. With two or more numbers connected on WhatsApp Business or WhatsApp Web, a default can be scoped to a single number, so a business with a number per branch or brand can give each its own Agent inside one account.
curl -X PUT "https://api.dmchamp.com/v1/entry-points/channel-defaults?apiKey=YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"channel": "whatsapp_web",
"agent_id": "agRotterdamBranch",
"phone_number": "+31685101091"
}'
- The number must be one of your connected numbers on that channel, written as it shows under connected numbers (E.164 with the
+); anything else is a400. - The rule is stored as a channel default with
match_config.phone_numbers: ["+31685101091"]. A message on that number goes to its Agent; every other number keeps following the channel-wide default. - Setting or clearing the channel-wide default leaves number-scoped rules alone, and the other way round.
- Replies always go out from the number the contact wrote to, so the contact keeps talking to the same number and the same Agent.
Add a narrower rule
POST /agents/{agentId}/entry-points creates a keyword, comment or follower rule. The Agent in the path always wins: a rule can never be created for a different Agent than the one in the URL. It can also create a channel default, but PUT /entry-points/channel-defaults is the better call for that because it retires the previous answerer for you.
curl -X POST "https://api.dmchamp.com/v1/agents/ag7HkQ2ZpLxR3mNb/entry-points?apiKey=YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"type": "keyword",
"channels": ["whatsapp", "instagram"],
"match_config": { "keywords": ["pricing", "quote"] }
}'
Returns 201 with the new entry_point_id. A comment-to-DM rule that only reacts to comments saying “LINK” on two posts, waits two minutes and sends a fixed first message:
{
"type": "instagram_comment",
"channels": ["instagram"],
"match_config": {
"keywords": ["LINK"],
"post_ids": ["17895695668004550", "17841400008460056"],
"delay_minutes": 2
},
"first_response_mode": "exact_text",
"first_response_exact_text": "Hi {{first_name}}, here is the link you asked for: https://example.com/guide",
"public_comment_reply_exact_text": "Sent you a DM!"
}
A 400 names what is wrong: an unknown type, an empty channels, a keyword rule without keywords, or a comment rule that does not list its own channel.
A 409 means an active Agent on the account already answers one of these keywords on one of these channels. Add the keywords to that rule instead, or pause one of the two Agents: a paused Agent’s keywords do not count, so a paused copy of an Agent can carry the same keywords. Switching an Agent on (PATCH /agents/{agentId}/active) answers 409 the same way while another active Agent holds one of its keywords.
List an Agent’s rules
GET /agents/{agentId}/entry-points returns the rules that send conversations to this Agent, newest first, retired ones included.
Change a rule
Send only the fields you are changing to PUT /entry-points/{entryPointId}; nested settings can be addressed with a dotted key such as "match_config.keywords".
- Whenever the change touches
type,channelsormatch_config, the whole rule is re-checked, so a partial edit can never leave an unusable rule (switchingtypetokeywordwithout keywords is rejected). { "enabled": false }retires a rule without deleting it.{ "agent_id": "agOtherAgent" }moves it to another of your Agents; a blankagent_idis rejected.- Ownership and identity fields are ignored. An empty body returns
400("No fields to update").
Delete a rule
DELETE /entry-points/{entryPointId} removes the rule permanently. Nothing else refers to an Entry Point, so there is nothing to detach first. To stop a rule from firing but keep it, set enabled to false instead; channel defaults are normally retired rather than deleted, which is what DELETE /entry-points/channel-defaults does.
The older, campaign-shaped calls
Two endpoints from before Agents still work for accounts organised around campaigns. New integrations should use the channel-defaults calls above.
PUT /channel-routing/{channel}with{ "campaignId": "cp5NbV8xQrT2wYzA" }names a campaign, and that campaign’s Agent becomes the channel’s answerer.{ "campaignId": null }clears the channel. An outgoing-only campaign is rejected because it has no inbound behaviour.POST /channel-routing/clearwith{ "channels": ["whatsapp", "instagram"] }frees several channels from whichever Agent answers them in one call.released_channelslists the ones that actually had an answerer.
Both unset rather than silence: on an account with exactly one active Agent, a freed channel still falls back to that Agent.
Permissions and errors
- Writes need edit rights on campaigns; the list and status reads need view rights. A key or team member without them gets
403. 404means the Entry Point or Agent does not exist or belongs to another account.- The shared codes (
401,403for a plan without API access,429,500) are in Errors & Pagination.
Being in the specification also means these endpoints show up as tools for any AI assistant you connect over MCP.
Next steps
- Entry Points: the concept, the rule types, and the Who Answers New Conversations panel in the app.
- AI Agents API: create and configure the Agents these rules route to.
- Channels API: connect the channels themselves.
- Comment-to-DM Automation: what the comment rules do once they fire.