The event log: every event in this workspace, exactly as webhooks deliver it, kept 7, 30 or 90 days by plan. To catch up after downtime, ask for everything `after` the last event you read from this list (not the last webhook: webhooks arrive out of order). Needs `history:read`, on plans with webhooks.
Pull this API's OpenAPI, operations, scores and pricing into your own code or AI agent
with a free APIs.io key —
sign in with
GitHub,
Google or
LinkedIn.
No form to fill in; signing in shares your email address with us (Privacy).
Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelistoverlay
GET/v1/eventsList events from webhooks · List events#
Ask an LLM
“Which events happened in my workspace while webhooks were on?”
“Can I list only the events that failed to deliver to my endpoints?”
Tell an agent
List all events.
List events of type {type} since {since}.
GET/v1/events/{id}Read one event · Read one event#
Ask an LLM
“What exactly did a webhook deliver for a particular event?”
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Get an API key
Free tier, no form to fill in. Signing in shares your email address with us — we
store it to create your key and to recognise you if you sign in with another
provider. By signing up you are subscribing to the APIs.io and API Evangelist
newsletters — you can unsubscribe from any issue. See our
Privacy Policy and Terms.
openapi: 3.2.0
info:
title: fxapis Events API
version: 0.1.0
description: 'fxapis is the MetaTrader 5 API. Connect an MT5 account once, then trade it, read its positions
and its history over plain HTTP. Choose whether each account stays connected or comes online
only when you need it.
### Conventions
- Every successful response is `{ "data": … }`; every failure is `{ "error": { "code", "message" } }`.
Match on `code`, which is stable. `message` is written for a human and may change.
- Every response carries `requestId`. Quote it in a support request and the entire call can be found.
- Times are RFC 3339 in UTC. Money and prices are never floats in a request body.
### Bringing an account online is not instant
A broker login takes as long as the broker takes — usually seconds, occasionally much longer.
`POST /accounts/{id}/warm` brings an account online and returns **202** with a `pollUrl` rather than
holding the request open, so your client''s timeout never becomes a question about someone else''s
network. Poll `GET /accounts/{id}/status` until `state` is `ready`.
### Credentials
The MT5 password you send is encrypted before it is stored, with a data key that is bound to that
one account, and is never returned by any endpoint, written to the account record or included in
a log line. We cannot show it back to you — if it is lost, it is reset at the broker.'
servers:
- url: https://api.fxapis.com
description: Production
security:
- apiKey: []
tags:
- name: Events
description: 'The event log: every event in this workspace, exactly as webhooks deliver it, kept 7, 30 or 90 days by plan. To catch up after downtime, ask for everything `after` the last event you read from this list (not the last webhook: webhooks arrive out of order). Needs `history:read`, on plans with webhooks.'
paths:
/v1/events:
get:
summary: List events
tags:
- Events
description: 'Everything that happened in this workspace while its plan included webhooks, exactly as webhooks deliver it, kept 7, 30 or 90 days by plan — whether or not a webhook endpoint was listening. Events from a time the plan did not include webhooks are not recorded, so they are not listed.
An event appears in the list a few seconds after it happens, and only once every earlier event has, so a page never moves past one that has not appeared yet — except an event stuck more than 15 minutes before it could be prepared for sending (rare; we alert on it), which stops holding the list back and so, once it does appear, may fall behind an `after=` loop that already paged past its moment.
**Catching up after downtime:** keep an anchor id taken only from the last item of a list page you processed — never from a webhook: webhooks do not arrive in list order (sends run in parallel and retries are spread out), so a webhook''s id can be newer than an event still retrying. On start, call `?after=` and keep calling with the last id of each page until a page comes back empty. Then check `delivery_status=failed`, or run a replay, for anything given up on. Deduplicate on `id`. With `after`, events come oldest first. Without it, newest first, paged by `nextCursor`. An `after` id older than your plan keeps answers `400 EVENT_NOT_IN_HISTORY`: resume from `since` instead.'
parameters:
- schema:
type: string
in: query
name: after
required: false
description: 'An event id: return the events after it, oldest first. To catch up, pass the id of the last event of a list page you processed — never a webhook''s id, since webhooks can arrive out of order.'
- schema:
type: string
format: date-time
in: query
name: since
required: false
description: Events at or after this time.
- schema:
type: string
format: date-time
in: query
name: until
required: false
description: Events before this time.
- schema:
anyOf:
- type: string
- type: array
items:
type: string
enum:
- order.filled
- order.rejected
- order.unresolved
- order.resolved
- order.cancelled
- position.opened
- position.closed
- account.state_changed
- wave.settled
- copy.executed
- copy.skipped
- copy.failed
- copy.subscription_stopped
- copy.drift_corrected
- copy.master_disconnected
in: query
name: type
required: false
description: 'Only these types: repeat it (`type=a&type=b`) or separate with commas.'
- schema:
type: string
format: uuid
in: query
name: account_id
required: false
description: Events about this MT5 account, including multi-account orders with a leg on it.
- schema:
type: string
enum:
- failed
in: query
name: delivery_status
required: false
description: '`failed`: events at least one of your endpoints has not received — given up on, or still retrying after a failure.'
- schema:
type: integer
minimum: 1
maximum: 200
default: 50
in: query
name: limit
required: false
- schema:
type: string
maxLength: 200
in: query
name: cursor
required: false
description: 'Without `after`: the previous page''s `nextCursor`.'
responses:
'200':
description: Default Response
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
type: object
description: 'Exactly the body a webhook delivery carries: one handler can process both.'
properties:
id:
type: string
format: uuid
description: The same id webhooks send in the body and `fxapis-event-id`. Deduplicate on it.
type:
type: string
enum:
- order.filled
- order.rejected
- order.unresolved
- order.resolved
- order.cancelled
- position.opened
- position.closed
- account.state_changed
- wave.settled
- copy.executed
- copy.skipped
- copy.failed
- copy.subscription_stopped
- copy.drift_corrected
- copy.master_disconnected
createdAt:
type: string
format: date-time
data:
type: object
additionalProperties: true
description: The resource as the REST API presented it when the event was sent out.
page:
type: object
properties:
hasMore:
type: boolean
nextCursor:
type:
- 'null'
- string
'400':
description: Default Response
content:
application/json:
schema:
type: object
properties:
error:
type: object
properties:
code:
type: string
description: Stable, machine-readable. Match on this, not on the message.
message:
type: string
description: For a human. May change between releases.
details:
type: array
items:
type: object
additionalProperties: true
required:
- code
- message
requestId:
type: string
description: Also on every response. Quote it in a support request and the whole call can be found.
'401':
description: Default Response
content:
application/json:
schema:
type: object
properties:
error:
type: object
properties:
code:
type: string
description: Stable, machine-readable. Match on this, not on the message.
message:
type: string
description: For a human. May change between releases.
details:
type: array
items:
type: object
additionalProperties: true
required:
- code
- message
requestId:
type: string
description: Also on every response. Quote it in a support request and the whole call can be found.
'402':
description: Default Response
content:
application/json:
schema:
type: object
properties:
error:
type: object
properties:
code:
type: string
description: Stable, machine-readable. Match on this, not on the message.
message:
type: string
description: For a human. May change between releases.
details:
type: array
items:
type: object
additionalProperties: true
required:
- code
- message
requestId:
type: string
description: Also on every response. Quote it in a support request and the whole call can be found.
'403':
description: Default Response
content:
application/json:
schema:
type: object
properties:
error:
type: object
properties:
code:
type: string
description: Stable, machine-readable. Match on this, not on the message.
message:
type: string
description: For a human. May change between releases.
details:
type: array
items:
type: object
additionalProperties: true
required:
- code
- message
requestId:
type: string
description: Also on every response. Quote it in a support request and the whole call can be found.
operationId: getV1Events
x-operation-id-source: derived
/v1/events/{id}:
get:
summary: Read one event
tags:
- Events
description: Exactly as a webhook delivery carried it.
parameters:
- schema:
type: string
format: uuid
in: path
name: id
required: true
responses:
'200':
description: Default Response
content:
application/json:
schema:
type: object
properties:
data:
type: object
description: 'Exactly the body a webhook delivery carries: one handler can process both.'
properties:
id:
type: string
format: uuid
description: The same id webhooks send in the body and `fxapis-event-id`. Deduplicate on it.
type:
type: string
enum:
- order.filled
- order.rejected
- order.unresolved
- order.resolved
- order.cancelled
- position.opened
- position.closed
- account.state_changed
- wave.settled
- copy.executed
- copy.skipped
- copy.failed
- copy.subscription_stopped
- copy.drift_corrected
- copy.master_disconnected
createdAt:
type: string
format: date-time
data:
type: object
additionalProperties: true
description: The resource as the REST API presented it when the event was sent out.
'401':
description: Default Response
content:
application/json:
schema:
type: object
properties:
error:
type: object
properties:
code:
type: string
description: Stable, machine-readable. Match on this, not on the message.
message:
type: string
description: For a human. May change between releases.
details:
type: array
items:
type: object
additionalProperties: true
required:
- code
- message
requestId:
type: string
description: Also on every response. Quote it in a support request and the whole call can be found.
'402':
description: Default Response
content:
application/json:
schema:
type: object
properties:
error:
type: object
properties:
code:
type: string
description: Stable, machine-readable. Match on this, not on the message.
message:
type: string
description: For a human. May change between releases.
details:
type: array
items:
type: object
additionalProperties: true
required:
- code
- message
requestId:
type: string
description: Also on every response. Quote it in a support request and the whole call can be found.
'403':
description: Default Response
content:
application/json:
schema:
type: object
properties:
error:
type: object
properties:
code:
type: string
description: Stable, machine-readable. Match on this, not on the message.
message:
type: string
description: For a human. May change between releases.
details:
type: array
items:
type: object
additionalProperties: true
required:
- code
- message
requestId:
type: string
description: Also on every response. Quote it in a support request and the whole call can be found.
'404':
description: Default Response
content:
application/json:
schema:
type: object
properties:
error:
type: object
properties:
code:
type: string
description: Stable, machine-readable. Match on this, not on the message.
message:
type: string
description: For a human. May change between releases.
details:
type: array
items:
type: object
additionalProperties: true
required:
- code
- message
requestId:
type: string
description: Also on every response. Quote it in a support request and the whole call can be found.
operationId: getV1EventsById
x-operation-id-source: derived
components:
securitySchemes:
apiKey:
type: http
scheme: bearer
description: '`Authorization: Bearer fx_live_<id>_<secret>`.
A key is shown once, at creation. We cannot show it again or recover it for you.
Keys carry a label (`live` or `test`) in the key itself, so each configuration is easy to tell
apart. Both reach real brokers: test with a broker demo account.
Scopes are per key. A key without `accounts:write` can read accounts and nothing else.'
adminKey:
type: http
scheme: bearer
description: '`Authorization: Bearer fx_admin_<id>_<secret>`.
An admin key manages this workspace''s ordinary API keys (`/v1/api-keys`) and can do nothing else.
Only the workspace owner makes one, in the console, optionally limited to IP addresses and given
an expiry. Every request made with one is audited.'