API Reference
Everything the console does, over a token-secured JSON API.
Overview
The AS2Expert API is served under a single base URL:
https://b2b.as2expert.com/api/v1
All endpoints are invoked with HTTP POST and exchange JSON.
Requests without a body still use POST with an empty JSON object.
Every response carries a status field —
"success" or an error indicator — alongside the payload.
Authentication
Every request must include your API token as a Bearer credential:
curl -X POST https://b2b.as2expert.com/api/v1/stations -H "Authorization: Bearer YOUR_API_TOKEN" -H "Content-Type: application/json" -d '{}'
- Tokens identify your account and carry scopes
(
read,write,admin) that are enforced on every call. - Tokens are issued from the authenticated console — they are never created during public signup, and they are stored server-side only as SHA-256 hashes.
- Keep tokens out of frontend code and repositories. Rotate a token by issuing a replacement and revoking the old one.
Conventions
- POST everywhere. Listing, detail and action endpoints all use POST with a JSON body.
- English canonical, Spanish accepted. Canonical field names
are English (
partner,subject,file_name…). Historical Spanish aliases (socio,asunto,fichero_nombre…) remain accepted on requests, and responses include both spellings where they exist. New integrations should use the English names. - Listings return
data[]plus atotalcount. Detail endpoints return a singledataobject. - Binary content travels Base64-encoded inside JSON.
Dashboard
Aggregated activity for your account over the last 30 days.
| Response | Description |
|---|---|
data.mensajes_30d | Messages exchanged in the window |
data.exitosos | Successful exchanges |
data.errores | Failed exchanges |
data.tasa_exito_pct | Success rate, percent |
Stations
List the stations your token can access.
| Request | |
|---|---|
idoptional |
Restrict the listing to one station |
| Response item | |
id, name, as2_id |
Station identity (Spanish aliases included) |
Full detail of one station, including its folders.
| Request | |
|---|---|
idrequired |
Station id |
Traffic metrics for one station or one of its folders: totals, success ratio and volume.
| Request | |
|---|---|
stationrequired |
Station id (id is accepted as an alias) |
folderoptional |
Restrict the metrics to one folder subtree |
Partners
List partner profiles.
| Request | |
|---|---|
stationoptional |
Filter by station id |
| Response item | |
id, name, as2_id |
Partner identity |
Full detail of one partner, including its
station_name.
| Request | |
|---|---|
idrequired |
Partner id |
Certificates
List the certificates visible to your account. Items carry
id, commonName and the owner
email.
| Request | |
|---|---|
idrequired |
Certificate id |
Messages
List messages, newest first.
| Request | |
|---|---|
stationoptional |
Filter by station id |
folderoptional |
Filter by folder |
limitoptional |
Page size |
| Response item | |
id, asunto,
folder_name, station_name,
size_bytes |
Message summary |
Headers, states and identity of one message
(message_id is the AS2 Message-ID). The response
includes the AS2 state fields com, firma,
encriptacion and mdn.
| Request | |
|---|---|
idrequired |
Message id |
The decrypted payload of one message, Base64-encoded in
data.content_b64.
| Request | |
|---|---|
idrequired |
Message id |
List the individual files carried inside one message
(id required). Download one of them with
/messages/file-download passing id and
the file index or name returned here.
Incremental polling: messages that changed since a given marker — the natural primitive for synchronizing an external system without re-listing everything.
Bulk message actions. All of them accept
message_ids (array) — /messages/move also
takes the destination folder. They require the
write scope.
Send a message
Queue a document for a partner. Signing, encryption, compression and MDN follow the partner's configured policy.
| Request | |
|---|---|
partnerrequired |
Partner id |
subjectrequired |
Message subject |
file_namerequired |
File name of the document |
file_contentrequired |
Document content, Base64 |
| Response | |
data.message_id |
AS2 Message-ID assigned to the outbound message |
# Send a document to partner 42
curl -X POST https://b2b.as2expert.com/api/v1/messages/send -H "Authorization: Bearer YOUR_API_TOKEN" -H "Content-Type: application/json" -d '{
"partner": 42,
"subject": "ORDERS 2026-08-21",
"file_name": "orders.edi",
"file_content": "VU5BOisuPyoUTkIrVU5PQzoz..."
}'
Webhooks
| Request | |
|---|---|
partner_idrequired |
Partner the webhook belongs to |
webhook_urlrequired |
HTTPS endpoint to notify |
webhook_enabledrequired |
Enable or disable delivery |
webhook_eventsrequired |
Event list to subscribe to |
Current webhook configuration for one partner
(partner_id required). Returns the
config object with URL, enabled flag and events.
Send a test event to the configured webhook of one partner
(partner_id required) and report the delivery
result.
Delivery history for one partner (partner_id
required): each entry carries log_id,
event, success, attempts
and created_at.
Errors
Errors are reported both by HTTP status and in the body:
| Status | Meaning |
|---|---|
401 | Missing or invalid token |
403 | Token lacks the required scope, or the resource does not belong to your account |
404 | Unknown endpoint or resource |
429 | Rate limit exceeded — retry with backoff |
5xx | Server-side failure — safe to retry idempotent reads |
Error bodies carry status and a human-readable
msg. Treat any status other than
"success" as a failure even when the HTTP code
is 200.
POST /stations — it needs an empty body and proves your
token and scopes in one call.