Send a code to a destination
Send a code to a destination to find out whether it is really yours.
Only a channel whose requires_proof is true accepts this. A text message provider takes any well formed number, so a send that appears to have worked proves nothing; a code that comes back proves somebody holding that number typed it.
Call it again for another code to the same destination. The new code replaces the previous one, which stops being accepted, and starts with its full lifetime and its full set of tries.
Two sends are at least the wait set by this instance apart (one minute unless it says otherwise), and only so many codes may be sent before the destination has to be removed and typed again. A request inside the wait, including one racing another, or past the limit, answers 422 on channel with the reason that proof_code_refusal gives.
Path parameters
Sent as JSON. Anything not listed here is ignored.
Which channel: in_app, email, telegram or sms. Anything else answers 404.
Returns
The channel, still unproven. The code itself is never returned: it goes to the destination and nowhere else.
The channel.
Always notification_channel. It names the kind of record, so a caller holding several kinds can tell them apart without looking at where they came from.
The id of this record, as a string even when it reads as a number. It is what every endpoint naming this record takes.
Everything the record holds.
Which channel this is: in_app, email, telegram or sms. It also stands for the id of the record, so this is what goes in the path.
What the channel is called, in the language you asked in.
Whether the account wants anything to go out this way. A channel can be switched on only once everything below is satisfied.
Where messages go: the room, the conversation or the number, up to 255 characters, or null when the channel asks for none or none has been given.
Whether this channel has to be told where to send. Email does not, because the address is already on you.
Whether the service hands us the destination rather than the account typing it. True for Telegram, where the account opens a conversation with the bot and the bot tells us which one it is. A destination sent for such a channel is refused.
Whether the destination has to be proved before the channel may be switched on. True only for channels that accept a wrong destination without complaint, which today means text messages.
Whether it has been proved. Always true for a channel with nothing to prove.
Whether this particular server has been set up to send on the channel. False only for a channel whose provider account belongs to the instance, which today means Telegram and the text message. Switching on a channel that is false here answers 422.
Why the product switched the channel off itself, up to 255 characters, or null when it did not. Set when a channel refuses everything sent to it several times in a row.
Whether a code may be sent to the destination right now. False on a channel with nothing to prove, inside the wait after a send, and once every code allowed has been sent.
Why no code may be sent right now, in the words the settings screen prints, or null when one may.
Where to find this record.
The absolute address this record is read from.
Rate limit
Sixty requests per minute, per user, shared by every key and device. Every answer carries the budget left in X-RateLimit-Remaining.
Keys act as you, with exactly the access you have. Make one per integration so you can revoke it alone.