Connecting marketplace and mailbox to the sales agentAll articles

Connecting marketplace and mailbox to the sales agent

The same questions arrive by three routes. This case shows how marketplace and mailbox are connected without passing passwords around in clear text.

Published: 2026-09-12Reading time: 5 mintapinomahub API & workflows
API & processesMarketplacesAPI

A dealer answers enquiries in three places: in the marketplace inbox, in their own mail client and on the website. Three surfaces mean three answer qualities, three response times and the recurring situation of two colleagues answering the same enquiry differently.

Connecting marketplace and mailbox to the sales agentInput: a marketplace account and a mailbox answered by hand today 1. Create the channel (POST /agent/channels): type, name, profileId and settings — imap and smtp belong to a mailbox channel 2. Obtain marketplace consent (POST /agent/channels/{channelId}/ebay/consent): An authorizeUrl; the account holder grants consent, not us 3. Store the mailbox secrets (PUT /agent/channels/{channelId}/mail/credentials): imapStored and smtpStored confirm storage; the password never comes back 4. Test the mailbox (POST /agent/channels/{channelId}/mail/test): One attempt against imap and smtp before a customer waits for a reply 5. Watch the state (GET /agent/channels/{channelId}/status): nextPollAt, errorCount, lastErrorCode, pendingEvents and pendingOutbound Output: the same answer quality on the marketplace, in the mailbox and on the website Credentials can be revoked without deleting the channel. The history stays, the access ends.Connecting marketplace and mailbox to the sales agentInput: a marketplace account and a mailbox answered by hand today01Create the channelPOST /agent/channelstype, name, profileId and settings — imap and smtp belong to a mailbox channel02Obtain marketplace consentPOST /agent/channels/{channelId}/ebay/consentAn authorizeUrl; the account holder grants consent, not us03Store the mailbox secretsPUT /agent/channels/{channelId}/mail/credentialsimapStored and smtpStored confirm storage; the password never comes back04Test the mailboxPOST /agent/channels/{channelId}/mail/testOne attempt against imap and smtp before a customer waits for a reply05Watch the stateGET /agent/channels/{channelId}/statusnextPollAt, errorCount, lastErrorCode, pendingEvents and pendingOutboundOutput: the same answer quality on the marketplace, in the mailbox and on the websiteCredentials can be revoked without deleting the channel. The history stays, the access ends.
Five calls from creating the channel to watching it. The account holder grants consent themselves.

A channel is the connection to exactly one source and carries its own profile and its own credentials. The separation is what matters: credentials can be revoked without deleting the channel — the history stays, the access ends.

SurfaceRoles
Sales agentParts trading, Platform and marketplace, Vehicle trading

What this case requires

  • One profile per channel. Marketplace and mailbox may answer differently; the profile decides tone and permissions.
  • A dedicated mailbox for the agent. A shared mailbox leads to agent and human taking messages away from each other.
  • An account at the marketplace whose holder can consent. The account holder grants consent themselves, not us — it cannot be substituted.
  • Monitoring of the channel state. A channel whose mailbox has been rejecting for three days is only noticed if somebody looks.

The sequence

The table names the responsible call per stage and what exists afterwards. The reasoning for why a stage cannot be skipped follows below it.

The call chain of this use case
StageCallWhat exists afterwards
Create the channelPOST /agent/channelstype, name, profileId and settings — imap and smtp belong to a mailbox channel
Obtain marketplace consentPOST /agent/channels/{channelId}/ebay/consentAn authorizeUrl; the account holder grants consent, not us
Store the mailbox secretsPUT /agent/channels/{channelId}/mail/credentialsimapStored and smtpStored confirm storage; the password never comes back
Test the mailboxPOST /agent/channels/{channelId}/mail/testOne attempt against imap and smtp before a customer waits for a reply
Watch the stateGET /agent/channels/{channelId}/statusnextPollAt, errorCount, lastErrorCode, pendingEvents and pendingOutbound

Why each stage is needed

  1. Create the channel. POST /agent/channels requires type, name and profileId and takes settings. For a mailbox that includes imap and smtp — host, port and username, but no password. That is deliberate: secrets take their own route.
  2. Obtain the marketplace’s consent. POST /agent/channels/{channelId}/ebay/consent returns an authorizeUrl. The account holder grants consent there, and the return runs through the designated return path. Marketplace credentials are never typed in.
  3. Store the mailbox secrets. PUT /agent/channels/{channelId}/mail/credentials accepts the passwords and answers with imapStored and smtpStored. No password comes back: according to the contract, passwords go straight into encrypted storage, are never logged and are never part of the channel settings.
  4. Test the mailbox. POST /agent/channels/{channelId}/mail/test logs in for reading, selects the folder and, for sending, goes as far as login; nothing is sent. This stage belongs before operation, not after: otherwise a wrong password only surfaces when a customer is waiting for a reply.
  5. Watch the state. GET /agent/channels/{channelId}/status returns nextPollAt, errorCount, lastErrorCode, pendingEvents and pendingOutbound. That is where monitoring attaches — to figures, not to guesses.
Begin the marketplace consent
curl -X POST \
  -H 'X-Api-Key: <API_KEY>' \
  -H 'Content-Type: application/json' \
  -d '{"returnUrl":"https://example.de/agent/einwilligung-fertig"}' \
  'https://api.tapinomahub.com/hub/index.php/agent/channels/<channelId>/ebay/consent'

What you end up with

In the end marketplace, mailbox and website answer with the same quality, and each channel can be stopped, tested or revoked individually without touching the others.

Where to find this in the documentation

The binding field lists, error codes and sample responses live in this surface’s OpenAPI contract at docs.tapinomahub.com (tapinoma-agent). All use cases arranged by surface and role: overview of the use cases.

Frequently asked

Can I use the mailbox my team already uses?

Technically yes, practically better not. Agent and human would take messages away from each other. A dedicated mailbox for the agent keeps responsibility clean.

Can I see stored passwords again later?

No. The response only confirms storage. If a password changes you store it anew; it can be revoked separately from the channel.

What do I do when the channel counts errors?

Read the operating state. lastErrorCode names the last error code, errorCount counts the errors — and the mailbox test can be repeated deliberately.