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: EasyCoexistence Events API
version: '1'
description: 'Your connected numbers and channels from your own backend: status and sending health, credentials, where messages go, signed status events. Messages never pass through EasyCoexistence: send through Meta with the number''s own token. Fields are snake_case, dates ISO 8601 in UTC. New fields and events are added without notice: ignore what you do not use. Reference: https://easycoexistence.com/docs/api. 36 operations.'
servers:
- url: https://easycoexistence.com/api/v1
security:
- apiKey: []
tags:
- name: Events
paths:
/events-endpoint:
get:
operationId: getEventsEndpoint
tags:
- Events
summary: Read the events URL
description: Where this account's events go, and which events it can receive.
parameters: []
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
additionalProperties: true
example:
url: https://hooks.example.com/ec-events
events:
- connection.connected
- connection.disconnected
- …
'401':
description: '`unauthorized`: No key, or a key that does not exist or was revoked.'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
put:
operationId: setEventsEndpoint
tags:
- Events
summary: Set the events URL
description: 'Sets it and answers the signing secret, once. When a URL is already set, a new one needs `replace_secret: true`, because it issues a new secret and your endpoint rejects every event until it has it.'
parameters: []
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
url:
type:
- string
- 'null'
format: uri
description: '`null` turns events off.'
replace_secret:
type: boolean
description: Needed to change a URL that is already set.
required:
- url
additionalProperties: true
example:
url: https://hooks.example.com/ec-events
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
additionalProperties: true
example:
url: https://hooks.example.com/ec-events
signing_secret: whsec_…
events:
- connection.connected
- …
'401':
description: '`unauthorized`: No key, or a key that does not exist or was revoked.'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'409':
description: '`secret_change`: The events URL is already set: send replace_secret: true.'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/events-endpoint/test:
post:
operationId: testEventsEndpoint
tags:
- Events
summary: Send a test event
description: Queues a `test` event to the events URL, signed and retried like every other, so you can check your handler before anything real happens. Answers the delivery id, which is also the `id` in the payload.
parameters: []
responses:
'202':
description: Accepted
content:
application/json:
schema:
type: object
additionalProperties: true
example:
id: <delivery id>
event: test
'400':
description: '`invalid_request`: A field is missing or wrong; the message names it.'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'401':
description: '`unauthorized`: No key, or a key that does not exist or was revoked.'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
components:
schemas:
Error:
type: object
required:
- error
properties:
error:
type: object
required:
- code
- message
properties:
code:
type: string
enum:
- invalid_json
- invalid_request
- channel_unavailable
- not_supported
- invalid_media
- unauthorized
- billing_required
- suspended
- not_found
- removed
- conflict
- not_managed
- secret_change
- rate_limited
- internal
- meta_error
- meta_rejected
- revoke_failed
- credentials_unavailable
message:
type: string
description: For people; may change.
securitySchemes:
apiKey:
type: http
scheme: bearer
description: The account's ec_live_ key, made in Dashboard → Developers.