Send and receive SMS messages using your Android phone programmatically via a simple HTTP API
Add swagger file
Acho Arnold4f7ba4f6aef8
diff --git a/.gitignore b/.gitignoreindex 94898cad..aa102647 100644--- a/.gitignore+++ b/.gitignore@@ -1,5 +1,4 @@.idea-docs.env**serviceAccountKey.jsonandroid/app/debug/diff --git a/api/.gitignore b/api/.gitignoreindex 15a5f751..41524b6d 100644--- a/api/.gitignore+++ b/api/.gitignore@@ -1,4 +1,3 @@-docs.env*main.exetmpdiff --git a/api/docs/docs.go b/api/docs/docs.gonew file mode 100644index 00000000..cf4df174--- /dev/null+++ b/api/docs/docs.go@@ -0,0 +1,3457 @@+// Code generated by swaggo/swag. DO NOT EDIT.++package docs++import "github.com/swaggo/swag"++const docTemplate = `{+ "schemes": {{ marshal .Schemes }},+ "swagger": "2.0",+ "info": {+ "description": "{{escape .Description}}",+ "title": "{{.Title}}",+ "contact": {+ "name": "HTTP SMS",+ "email": "[email protected]"+ },+ "license": {+ "name": "AGPL-3.0",+ "url": "https://raw.githubusercontent.com/NdoleStudio/http-sms-manager/main/LICENSE"+ },+ "version": "{{.Version}}"+ },+ "host": "{{.Host}}",+ "basePath": "{{.BasePath}}",+ "paths": {+ "/billing/usage": {+ "get": {+ "security": [+ {+ "ApiKeyAuth": []+ }+ ],+ "description": "Get the summary of sent and received messages for a user in the current month",+ "consumes": [+ "application/json"+ ],+ "produces": [+ "application/json"+ ],+ "tags": [+ "Billing"+ ],+ "summary": "Get Billing Usage.",+ "responses": {+ "200": {+ "description": "OK",+ "schema": {+ "$ref": "#/definitions/responses.BillingUsageResponse"+ }+ },+ "400": {+ "description": "Bad Request",+ "schema": {+ "$ref": "#/definitions/responses.BadRequest"+ }+ },+ "401": {+ "description": "Unauthorized",+ "schema": {+ "$ref": "#/definitions/responses.Unauthorized"+ }+ },+ "422": {+ "description": "Unprocessable Entity",+ "schema": {+ "$ref": "#/definitions/responses.UnprocessableEntity"+ }+ },+ "500": {+ "description": "Internal Server Error",+ "schema": {+ "$ref": "#/definitions/responses.InternalServerError"+ }+ }+ }+ }+ },+ "/billing/usage-history": {+ "get": {+ "security": [+ {+ "ApiKeyAuth": []+ }+ ],+ "description": "Get billing usage records of sent and received messages for a user in the past. It will be sorted by timestamp in descending order.",+ "consumes": [+ "application/json"+ ],+ "produces": [+ "application/json"+ ],+ "tags": [+ "Billing"+ ],+ "summary": "Get billing usage history.",+ "parameters": [+ {+ "minimum": 0,+ "type": "integer",+ "description": "number of heartbeats to skip",+ "name": "skip",+ "in": "query"+ },+ {+ "maximum": 100,+ "minimum": 1,+ "type": "integer",+ "description": "number of heartbeats to return",+ "name": "limit",+ "in": "query"+ }+ ],+ "responses": {+ "200": {+ "description": "OK",+ "schema": {+ "$ref": "#/definitions/responses.BillingUsagesResponse"+ }+ },+ "400": {+ "description": "Bad Request",+ "schema": {+ "$ref": "#/definitions/responses.BadRequest"+ }+ },+ "401": {+ "description": "Unauthorized",+ "schema": {+ "$ref": "#/definitions/responses.Unauthorized"+ }+ },+ "422": {+ "description": "Unprocessable Entity",+ "schema": {+ "$ref": "#/definitions/responses.UnprocessableEntity"+ }+ },+ "500": {+ "description": "Internal Server Error",+ "schema": {+ "$ref": "#/definitions/responses.InternalServerError"+ }+ }+ }+ }+ },+ "/bulk-messages": {+ "post": {+ "security": [+ {+ "ApiKeyAuth": []+ }+ ],+ "description": "Sends bulk SMS messages to multiple users from a CSV file.",+ "consumes": [+ "application/json"+ ],+ "produces": [+ "application/json"+ ],+ "tags": [+ "BulkSMS"+ ],+ "summary": "Save bulk SMS file",+ "responses": {+ "202": {+ "description": "Accepted",+ "schema": {+ "$ref": "#/definitions/responses.NoContent"+ }+ },+ "400": {+ "description": "Bad Request",+ "schema": {+ "$ref": "#/definitions/responses.BadRequest"+ }+ },+ "401": {+ "description": "Unauthorized",+ "schema": {+ "$ref": "#/definitions/responses.Unauthorized"+ }+ },+ "422": {+ "description": "Unprocessable Entity",+ "schema": {+ "$ref": "#/definitions/responses.UnprocessableEntity"+ }+ },+ "500": {+ "description": "Internal Server Error",+ "schema": {+ "$ref": "#/definitions/responses.InternalServerError"+ }+ }+ }+ }+ },+ "/discord-integrations": {+ "get": {+ "security": [+ {+ "ApiKeyAuth": []+ }+ ],+ "description": "Get the discord integrations of a user",+ "consumes": [+ "application/json"+ ],+ "produces": [+ "application/json"+ ],+ "tags": [+ "DiscordIntegration"+ ],+ "summary": "Get discord integrations of a user",+ "parameters": [+ {+ "minimum": 0,+ "type": "integer",+ "description": "number of discord integrations to skip",+ "name": "skip",+ "in": "query"+ },+ {+ "type": "string",+ "description": "filter discord integrations containing query",+ "name": "query",+ "in": "query"+ },+ {+ "maximum": 20,+ "minimum": 1,+ "type": "integer",+ "description": "number of discord integrations to return",+ "name": "limit",+ "in": "query"+ }+ ],+ "responses": {+ "200": {+ "description": "OK",+ "schema": {+ "$ref": "#/definitions/responses.DiscordsResponse"+ }+ },+ "400": {+ "description": "Bad Request",+ "schema": {+ "$ref": "#/definitions/responses.BadRequest"+ }+ },+ "401": {+ "description": "Unauthorized",+ "schema": {+ "$ref": "#/definitions/responses.Unauthorized"+ }+ },+ "422": {+ "description": "Unprocessable Entity",+ "schema": {+ "$ref": "#/definitions/responses.UnprocessableEntity"+ }+ },+ "500": {+ "description": "Internal Server Error",+ "schema": {+ "$ref": "#/definitions/responses.InternalServerError"+ }+ }+ }+ },+ "post": {+ "security": [+ {+ "ApiKeyAuth": []+ }+ ],+ "description": "Save a discord integration for the authenticated user",+ "consumes": [+ "application/json"+ ],+ "produces": [+ "application/json"+ ],+ "tags": [+ "DiscordIntegration"+ ],+ "summary": "Save discord integration",+ "parameters": [+ {+ "description": "Payload of the discord integration request",+ "name": "payload",+ "in": "body",+ "required": true,+ "schema": {+ "$ref": "#/definitions/requests.DiscordStore"+ }+ }+ ],+ "responses": {+ "201": {+ "description": "Created",+ "schema": {+ "$ref": "#/definitions/responses.DiscordResponse"+ }+ },+ "400": {+ "description": "Bad Request",+ "schema": {+ "$ref": "#/definitions/responses.BadRequest"+ }+ },+ "401": {+ "description": "Unauthorized",+ "schema": {+ "$ref": "#/definitions/responses.Unauthorized"+ }+ },+ "422": {+ "description": "Unprocessable Entity",+ "schema": {+ "$ref": "#/definitions/responses.UnprocessableEntity"+ }+ },+ "500": {+ "description": "Internal Server Error",+ "schema": {+ "$ref": "#/definitions/responses.InternalServerError"+ }+ }+ }+ }+ },+ "/discord-integrations/{discordID}": {+ "put": {+ "security": [+ {+ "ApiKeyAuth": []+ }+ ],+ "description": "Update a discord integration for the currently authenticated user",+ "consumes": [+ "application/json"+ ],+ "produces": [+ "application/json"+ ],+ "tags": [+ "DiscordIntegration"+ ],+ "summary": "Update a discord integration",+ "parameters": [+ {+ "type": "string",+ "default": "32343a19-da5e-4b1b-a767-3298a73703ca",+ "description": "ID of the discord integration",+ "name": "discordID",+ "in": "path",+ "required": true+ },+ {+ "description": "Payload of discord integration to update",+ "name": "payload",+ "in": "body",+ "required": true,+ "schema": {+ "$ref": "#/definitions/requests.DiscordUpdate"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "OK",+ "schema": {+ "$ref": "#/definitions/responses.DiscordResponse"+ }+ },+ "400": {+ "description": "Bad Request",+ "schema": {+ "$ref": "#/definitions/responses.BadRequest"+ }+ },+ "401": {+ "description": "Unauthorized",+ "schema": {+ "$ref": "#/definitions/responses.Unauthorized"+ }+ },+ "422": {+ "description": "Unprocessable Entity",+ "schema": {+ "$ref": "#/definitions/responses.UnprocessableEntity"+ }+ },+ "500": {+ "description": "Internal Server Error",+ "schema": {+ "$ref": "#/definitions/responses.InternalServerError"+ }+ }+ }+ },+ "delete": {+ "security": [+ {+ "ApiKeyAuth": []+ }+ ],+ "description": "Delete a discord integration for a user",+ "consumes": [+ "application/json"+ ],+ "produces": [+ "application/json"+ ],+ "tags": [+ "Webhooks"+ ],+ "summary": "Delete discord integration",+ "parameters": [+ {+ "type": "string",+ "default": "32343a19-da5e-4b1b-a767-3298a73703ca",+ "description": "ID of the discord integration",+ "name": "discordID",+ "in": "path",+ "required": true+ }+ ],+ "responses": {+ "204": {+ "description": "No Content",+ "schema": {+ "$ref": "#/definitions/responses.NoContent"+ }+ },+ "400": {+ "description": "Bad Request",+ "schema": {+ "$ref": "#/definitions/responses.BadRequest"+ }+ },+ "401": {+ "description": "Unauthorized",+ "schema": {+ "$ref": "#/definitions/responses.Unauthorized"+ }+ },+ "422": {+ "description": "Unprocessable Entity",+ "schema": {+ "$ref": "#/definitions/responses.UnprocessableEntity"+ }+ },+ "500": {+ "description": "Internal Server Error",+ "schema": {+ "$ref": "#/definitions/responses.InternalServerError"+ }+ }+ }+ }+ },+ "/discord/event": {+ "post": {+ "description": "Publish a discord event to the registered listeners",+ "consumes": [+ "application/json"+ ],+ "produces": [+ "application/json"+ ],+ "tags": [+ "Discord"+ ],+ "summary": "Consume a discord event",+ "responses": {+ "204": {+ "description": "No Content",+ "schema": {+ "$ref": "#/definitions/responses.NoContent"+ }+ },+ "400": {+ "description": "Bad Request",+ "schema": {+ "$ref": "#/definitions/responses.BadRequest"+ }+ },+ "401": {+ "description": "Unauthorized",+ "schema": {+ "$ref": "#/definitions/responses.Unauthorized"+ }+ },+ "422": {+ "description": "Unprocessable Entity",+ "schema": {+ "$ref": "#/definitions/responses.UnprocessableEntity"+ }+ },+ "500": {+ "description": "Internal Server Error",+ "schema": {+ "$ref": "#/definitions/responses.InternalServerError"+ }+ }+ }+ }+ },+ "/heartbeats": {+ "get": {+ "security": [+ {+ "ApiKeyAuth": []+ }+ ],+ "description": "Get the last time a phone number requested for outstanding messages. It will be sorted by timestamp in descending order.",+ "consumes": [+ "application/json"+ ],+ "produces": [+ "application/json"+ ],+ "tags": [+ "Heartbeats"+ ],+ "summary": "Get heartbeats of an owner phone number",+ "parameters": [+ {+ "type": "string",+ "default": "+18005550199",+ "description": "the owner's phone number",+ "name": "owner",+ "in": "query",+ "required": true+ },+ {+ "minimum": 0,+ "type": "integer",+ "description": "number of heartbeats to skip",+ "name": "skip",+ "in": "query"+ },+ {+ "type": "string",+ "description": "filter containing query",+ "name": "query",+ "in": "query"+ },+ {+ "maximum": 20,+ "minimum": 1,+ "type": "integer",+ "description": "number of heartbeats to return",+ "name": "limit",+ "in": "query"+ }+ ],+ "responses": {+ "200": {+ "description": "OK",+ "schema": {+ "$ref": "#/definitions/responses.HeartbeatsResponse"+ }+ },+ "400": {+ "description": "Bad Request",+ "schema": {+ "$ref": "#/definitions/responses.BadRequest"+ }+ },+ "401": {+ "description": "Unauthorized",+ "schema": {+ "$ref": "#/definitions/responses.Unauthorized"+ }+ },+ "422": {+ "description": "Unprocessable Entity",+ "schema": {+ "$ref": "#/definitions/responses.UnprocessableEntity"+ }+ },+ "500": {+ "description": "Internal Server Error",+ "schema": {+ "$ref": "#/definitions/responses.InternalServerError"+ }+ }+ }+ },+ "post": {+ "security": [+ {+ "ApiKeyAuth": []+ }+ ],+ "description": "Save the heartbeat to make notify that a phone number is still active",+ "consumes": [+ "application/json"+ ],+ "produces": [+ "application/json"+ ],+ "tags": [+ "Heartbeats"+ ],+ "summary": "Register heartbeat of an owner phone number",+ "parameters": [+ {+ "description": "Payload of the heartbeat request",+ "name": "payload",+ "in": "body",+ "required": true,+ "schema": {+ "$ref": "#/definitions/requests.HeartbeatStore"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "OK",+ "schema": {+ "$ref": "#/definitions/responses.HeartbeatResponse"+ }+ },+ "400": {+ "description": "Bad Request",+ "schema": {+ "$ref": "#/definitions/responses.BadRequest"+ }+ },+ "401": {+ "description": "Unauthorized",+ "schema": {+ "$ref": "#/definitions/responses.Unauthorized"+ }+ },+ "422": {+ "description": "Unprocessable Entity",+ "schema": {+ "$ref": "#/definitions/responses.UnprocessableEntity"+ }+ },+ "500": {+ "description": "Internal Server Error",+ "schema": {+ "$ref": "#/definitions/responses.InternalServerError"+ }+ }+ }+ }+ },+ "/integration/3cx/messages": {+ "post": {+ "description": "Sends an SMS message from the 3CX platform",+ "consumes": [+ "application/json"+ ],+ "produces": [+ "application/json"+ ],+ "tags": [+ "3CXIntegration"+ ],+ "summary": "Sends a 3CX SMS message",+ "responses": {+ "204": {+ "description": "No Content",+ "schema": {+ "$ref": "#/definitions/responses.NoContent"+ }+ },+ "400": {+ "description": "Bad Request",+ "schema": {+ "$ref": "#/definitions/responses.BadRequest"+ }+ },+ "401": {+ "description": "Unauthorized",+ "schema": {+ "$ref": "#/definitions/responses.Unauthorized"+ }+ },+ "422": {+ "description": "Unprocessable Entity",+ "schema": {+ "$ref": "#/definitions/responses.UnprocessableEntity"+ }+ },+ "500": {+ "description": "Internal Server Error",+ "schema": {+ "$ref": "#/definitions/responses.InternalServerError"+ }+ }+ }+ }+ },+ "/lemonsqueezy/event": {+ "post": {+ "description": "Publish a lemonsqueezy event to the registered listeners",+ "consumes": [+ "application/json"+ ],+ "produces": [+ "application/json"+ ],+ "tags": [+ "Lemonsqueezy"+ ],+ "summary": "Consume a lemonsqueezy event",+ "responses": {+ "204": {+ "description": "No Content",+ "schema": {+ "$ref": "#/definitions/responses.NoContent"+ }+ },+ "400": {+ "description": "Bad Request",+ "schema": {+ "$ref": "#/definitions/responses.BadRequest"+ }+ },+ "401": {+ "description": "Unauthorized",+ "schema": {+ "$ref": "#/definitions/responses.Unauthorized"+ }+ },+ "422": {+ "description": "Unprocessable Entity",+ "schema": {+ "$ref": "#/definitions/responses.UnprocessableEntity"+ }+ },+ "500": {+ "description": "Internal Server Error",+ "schema": {+ "$ref": "#/definitions/responses.InternalServerError"+ }+ }+ }+ }+ },+ "/message-threads": {+ "get": {+ "security": [+ {+ "ApiKeyAuth": []+ }+ ],+ "description": "Get list of contacts which a phone number has communicated with (threads). It will be sorted by timestamp in descending order.",+ "consumes": [+ "application/json"+ ],+ "produces": [+ "application/json"+ ],+ "tags": [+ "Channel Threads"+ ],+ "summary": "Get message threads for a phone number",+ "parameters": [+ {+ "type": "string",+ "default": "+18005550199",+ "description": "owner phone number",+ "name": "owner",+ "in": "query",+ "required": true+ },+ {+ "minimum": 0,+ "type": "integer",+ "description": "number of messages to skip",+ "name": "skip",+ "in": "query"+ },+ {+ "type": "string",+ "description": "filter message threads containing query",+ "name": "query",+ "in": "query"+ },+ {+ "maximum": 20,+ "minimum": 1,+ "type": "integer",+ "description": "number of messages to return",+ "name": "limit",+ "in": "query"+ }+ ],+ "responses": {+ "200": {+ "description": "OK",+ "schema": {+ "$ref": "#/definitions/responses.MessageThreadsResponse"+ }+ },+ "400": {+ "description": "Bad Request",+ "schema": {+ "$ref": "#/definitions/responses.BadRequest"+ }+ },+ "401": {+ "description": "Unauthorized",+ "schema": {+ "$ref": "#/definitions/responses.Unauthorized"+ }+ },+ "422": {+ "description": "Unprocessable Entity",+ "schema": {+ "$ref": "#/definitions/responses.UnprocessableEntity"+ }+ },+ "500": {+ "description": "Internal Server Error",+ "schema": {+ "$ref": "#/definitions/responses.InternalServerError"+ }+ }+ }+ }+ },+ "/message-threads/{messageThreadID}": {+ "put": {+ "security": [+ {+ "ApiKeyAuth": []+ }+ ],+ "description": "Updates the details of a message thread",+ "consumes": [+ "application/json"+ ],+ "produces": [+ "application/json"+ ],+ "tags": [+ "Channel Threads"+ ],+ "summary": "Update a message thread",+ "parameters": [+ {+ "type": "string",+ "default": "32343a19-da5e-4b1b-a767-3298a73703ca",+ "description": "ID of the message thread",+ "name": "messageThreadID",+ "in": "path",+ "required": true+ },+ {+ "description": "Payload of message thread details to update",+ "name": "payload",+ "in": "body",+ "required": true,+ "schema": {+ "$ref": "#/definitions/requests.MessageThreadUpdate"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "OK",+ "schema": {+ "$ref": "#/definitions/responses.PhoneResponse"+ }+ },+ "400": {+ "description": "Bad Request",+ "schema": {+ "$ref": "#/definitions/responses.BadRequest"+ }+ },+ "401": {+ "description": "Unauthorized",+ "schema": {+ "$ref": "#/definitions/responses.Unauthorized"+ }+ },+ "422": {+ "description": "Unprocessable Entity",+ "schema": {+ "$ref": "#/definitions/responses.UnprocessableEntity"+ }+ },+ "500": {+ "description": "Internal Server Error",+ "schema": {+ "$ref": "#/definitions/responses.InternalServerError"+ }+ }+ }+ }+ },+ "/messages": {+ "get": {+ "security": [+ {+ "ApiKeyAuth": []+ }+ ],+ "description": "Get list of messages which are sent between 2 phone numbers. It will be sorted by timestamp in descending order.",+ "consumes": [+ "application/json"+ ],+ "produces": [+ "application/json"+ ],+ "tags": [+ "Messages"+ ],+ "summary": "Get messages which are sent between 2 phone numbers",+ "parameters": [+ {+ "type": "string",+ "default": "+18005550199",+ "description": "the owner's phone number",+ "name": "owner",+ "in": "query",+ "required": true+ },+ {+ "type": "string",+ "default": "+18005550100",+ "description": "the contact's phone number",+ "name": "contact",+ "in": "query",+ "required": true+ },+ {+ "minimum": 0,+ "type": "integer",+ "description": "number of messages to skip",+ "name": "skip",+ "in": "query"+ },+ {+ "type": "string",+ "description": "filter messages containing query",+ "name": "query",+ "in": "query"+ },+ {+ "maximum": 20,+ "minimum": 1,+ "type": "integer",+ "description": "number of messages to return",+ "name": "limit",+ "in": "query"+ }+ ],+ "responses": {+ "200": {+ "description": "OK",+ "schema": {+ "$ref": "#/definitions/responses.MessagesResponse"+ }+ },+ "400": {+ "description": "Bad Request",+ "schema": {+ "$ref": "#/definitions/responses.BadRequest"+ }+ },+ "401": {+ "description": "Unauthorized",+ "schema": {+ "$ref": "#/definitions/responses.Unauthorized"+ }+ },+ "422": {+ "description": "Unprocessable Entity",+ "schema": {+ "$ref": "#/definitions/responses.UnprocessableEntity"+ }+ },+ "500": {+ "description": "Internal Server Error",+ "schema": {+ "$ref": "#/definitions/responses.InternalServerError"+ }+ }+ }+ }+ },+ "/messages/bulk-send": {+ "post": {+ "security": [+ {+ "ApiKeyAuth": []+ }+ ],+ "description": "Add bulk SMS messages to be sent by the android phone",+ "consumes": [+ "application/json"+ ],+ "produces": [+ "application/json"+ ],+ "tags": [+ "Messages"+ ],+ "summary": "Send bulk SMS messages",+ "parameters": [+ {+ "description": "Bulk send message request payload",+ "name": "payload",+ "in": "body",+ "required": true,+ "schema": {+ "$ref": "#/definitions/requests.MessageBulkSend"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "OK",+ "schema": {+ "type": "array",+ "items": {+ "$ref": "#/definitions/responses.MessagesResponse"+ }+ }+ },+ "400": {+ "description": "Bad Request",+ "schema": {+ "$ref": "#/definitions/responses.BadRequest"+ }+ },+ "401": {+ "description": "Unauthorized",+ "schema": {+ "$ref": "#/definitions/responses.Unauthorized"+ }+ },+ "422": {+ "description": "Unprocessable Entity",+ "schema": {+ "$ref": "#/definitions/responses.UnprocessableEntity"+ }+ },+ "500": {+ "description": "Internal Server Error",+ "schema": {+ "$ref": "#/definitions/responses.InternalServerError"+ }+ }+ }+ }+ },+ "/messages/outstanding": {+ "get": {+ "security": [+ {+ "ApiKeyAuth": []+ }+ ],+ "description": "Get an outstanding message to be sent by an android phone",+ "consumes": [+ "application/json"+ ],+ "produces": [+ "application/json"+ ],+ "tags": [+ "Messages"+ ],+ "summary": "Get an outstanding message",+ "parameters": [+ {+ "type": "string",+ "default": "32343a19-da5e-4b1b-a767-3298a73703cb",+ "description": "The ID of the message",+ "name": "message_id",+ "in": "query",+ "required": true+ }+ ],+ "responses": {+ "200": {+ "description": "OK",+ "schema": {+ "$ref": "#/definitions/responses.MessageResponse"+ }+ },+ "400": {+ "description": "Bad Request",+ "schema": {+ "$ref": "#/definitions/responses.BadRequest"+ }+ },+ "401": {+ "description": "Unauthorized",+ "schema": {+ "$ref": "#/definitions/responses.Unauthorized"+ }+ },+ "422": {+ "description": "Unprocessable Entity",+ "schema": {+ "$ref": "#/definitions/responses.UnprocessableEntity"+ }+ },+ "500": {+ "description": "Internal Server Error",+ "schema": {+ "$ref": "#/definitions/responses.InternalServerError"+ }+ }+ }+ }+ },+ "/messages/receive": {+ "post": {+ "security": [+ {+ "ApiKeyAuth": []+ }+ ],+ "description": "Add a new message received from a mobile phone",+ "consumes": [+ "application/json"+ ],+ "produces": [+ "application/json"+ ],+ "tags": [+ "Messages"+ ],+ "summary": "Receive a new SMS message from a mobile phone",+ "parameters": [+ {+ "description": "Received message request payload",+ "name": "payload",+ "in": "body",+ "required": true,+ "schema": {+ "$ref": "#/definitions/requests.MessageReceive"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "OK",+ "schema": {+ "$ref": "#/definitions/responses.MessageResponse"+ }+ },+ "400": {+ "description": "Bad Request",+ "schema": {+ "$ref": "#/definitions/responses.BadRequest"+ }+ },+ "422": {+ "description": "Unprocessable Entity",+ "schema": {+ "$ref": "#/definitions/responses.UnprocessableEntity"+ }+ },+ "500": {+ "description": "Internal Server Error",+ "schema": {+ "$ref": "#/definitions/responses.InternalServerError"+ }+ }+ }+ }+ },+ "/messages/send": {+ "post": {+ "security": [+ {+ "ApiKeyAuth": []+ }+ ],+ "description": "Add a new SMS message to be sent by the android phone",+ "consumes": [+ "application/json"+ ],+ "produces": [+ "application/json"+ ],+ "tags": [+ "Messages"+ ],+ "summary": "Send a new SMS message",+ "parameters": [+ {+ "description": "PostSend message request payload",+ "name": "payload",+ "in": "body",+ "required": true,+ "schema": {+ "$ref": "#/definitions/requests.MessageSend"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "OK",+ "schema": {+ "$ref": "#/definitions/responses.MessageResponse"+ }+ },+ "400": {+ "description": "Bad Request",+ "schema": {+ "$ref": "#/definitions/responses.BadRequest"+ }+ },+ "401": {+ "description": "Unauthorized",+ "schema": {+ "$ref": "#/definitions/responses.Unauthorized"+ }+ },+ "422": {+ "description": "Unprocessable Entity",+ "schema": {+ "$ref": "#/definitions/responses.UnprocessableEntity"+ }+ },+ "500": {+ "description": "Internal Server Error",+ "schema": {+ "$ref": "#/definitions/responses.InternalServerError"+ }+ }+ }+ }+ },+ "/messages/{messageID}/events": {+ "post": {+ "security": [+ {+ "ApiKeyAuth": []+ }+ ],+ "description": "Use this endpoint to send events for a message when it is failed, sent or delivered by the mobile phone.",+ "consumes": [+ "application/json"+ ],+ "produces": [+ "application/json"+ ],+ "tags": [+ "Messages"+ ],+ "summary": "Upsert an event for a message on the mobile phone",+ "parameters": [+ {+ "type": "string",+ "default": "32343a19-da5e-4b1b-a767-3298a73703ca",+ "description": "ID of the message",+ "name": "messageID",+ "in": "path",+ "required": true+ },+ {+ "description": "Payload of the event emitted.",+ "name": "payload",+ "in": "body",+ "required": true,+ "schema": {+ "$ref": "#/definitions/requests.MessageEvent"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "OK",+ "schema": {+ "$ref": "#/definitions/responses.MessageResponse"+ }+ },+ "400": {+ "description": "Bad Request",+ "schema": {+ "$ref": "#/definitions/responses.BadRequest"+ }+ },+ "401": {+ "description": "Unauthorized",+ "schema": {+ "$ref": "#/definitions/responses.Unauthorized"+ }+ },+ "404": {+ "description": "Not Found",+ "schema": {+ "$ref": "#/definitions/responses.NotFound"+ }+ },+ "422": {+ "description": "Unprocessable Entity",+ "schema": {+ "$ref": "#/definitions/responses.UnprocessableEntity"+ }+ },+ "500": {+ "description": "Internal Server Error",+ "schema": {+ "$ref": "#/definitions/responses.InternalServerError"+ }+ }+ }+ }+ },+ "/phones": {+ "get": {+ "security": [+ {+ "ApiKeyAuth": []+ }+ ],+ "description": "Get list of phones which a user has registered on the http sms application",+ "consumes": [+ "application/json"+ ],+ "produces": [+ "application/json"+ ],+ "tags": [+ "Phones"+ ],+ "summary": "Get phones of a user",+ "parameters": [+ {+ "minimum": 0,+ "type": "integer",+ "description": "number of heartbeats to skip",+ "name": "skip",+ "in": "query"+ },+ {+ "type": "string",+ "description": "filter phones containing query",+ "name": "query",+ "in": "query"+ },+ {+ "maximum": 20,+ "minimum": 1,+ "type": "integer",+ "description": "number of phones to return",+ "name": "limit",+ "in": "query"+ }+ ],+ "responses": {+ "200": {+ "description": "OK",+ "schema": {+ "$ref": "#/definitions/responses.PhonesResponse"+ }+ },+ "400": {+ "description": "Bad Request",+ "schema": {+ "$ref": "#/definitions/responses.BadRequest"+ }+ },+ "401": {+ "description": "Unauthorized",+ "schema": {+ "$ref": "#/definitions/responses.Unauthorized"+ }+ },+ "422": {+ "description": "Unprocessable Entity",+ "schema": {+ "$ref": "#/definitions/responses.UnprocessableEntity"+ }+ },+ "500": {+ "description": "Internal Server Error",+ "schema": {+ "$ref": "#/definitions/responses.InternalServerError"+ }+ }+ }+ },+ "put": {+ "security": [+ {+ "ApiKeyAuth": []+ }+ ],+ "description": "Updates properties of a user's phone. If the phone with this number does not exist, a new one will be created. Think of this method like an 'upsert'",+ "consumes": [+ "application/json"+ ],+ "produces": [+ "application/json"+ ],+ "tags": [+ "Phones"+ ],+ "summary": "Upsert Phone",+ "parameters": [+ {+ "description": "Payload of new phone number.",+ "name": "payload",+ "in": "body",+ "required": true,+ "schema": {+ "$ref": "#/definitions/requests.PhoneUpsert"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "OK",+ "schema": {+ "$ref": "#/definitions/responses.PhoneResponse"+ }+ },+ "400": {+ "description": "Bad Request",+ "schema": {+ "$ref": "#/definitions/responses.BadRequest"+ }+ },+ "401": {+ "description": "Unauthorized",+ "schema": {+ "$ref": "#/definitions/responses.Unauthorized"+ }+ },+ "422": {+ "description": "Unprocessable Entity",+ "schema": {+ "$ref": "#/definitions/responses.UnprocessableEntity"+ }+ },+ "500": {+ "description": "Internal Server Error",+ "schema": {+ "$ref": "#/definitions/responses.InternalServerError"+ }+ }+ }+ }+ },+ "/phones/{phoneID}": {+ "delete": {+ "security": [+ {+ "ApiKeyAuth": []+ }+ ],+ "description": "Delete a phone that has been sored in the database",+ "consumes": [+ "application/json"+ ],+ "produces": [+ "application/json"+ ],+ "tags": [+ "Phones"+ ],+ "summary": "Delete Phone",+ "parameters": [+ {+ "type": "string",+ "default": "32343a19-da5e-4b1b-a767-3298a73703ca",+ "description": "ID of the phone",+ "name": "phoneID",+ "in": "path",+ "required": true+ }+ ],+ "responses": {+ "204": {+ "description": "No Content",+ "schema": {+ "$ref": "#/definitions/responses.NoContent"+ }+ },+ "400": {+ "description": "Bad Request",+ "schema": {+ "$ref": "#/definitions/responses.BadRequest"+ }+ },+ "401": {+ "description": "Unauthorized",+ "schema": {+ "$ref": "#/definitions/responses.Unauthorized"+ }+ },+ "422": {+ "description": "Unprocessable Entity",+ "schema": {+ "$ref": "#/definitions/responses.UnprocessableEntity"+ }+ },+ "500": {+ "description": "Internal Server Error",+ "schema": {+ "$ref": "#/definitions/responses.InternalServerError"+ }+ }+ }+ }+ },+ "/users/me": {+ "get": {+ "security": [+ {+ "ApiKeyAuth": []+ }+ ],+ "description": "Get details of the currently authenticated user",+ "consumes": [+ "application/json"+ ],+ "produces": [+ "application/json"+ ],+ "tags": [+ "Users"+ ],+ "summary": "Get current user",+ "responses": {+ "200": {+ "description": "OK",+ "schema": {+ "$ref": "#/definitions/responses.UserResponse"+ }+ },+ "400": {+ "description": "Bad Request",+ "schema": {+ "$ref": "#/definitions/responses.BadRequest"+ }+ },+ "401": {+ "description": "Unauthorized",+ "schema": {+ "$ref": "#/definitions/responses.Unauthorized"+ }+ },+ "422": {+ "description": "Unprocessable Entity",+ "schema": {+ "$ref": "#/definitions/responses.UnprocessableEntity"+ }+ },+ "500": {+ "description": "Internal Server Error",+ "schema": {+ "$ref": "#/definitions/responses.InternalServerError"+ }+ }+ }+ },+ "put": {+ "security": [+ {+ "ApiKeyAuth": []+ }+ ],+ "description": "Updates the details of the currently authenticated user",+ "consumes": [+ "application/json"+ ],+ "produces": [+ "application/json"+ ],+ "tags": [+ "Users"+ ],+ "summary": "Update a user",+ "parameters": [+ {+ "description": "Payload of user details to update",+ "name": "payload",+ "in": "body",+ "required": true,+ "schema": {+ "$ref": "#/definitions/requests.UserUpdate"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "OK",+ "schema": {+ "$ref": "#/definitions/responses.PhoneResponse"+ }+ },+ "400": {+ "description": "Bad Request",+ "schema": {+ "$ref": "#/definitions/responses.BadRequest"+ }+ },+ "401": {+ "description": "Unauthorized",+ "schema": {+ "$ref": "#/definitions/responses.Unauthorized"+ }+ },+ "422": {+ "description": "Unprocessable Entity",+ "schema": {+ "$ref": "#/definitions/responses.UnprocessableEntity"+ }+ },+ "500": {+ "description": "Internal Server Error",+ "schema": {+ "$ref": "#/definitions/responses.InternalServerError"+ }+ }+ }+ }+ },+ "/users/subscription": {+ "delete": {+ "security": [+ {+ "ApiKeyAuth": []+ }+ ],+ "description": "Cancel the subscription of the authenticated user.",+ "produces": [+ "application/json"+ ],+ "tags": [+ "Users"+ ],+ "summary": "Cancel the user's subscription",+ "responses": {+ "200": {+ "description": "OK",+ "schema": {+ "$ref": "#/definitions/responses.NoContent"+ }+ },+ "400": {+ "description": "Bad Request",+ "schema": {+ "$ref": "#/definitions/responses.BadRequest"+ }+ },+ "401": {+ "description": "Unauthorized",+ "schema": {+ "$ref": "#/definitions/responses.Unauthorized"+ }+ },+ "422": {+ "description": "Unprocessable Entity",+ "schema": {+ "$ref": "#/definitions/responses.UnprocessableEntity"+ }+ },+ "500": {+ "description": "Internal Server Error",+ "schema": {+ "$ref": "#/definitions/responses.InternalServerError"+ }+ }+ }+ }+ },+ "/users/subscription-update-url": {+ "get": {+ "security": [+ {+ "ApiKeyAuth": []+ }+ ],+ "description": "Fetches the subscription URL of the authenticated user.",+ "produces": [+ "application/json"+ ],+ "tags": [+ "Users"+ ],+ "summary": "Currently authenticated user subscription update URL",+ "responses": {+ "200": {+ "description": "OK",+ "schema": {+ "$ref": "#/definitions/responses.OkString"+ }+ },+ "400": {+ "description": "Bad Request",+ "schema": {+ "$ref": "#/definitions/responses.BadRequest"+ }+ },+ "401": {+ "description": "Unauthorized",+ "schema": {+ "$ref": "#/definitions/responses.Unauthorized"+ }+ },+ "422": {+ "description": "Unprocessable Entity",+ "schema": {+ "$ref": "#/definitions/responses.UnprocessableEntity"+ }+ },+ "500": {+ "description": "Internal Server Error",+ "schema": {+ "$ref": "#/definitions/responses.InternalServerError"+ }+ }+ }+ }+ },+ "/users/{userID}/notifications": {+ "put": {+ "security": [+ {+ "ApiKeyAuth": []+ }+ ],+ "description": "Update the email notification settings for a user",+ "consumes": [+ "application/json"+ ],+ "produces": [+ "application/json"+ ],+ "tags": [+ "Users"+ ],+ "summary": "Update notification settings",+ "parameters": [+ {+ "type": "string",+ "default": "32343a19-da5e-4b1b-a767-3298a73703ca",+ "description": "ID of the user to update",+ "name": "userID",+ "in": "path",+ "required": true+ },+ {+ "description": "User notification details to update",+ "name": "payload",+ "in": "body",+ "required": true,+ "schema": {+ "$ref": "#/definitions/requests.UserNotificationUpdate"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "OK",+ "schema": {+ "$ref": "#/definitions/responses.UserResponse"+ }+ },+ "400": {+ "description": "Bad Request",+ "schema": {+ "$ref": "#/definitions/responses.BadRequest"+ }+ },+ "401": {+ "description": "Unauthorized",+ "schema": {+ "$ref": "#/definitions/responses.Unauthorized"+ }+ },+ "422": {+ "description": "Unprocessable Entity",+ "schema": {+ "$ref": "#/definitions/responses.UnprocessableEntity"+ }+ },+ "500": {+ "description": "Internal Server Error",+ "schema": {+ "$ref": "#/definitions/responses.InternalServerError"+ }+ }+ }+ }+ },+ "/webhooks": {+ "get": {+ "security": [+ {+ "ApiKeyAuth": []+ }+ ],+ "description": "Get the webhooks of a user",+ "consumes": [+ "application/json"+ ],+ "produces": [+ "application/json"+ ],+ "tags": [+ "Webhooks"+ ],+ "summary": "Get webhooks of a user",+ "parameters": [+ {+ "minimum": 0,+ "type": "integer",+ "description": "number of webhooks to skip",+ "name": "skip",+ "in": "query"+ },+ {+ "type": "string",+ "description": "filter webhooks containing query",+ "name": "query",+ "in": "query"+ },+ {+ "maximum": 20,+ "minimum": 1,+ "type": "integer",+ "description": "number of webhooks to return",+ "name": "limit",+ "in": "query"+ }+ ],+ "responses": {+ "200": {+ "description": "OK",+ "schema": {+ "$ref": "#/definitions/responses.WebhooksResponse"+ }+ },+ "400": {+ "description": "Bad Request",+ "schema": {+ "$ref": "#/definitions/responses.BadRequest"+ }+ },+ "401": {+ "description": "Unauthorized",+ "schema": {+ "$ref": "#/definitions/responses.Unauthorized"+ }+ },+ "422": {+ "description": "Unprocessable Entity",+ "schema": {+ "$ref": "#/definitions/responses.UnprocessableEntity"+ }+ },+ "500": {+ "description": "Internal Server Error",+ "schema": {+ "$ref": "#/definitions/responses.InternalServerError"+ }+ }+ }+ },+ "post": {+ "security": [+ {+ "ApiKeyAuth": []+ }+ ],+ "description": "Save a webhook for the authenticated user",+ "consumes": [+ "application/json"+ ],+ "produces": [+ "application/json"+ ],+ "tags": [+ "Webhooks"+ ],+ "summary": "Save a webhook",+ "parameters": [+ {+ "description": "Payload of the webhook request",+ "name": "payload",+ "in": "body",+ "required": true,+ "schema": {+ "$ref": "#/definitions/requests.WebhookStore"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "OK",+ "schema": {+ "$ref": "#/definitions/responses.WebhookResponse"+ }+ },+ "400": {+ "description": "Bad Request",+ "schema": {+ "$ref": "#/definitions/responses.BadRequest"+ }+ },+ "401": {+ "description": "Unauthorized",+ "schema": {+ "$ref": "#/definitions/responses.Unauthorized"+ }+ },+ "422": {+ "description": "Unprocessable Entity",+ "schema": {+ "$ref": "#/definitions/responses.UnprocessableEntity"+ }+ },+ "500": {+ "description": "Internal Server Error",+ "schema": {+ "$ref": "#/definitions/responses.InternalServerError"+ }+ }+ }+ }+ },+ "/webhooks/{webhookID}": {+ "put": {+ "security": [+ {+ "ApiKeyAuth": []+ }+ ],+ "description": "Update a webhook for the currently authenticated user",+ "consumes": [+ "application/json"+ ],+ "produces": [+ "application/json"+ ],+ "tags": [+ "Webhooks"+ ],+ "summary": "Update a webhook",+ "parameters": [+ {+ "type": "string",+ "default": "32343a19-da5e-4b1b-a767-3298a73703ca",+ "description": "ID of the webhook",+ "name": "webhookID",+ "in": "path",+ "required": true+ },+ {+ "description": "Payload of webhook details to update",+ "name": "payload",+ "in": "body",+ "required": true,+ "schema": {+ "$ref": "#/definitions/requests.WebhookUpdate"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "OK",+ "schema": {+ "$ref": "#/definitions/responses.WebhookResponse"+ }+ },+ "400": {+ "description": "Bad Request",+ "schema": {+ "$ref": "#/definitions/responses.BadRequest"+ }+ },+ "401": {+ "description": "Unauthorized",+ "schema": {+ "$ref": "#/definitions/responses.Unauthorized"+ }+ },+ "422": {+ "description": "Unprocessable Entity",+ "schema": {+ "$ref": "#/definitions/responses.UnprocessableEntity"+ }+ },+ "500": {+ "description": "Internal Server Error",+ "schema": {+ "$ref": "#/definitions/responses.InternalServerError"+ }+ }+ }+ },+ "delete": {+ "security": [+ {+ "ApiKeyAuth": []+ }+ ],+ "description": "Delete a webhook for a user",+ "consumes": [+ "application/json"+ ],+ "produces": [+ "application/json"+ ],+ "tags": [+ "Webhooks"+ ],+ "summary": "Delete webhook",+ "parameters": [+ {+ "type": "string",+ "default": "32343a19-da5e-4b1b-a767-3298a73703ca",+ "description": "ID of the webhook",+ "name": "webhookID",+ "in": "path",+ "required": true+ }+ ],+ "responses": {+ "204": {+ "description": "No Content",+ "schema": {+ "$ref": "#/definitions/responses.NoContent"+ }+ },+ "400": {+ "description": "Bad Request",+ "schema": {+ "$ref": "#/definitions/responses.BadRequest"+ }+ },+ "401": {+ "description": "Unauthorized",+ "schema": {+ "$ref": "#/definitions/responses.Unauthorized"+ }+ },+ "422": {+ "description": "Unprocessable Entity",+ "schema": {+ "$ref": "#/definitions/responses.UnprocessableEntity"+ }+ },+ "500": {+ "description": "Internal Server Error",+ "schema": {+ "$ref": "#/definitions/responses.InternalServerError"+ }+ }+ }+ }+ }+ },+ "definitions": {+ "entities.BillingUsage": {+ "type": "object",+ "required": [+ "created_at",+ "end_timestamp",+ "id",+ "received_messages",+ "sent_messages",+ "start_timestamp",+ "total_cost",+ "updated_at",+ "user_id"+ ],+ "properties": {+ "created_at": {+ "type": "string",+ "example": "2022-06-05T14:26:02.302718+03:00"+ },+ "end_timestamp": {+ "type": "string",+ "example": "2022-01-31T23:59:59+00:00"+ },+ "id": {+ "type": "string",+ "example": "32343a19-da5e-4b1b-a767-3298a73703cb"+ },+ "received_messages": {+ "type": "integer",+ "example": 465+ },+ "sent_messages": {+ "type": "integer",+ "example": 321+ },+ "start_timestamp": {+ "type": "string",+ "example": "2022-01-01T00:00:00+00:00"+ },+ "total_cost": {+ "type": "integer",+ "example": 0+ },+ "updated_at": {+ "type": "string",+ "example": "2022-06-05T14:26:10.303278+03:00"+ },+ "user_id": {+ "type": "string",+ "example": "WB7DRDWrJZRGbYrv2CKGkqbzvqdC"+ }+ }+ },+ "entities.Discord": {+ "type": "object",+ "required": [+ "created_at",+ "id",+ "incoming_channel_id",+ "name",+ "server_id",+ "updated_at",+ "user_id"+ ],+ "properties": {+ "created_at": {+ "type": "string",+ "example": "2022-06-05T14:26:02.302718+03:00"+ },+ "id": {+ "type": "string",+ "example": "32343a19-da5e-4b1b-a767-3298a73703cb"+ },+ "incoming_channel_id": {+ "type": "string",+ "example": "1095780203256627291"+ },+ "name": {+ "type": "string",+ "example": "Game Server"+ },+ "server_id": {+ "type": "string",+ "example": "1095778291488653372"+ },+ "updated_at": {+ "type": "string",+ "example": "2022-06-05T14:26:10.303278+03:00"+ },+ "user_id": {+ "type": "string",+ "example": "WB7DRDWrJZRGbYrv2CKGkqbzvqdC"+ }+ }+ },+ "entities.Heartbeat": {+ "type": "object",+ "required": [+ "charging",+ "id",+ "owner",+ "timestamp",+ "user_id",+ "version"+ ],+ "properties": {+ "charging": {+ "type": "boolean",+ "example": true+ },+ "id": {+ "type": "string",+ "example": "32343a19-da5e-4b1b-a767-3298a73703cb"+ },+ "owner": {+ "type": "string",+ "example": "+18005550199"+ },+ "timestamp": {+ "type": "string",+ "example": "2022-06-05T14:26:01.520828+03:00"+ },+ "user_id": {+ "type": "string",+ "example": "WB7DRDWrJZRGbYrv2CKGkqbzvqdC"+ },+ "version": {+ "type": "string",+ "example": "344c10f"+ }+ }+ },+ "entities.Message": {+ "type": "object",+ "required": [+ "can_be_polled",+ "contact",+ "content",+ "created_at",+ "delivered_at",+ "expired_at",+ "failed_at",+ "failure_reason",+ "id",+ "last_attempted_at",+ "max_send_attempts",+ "order_timestamp",+ "owner",+ "received_at",+ "request_id",+ "request_received_at",+ "scheduled_at",+ "send_attempt_count",+ "send_time",+ "sent_at",+ "sim",+ "status",+ "type",+ "updated_at",+ "user_id"+ ],+ "properties": {+ "can_be_polled": {+ "type": "boolean",+ "example": false+ },+ "contact": {+ "type": "string",+ "example": "+18005550100"+ },+ "content": {+ "type": "string",+ "example": "This is a sample text message"+ },+ "created_at": {+ "type": "string",+ "example": "2022-06-05T14:26:02.302718+03:00"+ },+ "delivered_at": {+ "type": "string",+ "example": "2022-06-05T14:26:09.527976+03:00"+ },+ "expired_at": {+ "type": "string",+ "example": "2022-06-05T14:26:09.527976+03:00"+ },+ "failed_at": {+ "type": "string",+ "example": "2022-06-05T14:26:09.527976+03:00"+ },+ "failure_reason": {+ "type": "string",+ "example": "UNKNOWN"+ },+ "id": {+ "type": "string",+ "example": "32343a19-da5e-4b1b-a767-3298a73703cb"+ },+ "last_attempted_at": {+ "type": "string",+ "example": "2022-06-05T14:26:09.527976+03:00"+ },+ "max_send_attempts": {+ "type": "integer",+ "example": 1+ },+ "order_timestamp": {+ "type": "string",+ "example": "2022-06-05T14:26:09.527976+03:00"+ },+ "owner": {+ "type": "string",+ "example": "+18005550199"+ },+ "received_at": {+ "type": "string",+ "example": "2022-06-05T14:26:09.527976+03:00"+ },+ "request_id": {+ "type": "string",+ "example": "153554b5-ae44-44a0-8f4f-7bbac5657ad4"+ },+ "request_received_at": {+ "type": "string",+ "example": "2022-06-05T14:26:01.520828+03:00"+ },+ "scheduled_at": {+ "type": "string",+ "example": "2022-06-05T14:26:09.527976+03:00"+ },+ "send_attempt_count": {+ "type": "integer",+ "example": 0+ },+ "send_time": {+ "description": "SendDuration is the number of nanoseconds from when the request was received until when the mobile phone send the message",+ "type": "integer",+ "example": 133414+ },+ "sent_at": {+ "type": "string",+ "example": "2022-06-05T14:26:09.527976+03:00"+ },+ "sim": {+ "description": "SIM is the SIM card to use to send the message\n* SMS1: use the SIM card in slot 1\n* SMS2: use the SIM card in slot 2\n* DEFAULT: used the default communication SIM card",+ "allOf": [+ {+ "$ref": "#/definitions/entities.SIM"+ }+ ],+ "example": "DEFAULT"+ },+ "status": {+ "type": "string",+ "example": "pending"+ },+ "type": {+ "type": "string",+ "example": "mobile-terminated"+ },+ "updated_at": {+ "type": "string",+ "example": "2022-06-05T14:26:10.303278+03:00"+ },+ "user_id": {+ "type": "string",+ "example": "WB7DRDWrJZRGbYrv2CKGkqbzvqdC"+ }+ }+ },+ "entities.MessageThread": {+ "type": "object",+ "required": [+ "color",+ "contact",+ "created_at",+ "id",+ "is_archived",+ "last_message_content",+ "last_message_id",+ "order_timestamp",+ "owner",+ "status",+ "updated_at",+ "user_id"+ ],+ "properties": {+ "color": {+ "type": "string",+ "example": "indigo"+ },+ "contact": {+ "type": "string",+ "example": "+18005550100"+ },+ "created_at": {+ "type": "string",+ "example": "2022-06-05T14:26:09.527976+03:00"+ },+ "id": {+ "type": "string",+ "example": "32343a19-da5e-4b1b-a767-3298a73703ca"+ },+ "is_archived": {+ "type": "boolean",+ "example": false+ },+ "last_message_content": {+ "type": "string",+ "example": "This is a sample message content"+ },+ "last_message_id": {+ "type": "string",+ "example": "32343a19-da5e-4b1b-a767-3298a73703ca"+ },+ "order_timestamp": {+ "type": "string",+ "example": "2022-06-05T14:26:09.527976+03:00"+ },+ "owner": {+ "type": "string",+ "example": "+18005550199"+ },+ "status": {+ "type": "string",+ "example": "PENDING"+ },+ "updated_at": {+ "type": "string",+ "example": "2022-06-05T14:26:09.527976+03:00"+ },+ "user_id": {+ "type": "string",+ "example": "WB7DRDWrJZRGbYrv2CKGkqbzvqdC"+ }+ }+ },+ "entities.Phone": {+ "type": "object",+ "required": [+ "created_at",+ "fcm_token",+ "id",+ "max_send_attempts",+ "message_expiration_seconds",+ "messages_per_minute",+ "phone_number",+ "sim",+ "updated_at",+ "user_id"+ ],+ "properties": {+ "created_at": {+ "type": "string",+ "example": "2022-06-05T14:26:02.302718+03:00"+ },+ "fcm_token": {+ "type": "string",+ "example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzd....."+ },+ "id": {+ "type": "string",+ "example": "32343a19-da5e-4b1b-a767-3298a73703cb"+ },+ "max_send_attempts": {+ "description": "MaxSendAttempts determines how many times to retry sending an SMS message",+ "type": "integer",+ "example": 2+ },+ "message_expiration_seconds": {+ "description": "MessageExpirationSeconds is the duration in seconds after sending a message when it is considered to be expired.",+ "type": "integer"+ },+ "messages_per_minute": {+ "type": "integer",+ "example": 1+ },+ "phone_number": {+ "type": "string",+ "example": "+18005550199"+ },+ "sim": {+ "$ref": "#/definitions/entities.SIM"+ },+ "updated_at": {+ "type": "string",+ "example": "2022-06-05T14:26:10.303278+03:00"+ },+ "user_id": {+ "type": "string",+ "example": "WB7DRDWrJZRGbYrv2CKGkqbzvqdC"+ }+ }+ },+ "entities.SIM": {+ "type": "string",+ "enum": [+ "SIM1",+ "SIM2"+ ],+ "x-enum-varnames": [+ "SIM1",+ "SIM2"+ ]+ },+ "entities.SubscriptionName": {+ "type": "string",+ "enum": [+ "free",+ "pro-monthly",+ "pro-yearly",+ "ultra-monthly",+ "ultra-yearly",+ "pro-lifetime",+ "20k-monthly",+ "20k-yearly"+ ],+ "x-enum-varnames": [+ "SubscriptionNameFree",+ "SubscriptionNameProMonthly",+ "SubscriptionNameProYearly",+ "SubscriptionNameUltraMonthly",+ "SubscriptionNameUltraYearly",+ "SubscriptionNameProLifetime",+ "SubscriptionName20KMonthly",+ "SubscriptionName20KYearly"+ ]+ },+ "entities.User": {+ "type": "object",+ "required": [+ "active_phone_id",+ "api_key",+ "created_at",+ "email",+ "id",+ "notification_heartbeat_enabled",+ "notification_message_status_enabled",+ "notification_webhook_enabled",+ "subscription_ends_at",+ "subscription_id",+ "subscription_name",+ "subscription_renews_at",+ "subscription_status",+ "timezone",+ "updated_at"+ ],+ "properties": {+ "active_phone_id": {+ "type": "string",+ "example": "32343a19-da5e-4b1b-a767-3298a73703cb"+ },+ "api_key": {+ "type": "string",+ "example": "xyz"+ },+ "created_at": {+ "type": "string",+ "example": "2022-06-05T14:26:02.302718+03:00"+ },+ "email": {+ "type": "string",+ "example": "[email protected]"+ },+ "id": {+ "type": "string",+ "example": "WB7DRDWrJZRGbYrv2CKGkqbzvqdC"+ },+ "notification_heartbeat_enabled": {+ "type": "boolean",+ "example": true+ },+ "notification_message_status_enabled": {+ "type": "boolean",+ "example": true+ },+ "notification_webhook_enabled": {+ "type": "boolean",+ "example": true+ },+ "subscription_ends_at": {+ "type": "string",+ "example": "2022-06-05T14:26:02.302718+03:00"+ },+ "subscription_id": {+ "type": "string",+ "example": "8f9c71b8-b84e-4417-8408-a62274f65a08"+ },+ "subscription_name": {+ "allOf": [+ {+ "$ref": "#/definitions/entities.SubscriptionName"+ }+ ],+ "example": "free"+ },+ "subscription_renews_at": {+ "type": "string",+ "example": "2022-06-05T14:26:02.302718+03:00"+ },+ "subscription_status": {+ "type": "string",+ "example": "on_trial"+ },+ "timezone": {+ "type": "string",+ "example": "Europe/Helsinki"+ },+ "updated_at": {+ "type": "string",+ "example": "2022-06-05T14:26:10.303278+03:00"+ }+ }+ },+ "entities.Webhook": {+ "type": "object",+ "required": [+ "created_at",+ "events",+ "id",+ "phone_numbers",+ "signing_key",+ "updated_at",+ "url",+ "user_id"+ ],+ "properties": {+ "created_at": {+ "type": "string",+ "example": "2022-06-05T14:26:02.302718+03:00"+ },+ "events": {+ "type": "array",+ "items": {+ "type": "string"+ },+ "example": [+ "[message.phone.received]"+ ]+ },+ "id": {+ "type": "string",+ "example": "32343a19-da5e-4b1b-a767-3298a73703cb"+ },+ "phone_numbers": {+ "type": "array",+ "items": {+ "type": "string"+ },+ "example": [+ "[+18005550199",+ "+18005550100]"+ ]+ },+ "signing_key": {+ "type": "string",+ "example": "DGW8NwQp7mxKaSZ72Xq9v67SLqSbWQvckzzmK8D6rvd7NywSEkdMJtuxKyEkYnCY"+ },+ "updated_at": {+ "type": "string",+ "example": "2022-06-05T14:26:10.303278+03:00"+ },+ "url": {+ "type": "string",+ "example": "https://example.com"+ },+ "user_id": {+ "type": "string",+ "example": "WB7DRDWrJZRGbYrv2CKGkqbzvqdC"+ }+ }+ },+ "requests.DiscordStore": {+ "type": "object",+ "required": [+ "incoming_channel_id",+ "name",+ "server_id"+ ],+ "properties": {+ "incoming_channel_id": {+ "type": "string"+ },+ "name": {+ "type": "string"+ },+ "server_id": {+ "type": "string"+ }+ }+ },+ "requests.DiscordUpdate": {+ "type": "object",+ "required": [+ "incoming_channel_id",+ "name",+ "server_id"+ ],+ "properties": {+ "incoming_channel_id": {+ "type": "string"+ },+ "name": {+ "type": "string"+ },+ "server_id": {+ "type": "string"+ }+ }+ },+ "requests.HeartbeatStore": {+ "type": "object",+ "required": [+ "charging",+ "owner"+ ],+ "properties": {+ "charging": {+ "type": "boolean"+ },+ "owner": {+ "type": "string"+ }+ }+ },+ "requests.MessageBulkSend": {+ "type": "object",+ "required": [+ "content",+ "from",+ "to"+ ],+ "properties": {+ "content": {+ "type": "string",+ "example": "This is a sample text message"+ },+ "from": {+ "type": "string",+ "example": "+18005550199"+ },+ "request_id": {+ "description": "RequestID is an optional parameter used to track a request from the client's perspective",+ "type": "string",+ "example": "153554b5-ae44-44a0-8f4f-7bbac5657ad4"+ },+ "to": {+ "type": "array",+ "items": {+ "type": "string"+ },+ "example": [+ "+18005550100",+ "+18005550100"+ ]+ }+ }+ },+ "requests.MessageEvent": {+ "type": "object",+ "required": [+ "event_name",+ "reason",+ "timestamp"+ ],+ "properties": {+ "event_name": {+ "description": "EventName is the type of event\n* SENT: is emitted when a message is sent by the mobile phone\n* FAILED: is event is emitted when the message could not be sent by the mobile phone\n* DELIVERED: is event is emitted when a delivery report has been received by the mobile phone",+ "type": "string",+ "example": "SENT"+ },+ "reason": {+ "description": "Reason is the exact error message in case the event is an error",+ "type": "string"+ },+ "timestamp": {+ "description": "Timestamp is the time when the event was emitted, Please send the timestamp in UTC with as much precision as possible",+ "type": "string",+ "example": "2022-06-05T14:26:09.527976+03:00"+ }+ }+ },+ "requests.MessageReceive": {+ "type": "object",+ "required": [+ "content",+ "from",+ "sim",+ "timestamp",+ "to"+ ],+ "properties": {+ "content": {+ "type": "string",+ "example": "This is a sample text message received on a phone"+ },+ "from": {+ "type": "string",+ "example": "+18005550199"+ },+ "sim": {+ "description": "SIM card that received the message",+ "allOf": [+ {+ "$ref": "#/definitions/entities.SIM"+ }+ ],+ "example": "SIM1"+ },+ "timestamp": {+ "description": "Timestamp is the time when the event was emitted, Please send the timestamp in UTC with as much precision as possible",+ "type": "string",+ "example": "2022-06-05T14:26:09.527976+03:00"+ },+ "to": {+ "type": "string",+ "example": "+18005550100"+ }+ }+ },+ "requests.MessageSend": {+ "type": "object",+ "required": [+ "content",+ "from",+ "to"+ ],+ "properties": {+ "content": {+ "type": "string",+ "example": "This is a sample text message"+ },+ "from": {+ "type": "string",+ "example": "+18005550199"+ },+ "request_id": {+ "description": "RequestID is an optional parameter used to track a request from the client's perspective",+ "type": "string",+ "example": "153554b5-ae44-44a0-8f4f-7bbac5657ad4"+ },+ "to": {+ "type": "string",+ "example": "+18005550100"+ }+ }+ },+ "requests.MessageThreadUpdate": {+ "type": "object",+ "required": [+ "is_archived"+ ],+ "properties": {+ "is_archived": {+ "type": "boolean",+ "example": true+ }+ }+ },+ "requests.PhoneUpsert": {+ "type": "object",+ "required": [+ "fcm_token",+ "max_send_attempts",+ "message_expiration_seconds",+ "messages_per_minute",+ "phone_number",+ "sim"+ ],+ "properties": {+ "fcm_token": {+ "type": "string",+ "example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzd....."+ },+ "max_send_attempts": {+ "description": "MaxSendAttempts is the number of attempts when sending an SMS message to handle the case where the phone is offline.",+ "type": "integer",+ "example": 2+ },+ "message_expiration_seconds": {+ "description": "MessageExpirationSeconds is the duration in seconds after sending a message when it is considered to be expired.",+ "type": "integer",+ "example": 12345+ },+ "messages_per_minute": {+ "type": "integer",+ "example": 1+ },+ "phone_number": {+ "type": "string",+ "example": "+18005550199"+ },+ "sim": {+ "description": "SIM is the SIM slot of the phone in case the phone has more than 1 SIM slot",+ "type": "string",+ "example": "SIM1"+ }+ }+ },+ "requests.UserNotificationUpdate": {+ "type": "object",+ "required": [+ "heartbeat_enabled",+ "message_status_enabled",+ "webhook_enabled"+ ],+ "properties": {+ "heartbeat_enabled": {+ "type": "boolean",+ "example": true+ },+ "message_status_enabled": {+ "type": "boolean",+ "example": true+ },+ "webhook_enabled": {+ "type": "boolean",+ "example": true+ }+ }+ },+ "requests.UserUpdate": {+ "type": "object",+ "required": [+ "active_phone_id",+ "timezone"+ ],+ "properties": {+ "active_phone_id": {+ "type": "string",+ "example": "32343a19-da5e-4b1b-a767-3298a73703cb"+ },+ "timezone": {+ "type": "string",+ "example": "Europe/Helsinki"+ }+ }+ },+ "requests.WebhookStore": {+ "type": "object",+ "required": [+ "events",+ "phone_numbers",+ "signing_key",+ "url"+ ],+ "properties": {+ "events": {+ "type": "array",+ "items": {+ "type": "string"+ }+ },+ "phone_numbers": {+ "type": "array",+ "items": {+ "type": "string"+ },+ "example": [+ "+18005550100",+ "+18005550100"+ ]+ },+ "signing_key": {+ "type": "string"+ },+ "url": {+ "type": "string"+ }+ }+ },+ "requests.WebhookUpdate": {+ "type": "object",+ "required": [+ "events",+ "phone_numbers",+ "signing_key",+ "url"+ ],+ "properties": {+ "events": {+ "type": "array",+ "items": {+ "type": "string"+ }+ },+ "phone_numbers": {+ "type": "array",+ "items": {+ "type": "string"+ },+ "example": [+ "+18005550100",+ "+18005550100"+ ]+ },+ "signing_key": {+ "type": "string"+ },+ "url": {+ "type": "string"+ }+ }+ },+ "responses.BadRequest": {+ "type": "object",+ "required": [+ "data",+ "message",+ "status"+ ],+ "properties": {+ "data": {+ "type": "string",+ "example": "The request body is not a valid JSON string"+ },+ "message": {+ "type": "string",+ "example": "The request isn't properly formed"+ },+ "status": {+ "type": "string",+ "example": "error"+ }+ }+ },+ "responses.BillingUsageResponse": {+ "type": "object",+ "required": [+ "data",+ "message",+ "status"+ ],+ "properties": {+ "data": {+ "$ref": "#/definitions/entities.BillingUsage"+ },+ "message": {+ "type": "string",+ "example": "item created successfully"+ },+ "status": {+ "type": "string",+ "example": "success"+ }+ }+ },+ "responses.BillingUsagesResponse": {+ "type": "object",+ "required": [+ "data",+ "message",+ "status"+ ],+ "properties": {+ "data": {+ "type": "array",+ "items": {+ "$ref": "#/definitions/entities.BillingUsage"+ }+ },+ "message": {+ "type": "string",+ "example": "item created successfully"+ },+ "status": {+ "type": "string",+ "example": "success"+ }+ }+ },+ "responses.DiscordResponse": {+ "type": "object",+ "required": [+ "data",+ "message",+ "status"+ ],+ "properties": {+ "data": {+ "$ref": "#/definitions/entities.Discord"+ },+ "message": {+ "type": "string",+ "example": "item created successfully"+ },+ "status": {+ "type": "string",+ "example": "success"+ }+ }+ },+ "responses.DiscordsResponse": {+ "type": "object",+ "required": [+ "data",+ "message",+ "status"+ ],+ "properties": {+ "data": {+ "type": "array",+ "items": {+ "$ref": "#/definitions/entities.Discord"+ }+ },+ "message": {+ "type": "string",+ "example": "item created successfully"+ },+ "status": {+ "type": "string",+ "example": "success"+ }+ }+ },+ "responses.HeartbeatResponse": {+ "type": "object",+ "required": [+ "data",+ "message",+ "status"+ ],+ "properties": {+ "data": {+ "$ref": "#/definitions/entities.Heartbeat"+ },+ "message": {+ "type": "string",+ "example": "item created successfully"+ },+ "status": {+ "type": "string",+ "example": "success"+ }+ }+ },+ "responses.HeartbeatsResponse": {+ "type": "object",+ "required": [+ "data",+ "message",+ "status"+ ],+ "properties": {+ "data": {+ "type": "array",+ "items": {+ "$ref": "#/definitions/entities.Heartbeat"+ }+ },+ "message": {+ "type": "string",+ "example": "item created successfully"+ },+ "status": {+ "type": "string",+ "example": "success"+ }+ }+ },+ "responses.InternalServerError": {+ "type": "object",+ "required": [+ "message",+ "status"+ ],+ "properties": {+ "message": {+ "type": "string",+ "example": "We ran into an internal error while handling the request."+ },+ "status": {+ "type": "string",+ "example": "error"+ }+ }+ },+ "responses.MessageResponse": {+ "type": "object",+ "required": [+ "data",+ "message",+ "status"+ ],+ "properties": {+ "data": {+ "$ref": "#/definitions/entities.Message"+ },+ "message": {+ "type": "string",+ "example": "item created successfully"+ },+ "status": {+ "type": "string",+ "example": "success"+ }+ }+ },+ "responses.MessageThreadsResponse": {+ "type": "object",+ "required": [+ "data",+ "message",+ "status"+ ],+ "properties": {+ "data": {+ "type": "array",+ "items": {+ "$ref": "#/definitions/entities.MessageThread"+ }+ },+ "message": {+ "type": "string",+ "example": "item created successfully"+ },+ "status": {+ "type": "string",+ "example": "success"+ }+ }+ },+ "responses.MessagesResponse": {+ "type": "object",+ "required": [+ "data",+ "message",+ "status"+ ],+ "properties": {+ "data": {+ "type": "array",+ "items": {+ "$ref": "#/definitions/entities.Message"+ }+ },+ "message": {+ "type": "string",+ "example": "item created successfully"+ },+ "status": {+ "type": "string",+ "example": "success"+ }+ }+ },+ "responses.NoContent": {+ "type": "object",+ "required": [+ "message",+ "status"+ ],+ "properties": {+ "message": {+ "type": "string",+ "example": "action performed successfully"+ },+ "status": {+ "type": "string",+ "example": "success"+ }+ }+ },+ "responses.NotFound": {+ "type": "object",+ "required": [+ "message",+ "status"+ ],+ "properties": {+ "message": {+ "type": "string",+ "example": "cannot find message with ID [32343a19-da5e-4b1b-a767-3298a73703ca]"+ },+ "status": {+ "type": "string",+ "example": "error"+ }+ }+ },+ "responses.OkString": {+ "type": "object",+ "required": [+ "data",+ "message",+ "status"+ ],+ "properties": {+ "data": {+ "type": "string"+ },+ "message": {+ "type": "string",+ "example": "Request handled successfully"+ },+ "status": {+ "type": "string",+ "example": "success"+ }+ }+ },+ "responses.PhoneResponse": {+ "type": "object",+ "required": [+ "data",+ "message",+ "status"+ ],+ "properties": {+ "data": {+ "$ref": "#/definitions/entities.Phone"+ },+ "message": {+ "type": "string",+ "example": "item created successfully"+ },+ "status": {+ "type": "string",+ "example": "success"+ }+ }+ },+ "responses.PhonesResponse": {+ "type": "object",+ "required": [+ "data",+ "message",+ "status"+ ],+ "properties": {+ "data": {+ "type": "array",+ "items": {+ "$ref": "#/definitions/entities.Phone"+ }+ },+ "message": {+ "type": "string",+ "example": "item created successfully"+ },+ "status": {+ "type": "string",+ "example": "success"+ }+ }+ },+ "responses.Unauthorized": {+ "type": "object",+ "required": [+ "data",+ "message",+ "status"+ ],+ "properties": {+ "data": {+ "type": "string",+ "example": "Make sure your API key is set in the [X-API-Key] header in the request"+ },+ "message": {+ "type": "string",+ "example": "You are not authorized to carry out this request."+ },+ "status": {+ "type": "string",+ "example": "error"+ }+ }+ },+ "responses.UnprocessableEntity": {+ "type": "object",+ "required": [+ "data",+ "message",+ "status"+ ],+ "properties": {+ "data": {+ "type": "object",+ "additionalProperties": {+ "type": "array",+ "items": {+ "type": "string"+ }+ }+ },+ "message": {+ "type": "string",+ "example": "validation errors while sending message"+ },+ "status": {+ "type": "string",+ "example": "error"+ }+ }+ },+ "responses.UserResponse": {+ "type": "object",+ "required": [+ "data",+ "message",+ "status"+ ],+ "properties": {+ "data": {+ "$ref": "#/definitions/entities.User"+ },+ "message": {+ "type": "string",+ "example": "item created successfully"+ },+ "status": {+ "type": "string",+ "example": "success"+ }+ }+ },+ "responses.WebhookResponse": {+ "type": "object",+ "required": [+ "data",+ "message",+ "status"+ ],+ "properties": {+ "data": {+ "$ref": "#/definitions/entities.Webhook"+ },+ "message": {+ "type": "string",+ "example": "item created successfully"+ },+ "status": {+ "type": "string",+ "example": "success"+ }+ }+ },+ "responses.WebhooksResponse": {+ "type": "object",+ "required": [+ "data",+ "message",+ "status"+ ],+ "properties": {+ "data": {+ "type": "array",+ "items": {+ "$ref": "#/definitions/entities.Webhook"+ }+ },+ "message": {+ "type": "string",+ "example": "item created successfully"+ },+ "status": {+ "type": "string",+ "example": "success"+ }+ }+ }+ },+ "securityDefinitions": {+ "ApiKeyAuth": {+ "type": "apiKey",+ "name": "x-api-Key",+ "in": "header"+ }+ }+}`++// SwaggerInfo holds exported Swagger Info so clients can modify it+var SwaggerInfo = &swag.Spec{+ Version: "1.0",+ Host: "api.httpsms.com",+ BasePath: "/v1",+ Schemes: []string{"https"},+ Title: "HTTP SMS API",+ Description: "API to send SMS messages using android [SmsManager](https://developer.android.com/reference/android/telephony/SmsManager) via HTTP",+ InfoInstanceName: "swagger",+ SwaggerTemplate: docTemplate,+ LeftDelim: "{{",+ RightDelim: "}}",+}++func init() {+ swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)+}diff --git a/api/docs/swagger.json b/api/docs/swagger.jsonnew file mode 100644index 00000000..30900e4d--- /dev/null+++ b/api/docs/swagger.json@@ -0,0 +1,3100 @@+{+ "schemes": ["https"],+ "swagger": "2.0",+ "info": {+ "description": "API to send SMS messages using android [SmsManager](https://developer.android.com/reference/android/telephony/SmsManager) via HTTP",+ "title": "HTTP SMS API",+ "contact": {+ "name": "HTTP SMS",+ "email": "[email protected]"+ },+ "license": {+ "name": "AGPL-3.0",+ "url": "https://raw.githubusercontent.com/NdoleStudio/http-sms-manager/main/LICENSE"+ },+ "version": "1.0"+ },+ "host": "api.httpsms.com",+ "basePath": "/v1",+ "paths": {+ "/billing/usage": {+ "get": {+ "security": [+ {+ "ApiKeyAuth": []+ }+ ],+ "description": "Get the summary of sent and received messages for a user in the current month",+ "consumes": ["application/json"],+ "produces": ["application/json"],+ "tags": ["Billing"],+ "summary": "Get Billing Usage.",+ "responses": {+ "200": {+ "description": "OK",+ "schema": {+ "$ref": "#/definitions/responses.BillingUsageResponse"+ }+ },+ "400": {+ "description": "Bad Request",+ "schema": {+ "$ref": "#/definitions/responses.BadRequest"+ }+ },+ "401": {+ "description": "Unauthorized",+ "schema": {+ "$ref": "#/definitions/responses.Unauthorized"+ }+ },+ "422": {+ "description": "Unprocessable Entity",+ "schema": {+ "$ref": "#/definitions/responses.UnprocessableEntity"+ }+ },+ "500": {+ "description": "Internal Server Error",+ "schema": {+ "$ref": "#/definitions/responses.InternalServerError"+ }+ }+ }+ }+ },+ "/billing/usage-history": {+ "get": {+ "security": [+ {+ "ApiKeyAuth": []+ }+ ],+ "description": "Get billing usage records of sent and received messages for a user in the past. It will be sorted by timestamp in descending order.",+ "consumes": ["application/json"],+ "produces": ["application/json"],+ "tags": ["Billing"],+ "summary": "Get billing usage history.",+ "parameters": [+ {+ "minimum": 0,+ "type": "integer",+ "description": "number of heartbeats to skip",+ "name": "skip",+ "in": "query"+ },+ {+ "maximum": 100,+ "minimum": 1,+ "type": "integer",+ "description": "number of heartbeats to return",+ "name": "limit",+ "in": "query"+ }+ ],+ "responses": {+ "200": {+ "description": "OK",+ "schema": {+ "$ref": "#/definitions/responses.BillingUsagesResponse"+ }+ },+ "400": {+ "description": "Bad Request",+ "schema": {+ "$ref": "#/definitions/responses.BadRequest"+ }+ },+ "401": {+ "description": "Unauthorized",+ "schema": {+ "$ref": "#/definitions/responses.Unauthorized"+ }+ },+ "422": {+ "description": "Unprocessable Entity",+ "schema": {+ "$ref": "#/definitions/responses.UnprocessableEntity"+ }+ },+ "500": {+ "description": "Internal Server Error",+ "schema": {+ "$ref": "#/definitions/responses.InternalServerError"+ }+ }+ }+ }+ },+ "/bulk-messages": {+ "post": {+ "security": [+ {+ "ApiKeyAuth": []+ }+ ],+ "description": "Sends bulk SMS messages to multiple users from a CSV file.",+ "consumes": ["application/json"],+ "produces": ["application/json"],+ "tags": ["BulkSMS"],+ "summary": "Store bulk SMS file",+ "responses": {+ "202": {+ "description": "Accepted",+ "schema": {+ "$ref": "#/definitions/responses.NoContent"+ }+ },+ "400": {+ "description": "Bad Request",+ "schema": {+ "$ref": "#/definitions/responses.BadRequest"+ }+ },+ "401": {+ "description": "Unauthorized",+ "schema": {+ "$ref": "#/definitions/responses.Unauthorized"+ }+ },+ "422": {+ "description": "Unprocessable Entity",+ "schema": {+ "$ref": "#/definitions/responses.UnprocessableEntity"+ }+ },+ "500": {+ "description": "Internal Server Error",+ "schema": {+ "$ref": "#/definitions/responses.InternalServerError"+ }+ }+ }+ }+ },+ "/discord-integrations": {+ "get": {+ "security": [+ {+ "ApiKeyAuth": []+ }+ ],+ "description": "Get the discord integrations of a user",+ "consumes": ["application/json"],+ "produces": ["application/json"],+ "tags": ["DiscordIntegration"],+ "summary": "Get discord integrations of a user",+ "parameters": [+ {+ "minimum": 0,+ "type": "integer",+ "description": "number of discord integrations to skip",+ "name": "skip",+ "in": "query"+ },+ {+ "type": "string",+ "description": "filter discord integrations containing query",+ "name": "query",+ "in": "query"+ },+ {+ "maximum": 20,+ "minimum": 1,+ "type": "integer",+ "description": "number of discord integrations to return",+ "name": "limit",+ "in": "query"+ }+ ],+ "responses": {+ "200": {+ "description": "OK",+ "schema": {+ "$ref": "#/definitions/responses.DiscordsResponse"+ }+ },+ "400": {+ "description": "Bad Request",+ "schema": {+ "$ref": "#/definitions/responses.BadRequest"+ }+ },+ "401": {+ "description": "Unauthorized",+ "schema": {+ "$ref": "#/definitions/responses.Unauthorized"+ }+ },+ "422": {+ "description": "Unprocessable Entity",+ "schema": {+ "$ref": "#/definitions/responses.UnprocessableEntity"+ }+ },+ "500": {+ "description": "Internal Server Error",+ "schema": {+ "$ref": "#/definitions/responses.InternalServerError"+ }+ }+ }+ },+ "post": {+ "security": [+ {+ "ApiKeyAuth": []+ }+ ],+ "description": "Store a discord integration for the authenticated user",+ "consumes": ["application/json"],+ "produces": ["application/json"],+ "tags": ["DiscordIntegration"],+ "summary": "Store discord integration",+ "parameters": [+ {+ "description": "Payload of the discord integration request",+ "name": "payload",+ "in": "body",+ "required": true,+ "schema": {+ "$ref": "#/definitions/requests.DiscordStore"+ }+ }+ ],+ "responses": {+ "201": {+ "description": "Created",+ "schema": {+ "$ref": "#/definitions/responses.DiscordResponse"+ }+ },+ "400": {+ "description": "Bad Request",+ "schema": {+ "$ref": "#/definitions/responses.BadRequest"+ }+ },+ "401": {+ "description": "Unauthorized",+ "schema": {+ "$ref": "#/definitions/responses.Unauthorized"+ }+ },+ "422": {+ "description": "Unprocessable Entity",+ "schema": {+ "$ref": "#/definitions/responses.UnprocessableEntity"+ }+ },+ "500": {+ "description": "Internal Server Error",+ "schema": {+ "$ref": "#/definitions/responses.InternalServerError"+ }+ }+ }+ }+ },+ "/discord-integrations/{discordID}": {+ "put": {+ "security": [+ {+ "ApiKeyAuth": []+ }+ ],+ "description": "Update a discord integration for the currently authenticated user",+ "consumes": ["application/json"],+ "produces": ["application/json"],+ "tags": ["DiscordIntegration"],+ "summary": "Update a discord integration",+ "parameters": [+ {+ "type": "string",+ "default": "32343a19-da5e-4b1b-a767-3298a73703ca",+ "description": "ID of the discord integration",+ "name": "discordID",+ "in": "path",+ "required": true+ },+ {+ "description": "Payload of discord integration to update",+ "name": "payload",+ "in": "body",+ "required": true,+ "schema": {+ "$ref": "#/definitions/requests.DiscordUpdate"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "OK",+ "schema": {+ "$ref": "#/definitions/responses.DiscordResponse"+ }+ },+ "400": {+ "description": "Bad Request",+ "schema": {+ "$ref": "#/definitions/responses.BadRequest"+ }+ },+ "401": {+ "description": "Unauthorized",+ "schema": {+ "$ref": "#/definitions/responses.Unauthorized"+ }+ },+ "422": {+ "description": "Unprocessable Entity",+ "schema": {+ "$ref": "#/definitions/responses.UnprocessableEntity"+ }+ },+ "500": {+ "description": "Internal Server Error",+ "schema": {+ "$ref": "#/definitions/responses.InternalServerError"+ }+ }+ }+ },+ "delete": {+ "security": [+ {+ "ApiKeyAuth": []+ }+ ],+ "description": "Delete a discord integration for a user",+ "consumes": ["application/json"],+ "produces": ["application/json"],+ "tags": ["Webhooks"],+ "summary": "Delete discord integration",+ "parameters": [+ {+ "type": "string",+ "default": "32343a19-da5e-4b1b-a767-3298a73703ca",+ "description": "ID of the discord integration",+ "name": "discordID",+ "in": "path",+ "required": true+ }+ ],+ "responses": {+ "204": {+ "description": "No Content",+ "schema": {+ "$ref": "#/definitions/responses.NoContent"+ }+ },+ "400": {+ "description": "Bad Request",+ "schema": {+ "$ref": "#/definitions/responses.BadRequest"+ }+ },+ "401": {+ "description": "Unauthorized",+ "schema": {+ "$ref": "#/definitions/responses.Unauthorized"+ }+ },+ "422": {+ "description": "Unprocessable Entity",+ "schema": {+ "$ref": "#/definitions/responses.UnprocessableEntity"+ }+ },+ "500": {+ "description": "Internal Server Error",+ "schema": {+ "$ref": "#/definitions/responses.InternalServerError"+ }+ }+ }+ }+ },+ "/discord/event": {+ "post": {+ "description": "Publish a discord event to the registered listeners",+ "consumes": ["application/json"],+ "produces": ["application/json"],+ "tags": ["Discord"],+ "summary": "Consume a discord event",+ "responses": {+ "204": {+ "description": "No Content",+ "schema": {+ "$ref": "#/definitions/responses.NoContent"+ }+ },+ "400": {+ "description": "Bad Request",+ "schema": {+ "$ref": "#/definitions/responses.BadRequest"+ }+ },+ "401": {+ "description": "Unauthorized",+ "schema": {+ "$ref": "#/definitions/responses.Unauthorized"+ }+ },+ "422": {+ "description": "Unprocessable Entity",+ "schema": {+ "$ref": "#/definitions/responses.UnprocessableEntity"+ }+ },+ "500": {+ "description": "Internal Server Error",+ "schema": {+ "$ref": "#/definitions/responses.InternalServerError"+ }+ }+ }+ }+ },+ "/heartbeats": {+ "get": {+ "security": [+ {+ "ApiKeyAuth": []+ }+ ],+ "description": "Get the last time a phone number requested for outstanding messages. It will be sorted by timestamp in descending order.",+ "consumes": ["application/json"],+ "produces": ["application/json"],+ "tags": ["Heartbeats"],+ "summary": "Get heartbeats of an owner phone number",+ "parameters": [+ {+ "type": "string",+ "default": "+18005550199",+ "description": "the owner's phone number",+ "name": "owner",+ "in": "query",+ "required": true+ },+ {+ "minimum": 0,+ "type": "integer",+ "description": "number of heartbeats to skip",+ "name": "skip",+ "in": "query"+ },+ {+ "type": "string",+ "description": "filter containing query",+ "name": "query",+ "in": "query"+ },+ {+ "maximum": 20,+ "minimum": 1,+ "type": "integer",+ "description": "number of heartbeats to return",+ "name": "limit",+ "in": "query"+ }+ ],+ "responses": {+ "200": {+ "description": "OK",+ "schema": {+ "$ref": "#/definitions/responses.HeartbeatsResponse"+ }+ },+ "400": {+ "description": "Bad Request",+ "schema": {+ "$ref": "#/definitions/responses.BadRequest"+ }+ },+ "401": {+ "description": "Unauthorized",+ "schema": {+ "$ref": "#/definitions/responses.Unauthorized"+ }+ },+ "422": {+ "description": "Unprocessable Entity",+ "schema": {+ "$ref": "#/definitions/responses.UnprocessableEntity"+ }+ },+ "500": {+ "description": "Internal Server Error",+ "schema": {+ "$ref": "#/definitions/responses.InternalServerError"+ }+ }+ }+ },+ "post": {+ "security": [+ {+ "ApiKeyAuth": []+ }+ ],+ "description": "Store the heartbeat to make notify that a phone number is still active",+ "consumes": ["application/json"],+ "produces": ["application/json"],+ "tags": ["Heartbeats"],+ "summary": "Register heartbeat of an owner phone number",+ "parameters": [+ {+ "description": "Payload of the heartbeat request",+ "name": "payload",+ "in": "body",+ "required": true,+ "schema": {+ "$ref": "#/definitions/requests.HeartbeatStore"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "OK",+ "schema": {+ "$ref": "#/definitions/responses.HeartbeatResponse"+ }+ },+ "400": {+ "description": "Bad Request",+ "schema": {+ "$ref": "#/definitions/responses.BadRequest"+ }+ },+ "401": {+ "description": "Unauthorized",+ "schema": {+ "$ref": "#/definitions/responses.Unauthorized"+ }+ },+ "422": {+ "description": "Unprocessable Entity",+ "schema": {+ "$ref": "#/definitions/responses.UnprocessableEntity"+ }+ },+ "500": {+ "description": "Internal Server Error",+ "schema": {+ "$ref": "#/definitions/responses.InternalServerError"+ }+ }+ }+ }+ },+ "/integration/3cx/messages": {+ "post": {+ "description": "Sends an SMS message from the 3CX platform",+ "consumes": ["application/json"],+ "produces": ["application/json"],+ "tags": ["3CXIntegration"],+ "summary": "Sends a 3CX SMS message",+ "responses": {+ "204": {+ "description": "No Content",+ "schema": {+ "$ref": "#/definitions/responses.NoContent"+ }+ },+ "400": {+ "description": "Bad Request",+ "schema": {+ "$ref": "#/definitions/responses.BadRequest"+ }+ },+ "401": {+ "description": "Unauthorized",+ "schema": {+ "$ref": "#/definitions/responses.Unauthorized"+ }+ },+ "422": {+ "description": "Unprocessable Entity",+ "schema": {+ "$ref": "#/definitions/responses.UnprocessableEntity"+ }+ },+ "500": {+ "description": "Internal Server Error",+ "schema": {+ "$ref": "#/definitions/responses.InternalServerError"+ }+ }+ }+ }+ },+ "/lemonsqueezy/event": {+ "post": {+ "description": "Publish a lemonsqueezy event to the registered listeners",+ "consumes": ["application/json"],+ "produces": ["application/json"],+ "tags": ["Lemonsqueezy"],+ "summary": "Consume a lemonsqueezy event",+ "responses": {+ "204": {+ "description": "No Content",+ "schema": {+ "$ref": "#/definitions/responses.NoContent"+ }+ },+ "400": {+ "description": "Bad Request",+ "schema": {+ "$ref": "#/definitions/responses.BadRequest"+ }+ },+ "401": {+ "description": "Unauthorized",+ "schema": {+ "$ref": "#/definitions/responses.Unauthorized"+ }+ },+ "422": {+ "description": "Unprocessable Entity",+ "schema": {+ "$ref": "#/definitions/responses.UnprocessableEntity"+ }+ },+ "500": {+ "description": "Internal Server Error",+ "schema": {+ "$ref": "#/definitions/responses.InternalServerError"+ }+ }+ }+ }+ },+ "/message-threads": {+ "get": {+ "security": [+ {+ "ApiKeyAuth": []+ }+ ],+ "description": "Get list of contacts which a phone number has communicated with (threads). It will be sorted by timestamp in descending order.",+ "consumes": ["application/json"],+ "produces": ["application/json"],+ "tags": ["Channel Threads"],+ "summary": "Get message threads for a phone number",+ "parameters": [+ {+ "type": "string",+ "default": "+18005550199",+ "description": "owner phone number",+ "name": "owner",+ "in": "query",+ "required": true+ },+ {+ "minimum": 0,+ "type": "integer",+ "description": "number of messages to skip",+ "name": "skip",+ "in": "query"+ },+ {+ "type": "string",+ "description": "filter message threads containing query",+ "name": "query",+ "in": "query"+ },+ {+ "maximum": 20,+ "minimum": 1,+ "type": "integer",+ "description": "number of messages to return",+ "name": "limit",+ "in": "query"+ }+ ],+ "responses": {+ "200": {+ "description": "OK",+ "schema": {+ "$ref": "#/definitions/responses.MessageThreadsResponse"+ }+ },+ "400": {+ "description": "Bad Request",+ "schema": {+ "$ref": "#/definitions/responses.BadRequest"+ }+ },+ "401": {+ "description": "Unauthorized",+ "schema": {+ "$ref": "#/definitions/responses.Unauthorized"+ }+ },+ "422": {+ "description": "Unprocessable Entity",+ "schema": {+ "$ref": "#/definitions/responses.UnprocessableEntity"+ }+ },+ "500": {+ "description": "Internal Server Error",+ "schema": {+ "$ref": "#/definitions/responses.InternalServerError"+ }+ }+ }+ }+ },+ "/message-threads/{messageThreadID}": {+ "put": {+ "security": [+ {+ "ApiKeyAuth": []+ }+ ],+ "description": "Updates the details of a message thread",+ "consumes": ["application/json"],+ "produces": ["application/json"],+ "tags": ["Channel Threads"],+ "summary": "Update a message thread",+ "parameters": [+ {+ "type": "string",+ "default": "32343a19-da5e-4b1b-a767-3298a73703ca",+ "description": "ID of the message thread",+ "name": "messageThreadID",+ "in": "path",+ "required": true+ },+ {+ "description": "Payload of message thread details to update",+ "name": "payload",+ "in": "body",+ "required": true,+ "schema": {+ "$ref": "#/definitions/requests.MessageThreadUpdate"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "OK",+ "schema": {+ "$ref": "#/definitions/responses.PhoneResponse"+ }+ },+ "400": {+ "description": "Bad Request",+ "schema": {+ "$ref": "#/definitions/responses.BadRequest"+ }+ },+ "401": {+ "description": "Unauthorized",+ "schema": {+ "$ref": "#/definitions/responses.Unauthorized"+ }+ },+ "422": {+ "description": "Unprocessable Entity",+ "schema": {+ "$ref": "#/definitions/responses.UnprocessableEntity"+ }+ },+ "500": {+ "description": "Internal Server Error",+ "schema": {+ "$ref": "#/definitions/responses.InternalServerError"+ }+ }+ }+ }+ },+ "/messages": {+ "get": {+ "security": [+ {+ "ApiKeyAuth": []+ }+ ],+ "description": "Get list of messages which are sent between 2 phone numbers. It will be sorted by timestamp in descending order.",+ "consumes": ["application/json"],+ "produces": ["application/json"],+ "tags": ["Messages"],+ "summary": "Get messages which are sent between 2 phone numbers",+ "parameters": [+ {+ "type": "string",+ "default": "+18005550199",+ "description": "the owner's phone number",+ "name": "owner",+ "in": "query",+ "required": true+ },+ {+ "type": "string",+ "default": "+18005550100",+ "description": "the contact's phone number",+ "name": "contact",+ "in": "query",+ "required": true+ },+ {+ "minimum": 0,+ "type": "integer",+ "description": "number of messages to skip",+ "name": "skip",+ "in": "query"+ },+ {+ "type": "string",+ "description": "filter messages containing query",+ "name": "query",+ "in": "query"+ },+ {+ "maximum": 20,+ "minimum": 1,+ "type": "integer",+ "description": "number of messages to return",+ "name": "limit",+ "in": "query"+ }+ ],+ "responses": {+ "200": {+ "description": "OK",+ "schema": {+ "$ref": "#/definitions/responses.MessagesResponse"+ }+ },+ "400": {+ "description": "Bad Request",+ "schema": {+ "$ref": "#/definitions/responses.BadRequest"+ }+ },+ "401": {+ "description": "Unauthorized",+ "schema": {+ "$ref": "#/definitions/responses.Unauthorized"+ }+ },+ "422": {+ "description": "Unprocessable Entity",+ "schema": {+ "$ref": "#/definitions/responses.UnprocessableEntity"+ }+ },+ "500": {+ "description": "Internal Server Error",+ "schema": {+ "$ref": "#/definitions/responses.InternalServerError"+ }+ }+ }+ }+ },+ "/messages/bulk-send": {+ "post": {+ "security": [+ {+ "ApiKeyAuth": []+ }+ ],+ "description": "Add bulk SMS messages to be sent by the android phone",+ "consumes": ["application/json"],+ "produces": ["application/json"],+ "tags": ["Messages"],+ "summary": "Send bulk SMS messages",+ "parameters": [+ {+ "description": "Bulk send message request payload",+ "name": "payload",+ "in": "body",+ "required": true,+ "schema": {+ "$ref": "#/definitions/requests.MessageBulkSend"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "OK",+ "schema": {+ "type": "array",+ "items": {+ "$ref": "#/definitions/responses.MessagesResponse"+ }+ }+ },+ "400": {+ "description": "Bad Request",+ "schema": {+ "$ref": "#/definitions/responses.BadRequest"+ }+ },+ "401": {+ "description": "Unauthorized",+ "schema": {+ "$ref": "#/definitions/responses.Unauthorized"+ }+ },+ "422": {+ "description": "Unprocessable Entity",+ "schema": {+ "$ref": "#/definitions/responses.UnprocessableEntity"+ }+ },+ "500": {+ "description": "Internal Server Error",+ "schema": {+ "$ref": "#/definitions/responses.InternalServerError"+ }+ }+ }+ }+ },+ "/messages/outstanding": {+ "get": {+ "security": [+ {+ "ApiKeyAuth": []+ }+ ],+ "description": "Get an outstanding message to be sent by an android phone",+ "consumes": ["application/json"],+ "produces": ["application/json"],+ "tags": ["Messages"],+ "summary": "Get an outstanding message",+ "parameters": [+ {+ "type": "string",+ "default": "32343a19-da5e-4b1b-a767-3298a73703cb",+ "description": "The ID of the message",+ "name": "message_id",+ "in": "query",+ "required": true+ }+ ],+ "responses": {+ "200": {+ "description": "OK",+ "schema": {+ "$ref": "#/definitions/responses.MessageResponse"+ }+ },+ "400": {+ "description": "Bad Request",+ "schema": {+ "$ref": "#/definitions/responses.BadRequest"+ }+ },+ "401": {+ "description": "Unauthorized",+ "schema": {+ "$ref": "#/definitions/responses.Unauthorized"+ }+ },+ "422": {+ "description": "Unprocessable Entity",+ "schema": {+ "$ref": "#/definitions/responses.UnprocessableEntity"+ }+ },+ "500": {+ "description": "Internal Server Error",+ "schema": {+ "$ref": "#/definitions/responses.InternalServerError"+ }+ }+ }+ }+ },+ "/messages/receive": {+ "post": {+ "security": [+ {+ "ApiKeyAuth": []+ }+ ],+ "description": "Add a new message received from a mobile phone",+ "consumes": ["application/json"],+ "produces": ["application/json"],+ "tags": ["Messages"],+ "summary": "Receive a new SMS message from a mobile phone",+ "parameters": [+ {+ "description": "Received message request payload",+ "name": "payload",+ "in": "body",+ "required": true,+ "schema": {+ "$ref": "#/definitions/requests.MessageReceive"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "OK",+ "schema": {+ "$ref": "#/definitions/responses.MessageResponse"+ }+ },+ "400": {+ "description": "Bad Request",+ "schema": {+ "$ref": "#/definitions/responses.BadRequest"+ }+ },+ "422": {+ "description": "Unprocessable Entity",+ "schema": {+ "$ref": "#/definitions/responses.UnprocessableEntity"+ }+ },+ "500": {+ "description": "Internal Server Error",+ "schema": {+ "$ref": "#/definitions/responses.InternalServerError"+ }+ }+ }+ }+ },+ "/messages/send": {+ "post": {+ "security": [+ {+ "ApiKeyAuth": []+ }+ ],+ "description": "Add a new SMS message to be sent by the android phone",+ "consumes": ["application/json"],+ "produces": ["application/json"],+ "tags": ["Messages"],+ "summary": "Send a new SMS message",+ "parameters": [+ {+ "description": "PostSend message request payload",+ "name": "payload",+ "in": "body",+ "required": true,+ "schema": {+ "$ref": "#/definitions/requests.MessageSend"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "OK",+ "schema": {+ "$ref": "#/definitions/responses.MessageResponse"+ }+ },+ "400": {+ "description": "Bad Request",+ "schema": {+ "$ref": "#/definitions/responses.BadRequest"+ }+ },+ "401": {+ "description": "Unauthorized",+ "schema": {+ "$ref": "#/definitions/responses.Unauthorized"+ }+ },+ "422": {+ "description": "Unprocessable Entity",+ "schema": {+ "$ref": "#/definitions/responses.UnprocessableEntity"+ }+ },+ "500": {+ "description": "Internal Server Error",+ "schema": {+ "$ref": "#/definitions/responses.InternalServerError"+ }+ }+ }+ }+ },+ "/messages/{messageID}/events": {+ "post": {+ "security": [+ {+ "ApiKeyAuth": []+ }+ ],+ "description": "Use this endpoint to send events for a message when it is failed, sent or delivered by the mobile phone.",+ "consumes": ["application/json"],+ "produces": ["application/json"],+ "tags": ["Messages"],+ "summary": "Upsert an event for a message on the mobile phone",+ "parameters": [+ {+ "type": "string",+ "default": "32343a19-da5e-4b1b-a767-3298a73703ca",+ "description": "ID of the message",+ "name": "messageID",+ "in": "path",+ "required": true+ },+ {+ "description": "Payload of the event emitted.",+ "name": "payload",+ "in": "body",+ "required": true,+ "schema": {+ "$ref": "#/definitions/requests.MessageEvent"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "OK",+ "schema": {+ "$ref": "#/definitions/responses.MessageResponse"+ }+ },+ "400": {+ "description": "Bad Request",+ "schema": {+ "$ref": "#/definitions/responses.BadRequest"+ }+ },+ "401": {+ "description": "Unauthorized",+ "schema": {+ "$ref": "#/definitions/responses.Unauthorized"+ }+ },+ "404": {+ "description": "Not Found",+ "schema": {+ "$ref": "#/definitions/responses.NotFound"+ }+ },+ "422": {+ "description": "Unprocessable Entity",+ "schema": {+ "$ref": "#/definitions/responses.UnprocessableEntity"+ }+ },+ "500": {+ "description": "Internal Server Error",+ "schema": {+ "$ref": "#/definitions/responses.InternalServerError"+ }+ }+ }+ }+ },+ "/phones": {+ "get": {+ "security": [+ {+ "ApiKeyAuth": []+ }+ ],+ "description": "Get list of phones which a user has registered on the http sms application",+ "consumes": ["application/json"],+ "produces": ["application/json"],+ "tags": ["Phones"],+ "summary": "Get phones of a user",+ "parameters": [+ {+ "minimum": 0,+ "type": "integer",+ "description": "number of heartbeats to skip",+ "name": "skip",+ "in": "query"+ },+ {+ "type": "string",+ "description": "filter phones containing query",+ "name": "query",+ "in": "query"+ },+ {+ "maximum": 20,+ "minimum": 1,+ "type": "integer",+ "description": "number of phones to return",+ "name": "limit",+ "in": "query"+ }+ ],+ "responses": {+ "200": {+ "description": "OK",+ "schema": {+ "$ref": "#/definitions/responses.PhonesResponse"+ }+ },+ "400": {+ "description": "Bad Request",+ "schema": {+ "$ref": "#/definitions/responses.BadRequest"+ }+ },+ "401": {+ "description": "Unauthorized",+ "schema": {+ "$ref": "#/definitions/responses.Unauthorized"+ }+ },+ "422": {+ "description": "Unprocessable Entity",+ "schema": {+ "$ref": "#/definitions/responses.UnprocessableEntity"+ }+ },+ "500": {+ "description": "Internal Server Error",+ "schema": {+ "$ref": "#/definitions/responses.InternalServerError"+ }+ }+ }+ },+ "put": {+ "security": [+ {+ "ApiKeyAuth": []+ }+ ],+ "description": "Updates properties of a user's phone. If the phone with this number does not exist, a new one will be created. Think of this method like an 'upsert'",+ "consumes": ["application/json"],+ "produces": ["application/json"],+ "tags": ["Phones"],+ "summary": "Upsert Phone",+ "parameters": [+ {+ "description": "Payload of new phone number.",+ "name": "payload",+ "in": "body",+ "required": true,+ "schema": {+ "$ref": "#/definitions/requests.PhoneUpsert"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "OK",+ "schema": {+ "$ref": "#/definitions/responses.PhoneResponse"+ }+ },+ "400": {+ "description": "Bad Request",+ "schema": {+ "$ref": "#/definitions/responses.BadRequest"+ }+ },+ "401": {+ "description": "Unauthorized",+ "schema": {+ "$ref": "#/definitions/responses.Unauthorized"+ }+ },+ "422": {+ "description": "Unprocessable Entity",+ "schema": {+ "$ref": "#/definitions/responses.UnprocessableEntity"+ }+ },+ "500": {+ "description": "Internal Server Error",+ "schema": {+ "$ref": "#/definitions/responses.InternalServerError"+ }+ }+ }+ }+ },+ "/phones/{phoneID}": {+ "delete": {+ "security": [+ {+ "ApiKeyAuth": []+ }+ ],+ "description": "Delete a phone that has been sored in the database",+ "consumes": ["application/json"],+ "produces": ["application/json"],+ "tags": ["Phones"],+ "summary": "Delete Phone",+ "parameters": [+ {+ "type": "string",+ "default": "32343a19-da5e-4b1b-a767-3298a73703ca",+ "description": "ID of the phone",+ "name": "phoneID",+ "in": "path",+ "required": true+ }+ ],+ "responses": {+ "204": {+ "description": "No Content",+ "schema": {+ "$ref": "#/definitions/responses.NoContent"+ }+ },+ "400": {+ "description": "Bad Request",+ "schema": {+ "$ref": "#/definitions/responses.BadRequest"+ }+ },+ "401": {+ "description": "Unauthorized",+ "schema": {+ "$ref": "#/definitions/responses.Unauthorized"+ }+ },+ "422": {+ "description": "Unprocessable Entity",+ "schema": {+ "$ref": "#/definitions/responses.UnprocessableEntity"+ }+ },+ "500": {+ "description": "Internal Server Error",+ "schema": {+ "$ref": "#/definitions/responses.InternalServerError"+ }+ }+ }+ }+ },+ "/users/me": {+ "get": {+ "security": [+ {+ "ApiKeyAuth": []+ }+ ],+ "description": "Get details of the currently authenticated user",+ "consumes": ["application/json"],+ "produces": ["application/json"],+ "tags": ["Users"],+ "summary": "Get current user",+ "responses": {+ "200": {+ "description": "OK",+ "schema": {+ "$ref": "#/definitions/responses.UserResponse"+ }+ },+ "400": {+ "description": "Bad Request",+ "schema": {+ "$ref": "#/definitions/responses.BadRequest"+ }+ },+ "401": {+ "description": "Unauthorized",+ "schema": {+ "$ref": "#/definitions/responses.Unauthorized"+ }+ },+ "422": {+ "description": "Unprocessable Entity",+ "schema": {+ "$ref": "#/definitions/responses.UnprocessableEntity"+ }+ },+ "500": {+ "description": "Internal Server Error",+ "schema": {+ "$ref": "#/definitions/responses.InternalServerError"+ }+ }+ }+ },+ "put": {+ "security": [+ {+ "ApiKeyAuth": []+ }+ ],+ "description": "Updates the details of the currently authenticated user",+ "consumes": ["application/json"],+ "produces": ["application/json"],+ "tags": ["Users"],+ "summary": "Update a user",+ "parameters": [+ {+ "description": "Payload of user details to update",+ "name": "payload",+ "in": "body",+ "required": true,+ "schema": {+ "$ref": "#/definitions/requests.UserUpdate"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "OK",+ "schema": {+ "$ref": "#/definitions/responses.PhoneResponse"+ }+ },+ "400": {+ "description": "Bad Request",+ "schema": {+ "$ref": "#/definitions/responses.BadRequest"+ }+ },+ "401": {+ "description": "Unauthorized",+ "schema": {+ "$ref": "#/definitions/responses.Unauthorized"+ }+ },+ "422": {+ "description": "Unprocessable Entity",+ "schema": {+ "$ref": "#/definitions/responses.UnprocessableEntity"+ }+ },+ "500": {+ "description": "Internal Server Error",+ "schema": {+ "$ref": "#/definitions/responses.InternalServerError"+ }+ }+ }+ }+ },+ "/users/subscription": {+ "delete": {+ "security": [+ {+ "ApiKeyAuth": []+ }+ ],+ "description": "Cancel the subscription of the authenticated user.",+ "produces": ["application/json"],+ "tags": ["Users"],+ "summary": "Cancel the user's subscription",+ "responses": {+ "200": {+ "description": "OK",+ "schema": {+ "$ref": "#/definitions/responses.NoContent"+ }+ },+ "400": {+ "description": "Bad Request",+ "schema": {+ "$ref": "#/definitions/responses.BadRequest"+ }+ },+ "401": {+ "description": "Unauthorized",+ "schema": {+ "$ref": "#/definitions/responses.Unauthorized"+ }+ },+ "422": {+ "description": "Unprocessable Entity",+ "schema": {+ "$ref": "#/definitions/responses.UnprocessableEntity"+ }+ },+ "500": {+ "description": "Internal Server Error",+ "schema": {+ "$ref": "#/definitions/responses.InternalServerError"+ }+ }+ }+ }+ },+ "/users/subscription-update-url": {+ "get": {+ "security": [+ {+ "ApiKeyAuth": []+ }+ ],+ "description": "Fetches the subscription URL of the authenticated user.",+ "produces": ["application/json"],+ "tags": ["Users"],+ "summary": "Currently authenticated user subscription update URL",+ "responses": {+ "200": {+ "description": "OK",+ "schema": {+ "$ref": "#/definitions/responses.OkString"+ }+ },+ "400": {+ "description": "Bad Request",+ "schema": {+ "$ref": "#/definitions/responses.BadRequest"+ }+ },+ "401": {+ "description": "Unauthorized",+ "schema": {+ "$ref": "#/definitions/responses.Unauthorized"+ }+ },+ "422": {+ "description": "Unprocessable Entity",+ "schema": {+ "$ref": "#/definitions/responses.UnprocessableEntity"+ }+ },+ "500": {+ "description": "Internal Server Error",+ "schema": {+ "$ref": "#/definitions/responses.InternalServerError"+ }+ }+ }+ }+ },+ "/users/{userID}/notifications": {+ "put": {+ "security": [+ {+ "ApiKeyAuth": []+ }+ ],+ "description": "Update the email notification settings for a user",+ "consumes": ["application/json"],+ "produces": ["application/json"],+ "tags": ["Users"],+ "summary": "Update notification settings",+ "parameters": [+ {+ "type": "string",+ "default": "32343a19-da5e-4b1b-a767-3298a73703ca",+ "description": "ID of the user to update",+ "name": "userID",+ "in": "path",+ "required": true+ },+ {+ "description": "User notification details to update",+ "name": "payload",+ "in": "body",+ "required": true,+ "schema": {+ "$ref": "#/definitions/requests.UserNotificationUpdate"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "OK",+ "schema": {+ "$ref": "#/definitions/responses.UserResponse"+ }+ },+ "400": {+ "description": "Bad Request",+ "schema": {+ "$ref": "#/definitions/responses.BadRequest"+ }+ },+ "401": {+ "description": "Unauthorized",+ "schema": {+ "$ref": "#/definitions/responses.Unauthorized"+ }+ },+ "422": {+ "description": "Unprocessable Entity",+ "schema": {+ "$ref": "#/definitions/responses.UnprocessableEntity"+ }+ },+ "500": {+ "description": "Internal Server Error",+ "schema": {+ "$ref": "#/definitions/responses.InternalServerError"+ }+ }+ }+ }+ },+ "/webhooks": {+ "get": {+ "security": [+ {+ "ApiKeyAuth": []+ }+ ],+ "description": "Get the webhooks of a user",+ "consumes": ["application/json"],+ "produces": ["application/json"],+ "tags": ["Webhooks"],+ "summary": "Get webhooks of a user",+ "parameters": [+ {+ "minimum": 0,+ "type": "integer",+ "description": "number of webhooks to skip",+ "name": "skip",+ "in": "query"+ },+ {+ "type": "string",+ "description": "filter webhooks containing query",+ "name": "query",+ "in": "query"+ },+ {+ "maximum": 20,+ "minimum": 1,+ "type": "integer",+ "description": "number of webhooks to return",+ "name": "limit",+ "in": "query"+ }+ ],+ "responses": {+ "200": {+ "description": "OK",+ "schema": {+ "$ref": "#/definitions/responses.WebhooksResponse"+ }+ },+ "400": {+ "description": "Bad Request",+ "schema": {+ "$ref": "#/definitions/responses.BadRequest"+ }+ },+ "401": {+ "description": "Unauthorized",+ "schema": {+ "$ref": "#/definitions/responses.Unauthorized"+ }+ },+ "422": {+ "description": "Unprocessable Entity",+ "schema": {+ "$ref": "#/definitions/responses.UnprocessableEntity"+ }+ },+ "500": {+ "description": "Internal Server Error",+ "schema": {+ "$ref": "#/definitions/responses.InternalServerError"+ }+ }+ }+ },+ "post": {+ "security": [+ {+ "ApiKeyAuth": []+ }+ ],+ "description": "Store a webhook for the authenticated user",+ "consumes": ["application/json"],+ "produces": ["application/json"],+ "tags": ["Webhooks"],+ "summary": "Store a webhook",+ "parameters": [+ {+ "description": "Payload of the webhook request",+ "name": "payload",+ "in": "body",+ "required": true,+ "schema": {+ "$ref": "#/definitions/requests.WebhookStore"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "OK",+ "schema": {+ "$ref": "#/definitions/responses.WebhookResponse"+ }+ },+ "400": {+ "description": "Bad Request",+ "schema": {+ "$ref": "#/definitions/responses.BadRequest"+ }+ },+ "401": {+ "description": "Unauthorized",+ "schema": {+ "$ref": "#/definitions/responses.Unauthorized"+ }+ },+ "422": {+ "description": "Unprocessable Entity",+ "schema": {+ "$ref": "#/definitions/responses.UnprocessableEntity"+ }+ },+ "500": {+ "description": "Internal Server Error",+ "schema": {+ "$ref": "#/definitions/responses.InternalServerError"+ }+ }+ }+ }+ },+ "/webhooks/{webhookID}": {+ "put": {+ "security": [+ {+ "ApiKeyAuth": []+ }+ ],+ "description": "Update a webhook for the currently authenticated user",+ "consumes": ["application/json"],+ "produces": ["application/json"],+ "tags": ["Webhooks"],+ "summary": "Update a webhook",+ "parameters": [+ {+ "type": "string",+ "default": "32343a19-da5e-4b1b-a767-3298a73703ca",+ "description": "ID of the webhook",+ "name": "webhookID",+ "in": "path",+ "required": true+ },+ {+ "description": "Payload of webhook details to update",+ "name": "payload",+ "in": "body",+ "required": true,+ "schema": {+ "$ref": "#/definitions/requests.WebhookUpdate"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "OK",+ "schema": {+ "$ref": "#/definitions/responses.WebhookResponse"+ }+ },+ "400": {+ "description": "Bad Request",+ "schema": {+ "$ref": "#/definitions/responses.BadRequest"+ }+ },+ "401": {+ "description": "Unauthorized",+ "schema": {+ "$ref": "#/definitions/responses.Unauthorized"+ }+ },+ "422": {+ "description": "Unprocessable Entity",+ "schema": {+ "$ref": "#/definitions/responses.UnprocessableEntity"+ }+ },+ "500": {+ "description": "Internal Server Error",+ "schema": {+ "$ref": "#/definitions/responses.InternalServerError"+ }+ }+ }+ },+ "delete": {+ "security": [+ {+ "ApiKeyAuth": []+ }+ ],+ "description": "Delete a webhook for a user",+ "consumes": ["application/json"],+ "produces": ["application/json"],+ "tags": ["Webhooks"],+ "summary": "Delete webhook",+ "parameters": [+ {+ "type": "string",+ "default": "32343a19-da5e-4b1b-a767-3298a73703ca",+ "description": "ID of the webhook",+ "name": "webhookID",+ "in": "path",+ "required": true+ }+ ],+ "responses": {+ "204": {+ "description": "No Content",+ "schema": {+ "$ref": "#/definitions/responses.NoContent"+ }+ },+ "400": {+ "description": "Bad Request",+ "schema": {+ "$ref": "#/definitions/responses.BadRequest"+ }+ },+ "401": {+ "description": "Unauthorized",+ "schema": {+ "$ref": "#/definitions/responses.Unauthorized"+ }+ },+ "422": {+ "description": "Unprocessable Entity",+ "schema": {+ "$ref": "#/definitions/responses.UnprocessableEntity"+ }+ },+ "500": {+ "description": "Internal Server Error",+ "schema": {+ "$ref": "#/definitions/responses.InternalServerError"+ }+ }+ }+ }+ }+ },+ "definitions": {+ "entities.BillingUsage": {+ "type": "object",+ "required": [+ "created_at",+ "end_timestamp",+ "id",+ "received_messages",+ "sent_messages",+ "start_timestamp",+ "total_cost",+ "updated_at",+ "user_id"+ ],+ "properties": {+ "created_at": {+ "type": "string",+ "example": "2022-06-05T14:26:02.302718+03:00"+ },+ "end_timestamp": {+ "type": "string",+ "example": "2022-01-31T23:59:59+00:00"+ },+ "id": {+ "type": "string",+ "example": "32343a19-da5e-4b1b-a767-3298a73703cb"+ },+ "received_messages": {+ "type": "integer",+ "example": 465+ },+ "sent_messages": {+ "type": "integer",+ "example": 321+ },+ "start_timestamp": {+ "type": "string",+ "example": "2022-01-01T00:00:00+00:00"+ },+ "total_cost": {+ "type": "integer",+ "example": 0+ },+ "updated_at": {+ "type": "string",+ "example": "2022-06-05T14:26:10.303278+03:00"+ },+ "user_id": {+ "type": "string",+ "example": "WB7DRDWrJZRGbYrv2CKGkqbzvqdC"+ }+ }+ },+ "entities.Discord": {+ "type": "object",+ "required": [+ "created_at",+ "id",+ "incoming_channel_id",+ "name",+ "server_id",+ "updated_at",+ "user_id"+ ],+ "properties": {+ "created_at": {+ "type": "string",+ "example": "2022-06-05T14:26:02.302718+03:00"+ },+ "id": {+ "type": "string",+ "example": "32343a19-da5e-4b1b-a767-3298a73703cb"+ },+ "incoming_channel_id": {+ "type": "string",+ "example": "1095780203256627291"+ },+ "name": {+ "type": "string",+ "example": "Game Server"+ },+ "server_id": {+ "type": "string",+ "example": "1095778291488653372"+ },+ "updated_at": {+ "type": "string",+ "example": "2022-06-05T14:26:10.303278+03:00"+ },+ "user_id": {+ "type": "string",+ "example": "WB7DRDWrJZRGbYrv2CKGkqbzvqdC"+ }+ }+ },+ "entities.Heartbeat": {+ "type": "object",+ "required": [+ "charging",+ "id",+ "owner",+ "timestamp",+ "user_id",+ "version"+ ],+ "properties": {+ "charging": {+ "type": "boolean",+ "example": true+ },+ "id": {+ "type": "string",+ "example": "32343a19-da5e-4b1b-a767-3298a73703cb"+ },+ "owner": {+ "type": "string",+ "example": "+18005550199"+ },+ "timestamp": {+ "type": "string",+ "example": "2022-06-05T14:26:01.520828+03:00"+ },+ "user_id": {+ "type": "string",+ "example": "WB7DRDWrJZRGbYrv2CKGkqbzvqdC"+ },+ "version": {+ "type": "string",+ "example": "344c10f"+ }+ }+ },+ "entities.Message": {+ "type": "object",+ "required": [+ "can_be_polled",+ "contact",+ "content",+ "created_at",+ "delivered_at",+ "expired_at",+ "failed_at",+ "failure_reason",+ "id",+ "last_attempted_at",+ "max_send_attempts",+ "order_timestamp",+ "owner",+ "received_at",+ "request_id",+ "request_received_at",+ "scheduled_at",+ "send_attempt_count",+ "send_time",+ "sent_at",+ "sim",+ "status",+ "type",+ "updated_at",+ "user_id"+ ],+ "properties": {+ "can_be_polled": {+ "type": "boolean",+ "example": false+ },+ "contact": {+ "type": "string",+ "example": "+18005550100"+ },+ "content": {+ "type": "string",+ "example": "This is a sample text message"+ },+ "created_at": {+ "type": "string",+ "example": "2022-06-05T14:26:02.302718+03:00"+ },+ "delivered_at": {+ "type": "string",+ "example": "2022-06-05T14:26:09.527976+03:00"+ },+ "expired_at": {+ "type": "string",+ "example": "2022-06-05T14:26:09.527976+03:00"+ },+ "failed_at": {+ "type": "string",+ "example": "2022-06-05T14:26:09.527976+03:00"+ },+ "failure_reason": {+ "type": "string",+ "example": "UNKNOWN"+ },+ "id": {+ "type": "string",+ "example": "32343a19-da5e-4b1b-a767-3298a73703cb"+ },+ "last_attempted_at": {+ "type": "string",+ "example": "2022-06-05T14:26:09.527976+03:00"+ },+ "max_send_attempts": {+ "type": "integer",+ "example": 1+ },+ "order_timestamp": {+ "type": "string",+ "example": "2022-06-05T14:26:09.527976+03:00"+ },+ "owner": {+ "type": "string",+ "example": "+18005550199"+ },+ "received_at": {+ "type": "string",+ "example": "2022-06-05T14:26:09.527976+03:00"+ },+ "request_id": {+ "type": "string",+ "example": "153554b5-ae44-44a0-8f4f-7bbac5657ad4"+ },+ "request_received_at": {+ "type": "string",+ "example": "2022-06-05T14:26:01.520828+03:00"+ },+ "scheduled_at": {+ "type": "string",+ "example": "2022-06-05T14:26:09.527976+03:00"+ },+ "send_attempt_count": {+ "type": "integer",+ "example": 0+ },+ "send_time": {+ "description": "SendDuration is the number of nanoseconds from when the request was received until when the mobile phone send the message",+ "type": "integer",+ "example": 133414+ },+ "sent_at": {+ "type": "string",+ "example": "2022-06-05T14:26:09.527976+03:00"+ },+ "sim": {+ "description": "SIM is the SIM card to use to send the message\n* SMS1: use the SIM card in slot 1\n* SMS2: use the SIM card in slot 2\n* DEFAULT: used the default communication SIM card",+ "allOf": [+ {+ "$ref": "#/definitions/entities.SIM"+ }+ ],+ "example": "DEFAULT"+ },+ "status": {+ "type": "string",+ "example": "pending"+ },+ "type": {+ "type": "string",+ "example": "mobile-terminated"+ },+ "updated_at": {+ "type": "string",+ "example": "2022-06-05T14:26:10.303278+03:00"+ },+ "user_id": {+ "type": "string",+ "example": "WB7DRDWrJZRGbYrv2CKGkqbzvqdC"+ }+ }+ },+ "entities.MessageThread": {+ "type": "object",+ "required": [+ "color",+ "contact",+ "created_at",+ "id",+ "is_archived",+ "last_message_content",+ "last_message_id",+ "order_timestamp",+ "owner",+ "status",+ "updated_at",+ "user_id"+ ],+ "properties": {+ "color": {+ "type": "string",+ "example": "indigo"+ },+ "contact": {+ "type": "string",+ "example": "+18005550100"+ },+ "created_at": {+ "type": "string",+ "example": "2022-06-05T14:26:09.527976+03:00"+ },+ "id": {+ "type": "string",+ "example": "32343a19-da5e-4b1b-a767-3298a73703ca"+ },+ "is_archived": {+ "type": "boolean",+ "example": false+ },+ "last_message_content": {+ "type": "string",+ "example": "This is a sample message content"+ },+ "last_message_id": {+ "type": "string",+ "example": "32343a19-da5e-4b1b-a767-3298a73703ca"+ },+ "order_timestamp": {+ "type": "string",+ "example": "2022-06-05T14:26:09.527976+03:00"+ },+ "owner": {+ "type": "string",+ "example": "+18005550199"+ },+ "status": {+ "type": "string",+ "example": "PENDING"+ },+ "updated_at": {+ "type": "string",+ "example": "2022-06-05T14:26:09.527976+03:00"+ },+ "user_id": {+ "type": "string",+ "example": "WB7DRDWrJZRGbYrv2CKGkqbzvqdC"+ }+ }+ },+ "entities.Phone": {+ "type": "object",+ "required": [+ "created_at",+ "fcm_token",+ "id",+ "max_send_attempts",+ "message_expiration_seconds",+ "messages_per_minute",+ "phone_number",+ "sim",+ "updated_at",+ "user_id"+ ],+ "properties": {+ "created_at": {+ "type": "string",+ "example": "2022-06-05T14:26:02.302718+03:00"+ },+ "fcm_token": {+ "type": "string",+ "example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzd....."+ },+ "id": {+ "type": "string",+ "example": "32343a19-da5e-4b1b-a767-3298a73703cb"+ },+ "max_send_attempts": {+ "description": "MaxSendAttempts determines how many times to retry sending an SMS message",+ "type": "integer",+ "example": 2+ },+ "message_expiration_seconds": {+ "description": "MessageExpirationSeconds is the duration in seconds after sending a message when it is considered to be expired.",+ "type": "integer"+ },+ "messages_per_minute": {+ "type": "integer",+ "example": 1+ },+ "phone_number": {+ "type": "string",+ "example": "+18005550199"+ },+ "sim": {+ "$ref": "#/definitions/entities.SIM"+ },+ "updated_at": {+ "type": "string",+ "example": "2022-06-05T14:26:10.303278+03:00"+ },+ "user_id": {+ "type": "string",+ "example": "WB7DRDWrJZRGbYrv2CKGkqbzvqdC"+ }+ }+ },+ "entities.SIM": {+ "type": "string",+ "enum": ["SIM1", "SIM2"],+ "x-enum-varnames": ["SIM1", "SIM2"]+ },+ "entities.SubscriptionName": {+ "type": "string",+ "enum": [+ "free",+ "pro-monthly",+ "pro-yearly",+ "ultra-monthly",+ "ultra-yearly",+ "pro-lifetime",+ "20k-monthly",+ "20k-yearly"+ ],+ "x-enum-varnames": [+ "SubscriptionNameFree",+ "SubscriptionNameProMonthly",+ "SubscriptionNameProYearly",+ "SubscriptionNameUltraMonthly",+ "SubscriptionNameUltraYearly",+ "SubscriptionNameProLifetime",+ "SubscriptionName20KMonthly",+ "SubscriptionName20KYearly"+ ]+ },+ "entities.User": {+ "type": "object",+ "required": [+ "active_phone_id",+ "api_key",+ "created_at",+ "email",+ "id",+ "notification_heartbeat_enabled",+ "notification_message_status_enabled",+ "notification_webhook_enabled",+ "subscription_ends_at",+ "subscription_id",+ "subscription_name",+ "subscription_renews_at",+ "subscription_status",+ "timezone",+ "updated_at"+ ],+ "properties": {+ "active_phone_id": {+ "type": "string",+ "example": "32343a19-da5e-4b1b-a767-3298a73703cb"+ },+ "api_key": {+ "type": "string",+ "example": "xyz"+ },+ "created_at": {+ "type": "string",+ "example": "2022-06-05T14:26:02.302718+03:00"+ },+ "email": {+ "type": "string",+ "example": "[email protected]"+ },+ "id": {+ "type": "string",+ "example": "WB7DRDWrJZRGbYrv2CKGkqbzvqdC"+ },+ "notification_heartbeat_enabled": {+ "type": "boolean",+ "example": true+ },+ "notification_message_status_enabled": {+ "type": "boolean",+ "example": true+ },+ "notification_webhook_enabled": {+ "type": "boolean",+ "example": true+ },+ "subscription_ends_at": {+ "type": "string",+ "example": "2022-06-05T14:26:02.302718+03:00"+ },+ "subscription_id": {+ "type": "string",+ "example": "8f9c71b8-b84e-4417-8408-a62274f65a08"+ },+ "subscription_name": {+ "allOf": [+ {+ "$ref": "#/definitions/entities.SubscriptionName"+ }+ ],+ "example": "free"+ },+ "subscription_renews_at": {+ "type": "string",+ "example": "2022-06-05T14:26:02.302718+03:00"+ },+ "subscription_status": {+ "type": "string",+ "example": "on_trial"+ },+ "timezone": {+ "type": "string",+ "example": "Europe/Helsinki"+ },+ "updated_at": {+ "type": "string",+ "example": "2022-06-05T14:26:10.303278+03:00"+ }+ }+ },+ "entities.Webhook": {+ "type": "object",+ "required": [+ "created_at",+ "events",+ "id",+ "phone_numbers",+ "signing_key",+ "updated_at",+ "url",+ "user_id"+ ],+ "properties": {+ "created_at": {+ "type": "string",+ "example": "2022-06-05T14:26:02.302718+03:00"+ },+ "events": {+ "type": "array",+ "items": {+ "type": "string"+ },+ "example": ["[message.phone.received]"]+ },+ "id": {+ "type": "string",+ "example": "32343a19-da5e-4b1b-a767-3298a73703cb"+ },+ "phone_numbers": {+ "type": "array",+ "items": {+ "type": "string"+ },+ "example": ["[+18005550199", "+18005550100]"]+ },+ "signing_key": {+ "type": "string",+ "example": "DGW8NwQp7mxKaSZ72Xq9v67SLqSbWQvckzzmK8D6rvd7NywSEkdMJtuxKyEkYnCY"+ },+ "updated_at": {+ "type": "string",+ "example": "2022-06-05T14:26:10.303278+03:00"+ },+ "url": {+ "type": "string",+ "example": "https://example.com"+ },+ "user_id": {+ "type": "string",+ "example": "WB7DRDWrJZRGbYrv2CKGkqbzvqdC"+ }+ }+ },+ "requests.DiscordStore": {+ "type": "object",+ "required": ["incoming_channel_id", "name", "server_id"],+ "properties": {+ "incoming_channel_id": {+ "type": "string"+ },+ "name": {+ "type": "string"+ },+ "server_id": {+ "type": "string"+ }+ }+ },+ "requests.DiscordUpdate": {+ "type": "object",+ "required": ["incoming_channel_id", "name", "server_id"],+ "properties": {+ "incoming_channel_id": {+ "type": "string"+ },+ "name": {+ "type": "string"+ },+ "server_id": {+ "type": "string"+ }+ }+ },+ "requests.HeartbeatStore": {+ "type": "object",+ "required": ["charging", "owner"],+ "properties": {+ "charging": {+ "type": "boolean"+ },+ "owner": {+ "type": "string"+ }+ }+ },+ "requests.MessageBulkSend": {+ "type": "object",+ "required": ["content", "from", "to"],+ "properties": {+ "content": {+ "type": "string",+ "example": "This is a sample text message"+ },+ "from": {+ "type": "string",+ "example": "+18005550199"+ },+ "request_id": {+ "description": "RequestID is an optional parameter used to track a request from the client's perspective",+ "type": "string",+ "example": "153554b5-ae44-44a0-8f4f-7bbac5657ad4"+ },+ "to": {+ "type": "array",+ "items": {+ "type": "string"+ },+ "example": ["+18005550100", "+18005550100"]+ }+ }+ },+ "requests.MessageEvent": {+ "type": "object",+ "required": ["event_name", "reason", "timestamp"],+ "properties": {+ "event_name": {+ "description": "EventName is the type of event\n* SENT: is emitted when a message is sent by the mobile phone\n* FAILED: is event is emitted when the message could not be sent by the mobile phone\n* DELIVERED: is event is emitted when a delivery report has been received by the mobile phone",+ "type": "string",+ "example": "SENT"+ },+ "reason": {+ "description": "Reason is the exact error message in case the event is an error",+ "type": "string"+ },+ "timestamp": {+ "description": "Timestamp is the time when the event was emitted, Please send the timestamp in UTC with as much precision as possible",+ "type": "string",+ "example": "2022-06-05T14:26:09.527976+03:00"+ }+ }+ },+ "requests.MessageReceive": {+ "type": "object",+ "required": ["content", "from", "sim", "timestamp", "to"],+ "properties": {+ "content": {+ "type": "string",+ "example": "This is a sample text message received on a phone"+ },+ "from": {+ "type": "string",+ "example": "+18005550199"+ },+ "sim": {+ "description": "SIM card that received the message",+ "allOf": [+ {+ "$ref": "#/definitions/entities.SIM"+ }+ ],+ "example": "SIM1"+ },+ "timestamp": {+ "description": "Timestamp is the time when the event was emitted, Please send the timestamp in UTC with as much precision as possible",+ "type": "string",+ "example": "2022-06-05T14:26:09.527976+03:00"+ },+ "to": {+ "type": "string",+ "example": "+18005550100"+ }+ }+ },+ "requests.MessageSend": {+ "type": "object",+ "required": ["content", "from", "to"],+ "properties": {+ "content": {+ "type": "string",+ "example": "This is a sample text message"+ },+ "from": {+ "type": "string",+ "example": "+18005550199"+ },+ "request_id": {+ "description": "RequestID is an optional parameter used to track a request from the client's perspective",+ "type": "string",+ "example": "153554b5-ae44-44a0-8f4f-7bbac5657ad4"+ },+ "to": {+ "type": "string",+ "example": "+18005550100"+ }+ }+ },+ "requests.MessageThreadUpdate": {+ "type": "object",+ "required": ["is_archived"],+ "properties": {+ "is_archived": {+ "type": "boolean",+ "example": true+ }+ }+ },+ "requests.PhoneUpsert": {+ "type": "object",+ "required": [+ "fcm_token",+ "max_send_attempts",+ "message_expiration_seconds",+ "messages_per_minute",+ "phone_number",+ "sim"+ ],+ "properties": {+ "fcm_token": {+ "type": "string",+ "example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzd....."+ },+ "max_send_attempts": {+ "description": "MaxSendAttempts is the number of attempts when sending an SMS message to handle the case where the phone is offline.",+ "type": "integer",+ "example": 2+ },+ "message_expiration_seconds": {+ "description": "MessageExpirationSeconds is the duration in seconds after sending a message when it is considered to be expired.",+ "type": "integer",+ "example": 12345+ },+ "messages_per_minute": {+ "type": "integer",+ "example": 1+ },+ "phone_number": {+ "type": "string",+ "example": "+18005550199"+ },+ "sim": {+ "description": "SIM is the SIM slot of the phone in case the phone has more than 1 SIM slot",+ "type": "string",+ "example": "SIM1"+ }+ }+ },+ "requests.UserNotificationUpdate": {+ "type": "object",+ "required": [+ "heartbeat_enabled",+ "message_status_enabled",+ "webhook_enabled"+ ],+ "properties": {+ "heartbeat_enabled": {+ "type": "boolean",+ "example": true+ },+ "message_status_enabled": {+ "type": "boolean",+ "example": true+ },+ "webhook_enabled": {+ "type": "boolean",+ "example": true+ }+ }+ },+ "requests.UserUpdate": {+ "type": "object",+ "required": ["active_phone_id", "timezone"],+ "properties": {+ "active_phone_id": {+ "type": "string",+ "example": "32343a19-da5e-4b1b-a767-3298a73703cb"+ },+ "timezone": {+ "type": "string",+ "example": "Europe/Helsinki"+ }+ }+ },+ "requests.WebhookStore": {+ "type": "object",+ "required": ["events", "phone_numbers", "signing_key", "url"],+ "properties": {+ "events": {+ "type": "array",+ "items": {+ "type": "string"+ }+ },+ "phone_numbers": {+ "type": "array",+ "items": {+ "type": "string"+ },+ "example": ["+18005550100", "+18005550100"]+ },+ "signing_key": {+ "type": "string"+ },+ "url": {+ "type": "string"+ }+ }+ },+ "requests.WebhookUpdate": {+ "type": "object",+ "required": ["events", "phone_numbers", "signing_key", "url"],+ "properties": {+ "events": {+ "type": "array",+ "items": {+ "type": "string"+ }+ },+ "phone_numbers": {+ "type": "array",+ "items": {+ "type": "string"+ },+ "example": ["+18005550100", "+18005550100"]+ },+ "signing_key": {+ "type": "string"+ },+ "url": {+ "type": "string"+ }+ }+ },+ "responses.BadRequest": {+ "type": "object",+ "required": ["data", "message", "status"],+ "properties": {+ "data": {+ "type": "string",+ "example": "The request body is not a valid JSON string"+ },+ "message": {+ "type": "string",+ "example": "The request isn't properly formed"+ },+ "status": {+ "type": "string",+ "example": "error"+ }+ }+ },+ "responses.BillingUsageResponse": {+ "type": "object",+ "required": ["data", "message", "status"],+ "properties": {+ "data": {+ "$ref": "#/definitions/entities.BillingUsage"+ },+ "message": {+ "type": "string",+ "example": "item created successfully"+ },+ "status": {+ "type": "string",+ "example": "success"+ }+ }+ },+ "responses.BillingUsagesResponse": {+ "type": "object",+ "required": ["data", "message", "status"],+ "properties": {+ "data": {+ "type": "array",+ "items": {+ "$ref": "#/definitions/entities.BillingUsage"+ }+ },+ "message": {+ "type": "string",+ "example": "item created successfully"+ },+ "status": {+ "type": "string",+ "example": "success"+ }+ }+ },+ "responses.DiscordResponse": {+ "type": "object",+ "required": ["data", "message", "status"],+ "properties": {+ "data": {+ "$ref": "#/definitions/entities.Discord"+ },+ "message": {+ "type": "string",+ "example": "item created successfully"+ },+ "status": {+ "type": "string",+ "example": "success"+ }+ }+ },+ "responses.DiscordsResponse": {+ "type": "object",+ "required": ["data", "message", "status"],+ "properties": {+ "data": {+ "type": "array",+ "items": {+ "$ref": "#/definitions/entities.Discord"+ }+ },+ "message": {+ "type": "string",+ "example": "item created successfully"+ },+ "status": {+ "type": "string",+ "example": "success"+ }+ }+ },+ "responses.HeartbeatResponse": {+ "type": "object",+ "required": ["data", "message", "status"],+ "properties": {+ "data": {+ "$ref": "#/definitions/entities.Heartbeat"+ },+ "message": {+ "type": "string",+ "example": "item created successfully"+ },+ "status": {+ "type": "string",+ "example": "success"+ }+ }+ },+ "responses.HeartbeatsResponse": {+ "type": "object",+ "required": ["data", "message", "status"],+ "properties": {+ "data": {+ "type": "array",+ "items": {+ "$ref": "#/definitions/entities.Heartbeat"+ }+ },+ "message": {+ "type": "string",+ "example": "item created successfully"+ },+ "status": {+ "type": "string",+ "example": "success"+ }+ }+ },+ "responses.InternalServerError": {+ "type": "object",+ "required": ["message", "status"],+ "properties": {+ "message": {+ "type": "string",+ "example": "We ran into an internal error while handling the request."+ },+ "status": {+ "type": "string",+ "example": "error"+ }+ }+ },+ "responses.MessageResponse": {+ "type": "object",+ "required": ["data", "message", "status"],+ "properties": {+ "data": {+ "$ref": "#/definitions/entities.Message"+ },+ "message": {+ "type": "string",+ "example": "item created successfully"+ },+ "status": {+ "type": "string",+ "example": "success"+ }+ }+ },+ "responses.MessageThreadsResponse": {+ "type": "object",+ "required": ["data", "message", "status"],+ "properties": {+ "data": {+ "type": "array",+ "items": {+ "$ref": "#/definitions/entities.MessageThread"+ }+ },+ "message": {+ "type": "string",+ "example": "item created successfully"+ },+ "status": {+ "type": "string",+ "example": "success"+ }+ }+ },+ "responses.MessagesResponse": {+ "type": "object",+ "required": ["data", "message", "status"],+ "properties": {+ "data": {+ "type": "array",+ "items": {+ "$ref": "#/definitions/entities.Message"+ }+ },+ "message": {+ "type": "string",+ "example": "item created successfully"+ },+ "status": {+ "type": "string",+ "example": "success"+ }+ }+ },+ "responses.NoContent": {+ "type": "object",+ "required": ["message", "status"],+ "properties": {+ "message": {+ "type": "string",+ "example": "action performed successfully"+ },+ "status": {+ "type": "string",+ "example": "success"+ }+ }+ },+ "responses.NotFound": {+ "type": "object",+ "required": ["message", "status"],+ "properties": {+ "message": {+ "type": "string",+ "example": "cannot find message with ID [32343a19-da5e-4b1b-a767-3298a73703ca]"+ },+ "status": {+ "type": "string",+ "example": "error"+ }+ }+ },+ "responses.OkString": {+ "type": "object",+ "required": ["data", "message", "status"],+ "properties": {+ "data": {+ "type": "string"+ },+ "message": {+ "type": "string",+ "example": "Request handled successfully"+ },+ "status": {+ "type": "string",+ "example": "success"+ }+ }+ },+ "responses.PhoneResponse": {+ "type": "object",+ "required": ["data", "message", "status"],+ "properties": {+ "data": {+ "$ref": "#/definitions/entities.Phone"+ },+ "message": {+ "type": "string",+ "example": "item created successfully"+ },+ "status": {+ "type": "string",+ "example": "success"+ }+ }+ },+ "responses.PhonesResponse": {+ "type": "object",+ "required": ["data", "message", "status"],+ "properties": {+ "data": {+ "type": "array",+ "items": {+ "$ref": "#/definitions/entities.Phone"+ }+ },+ "message": {+ "type": "string",+ "example": "item created successfully"+ },+ "status": {+ "type": "string",+ "example": "success"+ }+ }+ },+ "responses.Unauthorized": {+ "type": "object",+ "required": ["data", "message", "status"],+ "properties": {+ "data": {+ "type": "string",+ "example": "Make sure your API key is set in the [X-API-Key] header in the request"+ },+ "message": {+ "type": "string",+ "example": "You are not authorized to carry out this request."+ },+ "status": {+ "type": "string",+ "example": "error"+ }+ }+ },+ "responses.UnprocessableEntity": {+ "type": "object",+ "required": ["data", "message", "status"],+ "properties": {+ "data": {+ "type": "object",+ "additionalProperties": {+ "type": "array",+ "items": {+ "type": "string"+ }+ }+ },+ "message": {+ "type": "string",+ "example": "validation errors while sending message"+ },+ "status": {+ "type": "string",+ "example": "error"+ }+ }+ },+ "responses.UserResponse": {+ "type": "object",+ "required": ["data", "message", "status"],+ "properties": {+ "data": {+ "$ref": "#/definitions/entities.User"+ },+ "message": {+ "type": "string",+ "example": "item created successfully"+ },+ "status": {+ "type": "string",+ "example": "success"+ }+ }+ },+ "responses.WebhookResponse": {+ "type": "object",+ "required": ["data", "message", "status"],+ "properties": {+ "data": {+ "$ref": "#/definitions/entities.Webhook"+ },+ "message": {+ "type": "string",+ "example": "item created successfully"+ },+ "status": {+ "type": "string",+ "example": "success"+ }+ }+ },+ "responses.WebhooksResponse": {+ "type": "object",+ "required": ["data", "message", "status"],+ "properties": {+ "data": {+ "type": "array",+ "items": {+ "$ref": "#/definitions/entities.Webhook"+ }+ },+ "message": {+ "type": "string",+ "example": "item created successfully"+ },+ "status": {+ "type": "string",+ "example": "success"+ }+ }+ }+ },+ "securityDefinitions": {+ "ApiKeyAuth": {+ "type": "apiKey",+ "name": "x-api-Key",+ "in": "header"+ }+ }+}diff --git a/api/docs/swagger.yaml b/api/docs/swagger.yamlnew file mode 100644index 00000000..edcf52bf--- /dev/null+++ b/api/docs/swagger.yaml@@ -0,0 +1,2395 @@+basePath: /v1+definitions:+ entities.BillingUsage:+ properties:+ created_at:+ example: "2022-06-05T14:26:02.302718+03:00"+ type: string+ end_timestamp:+ example: "2022-01-31T23:59:59+00:00"+ type: string+ id:+ example: 32343a19-da5e-4b1b-a767-3298a73703cb+ type: string+ received_messages:+ example: 465+ type: integer+ sent_messages:+ example: 321+ type: integer+ start_timestamp:+ example: "2022-01-01T00:00:00+00:00"+ type: string+ total_cost:+ example: 0+ type: integer+ updated_at:+ example: "2022-06-05T14:26:10.303278+03:00"+ type: string+ user_id:+ example: WB7DRDWrJZRGbYrv2CKGkqbzvqdC+ type: string+ required:+ - created_at+ - end_timestamp+ - id+ - received_messages+ - sent_messages+ - start_timestamp+ - total_cost+ - updated_at+ - user_id+ type: object+ entities.Discord:+ properties:+ created_at:+ example: "2022-06-05T14:26:02.302718+03:00"+ type: string+ id:+ example: 32343a19-da5e-4b1b-a767-3298a73703cb+ type: string+ incoming_channel_id:+ example: "1095780203256627291"+ type: string+ name:+ example: Game Server+ type: string+ server_id:+ example: "1095778291488653372"+ type: string+ updated_at:+ example: "2022-06-05T14:26:10.303278+03:00"+ type: string+ user_id:+ example: WB7DRDWrJZRGbYrv2CKGkqbzvqdC+ type: string+ required:+ - created_at+ - id+ - incoming_channel_id+ - name+ - server_id+ - updated_at+ - user_id+ type: object+ entities.Heartbeat:+ properties:+ charging:+ example: true+ type: boolean+ id:+ example: 32343a19-da5e-4b1b-a767-3298a73703cb+ type: string+ owner:+ example: "+18005550199"+ type: string+ timestamp:+ example: "2022-06-05T14:26:01.520828+03:00"+ type: string+ user_id:+ example: WB7DRDWrJZRGbYrv2CKGkqbzvqdC+ type: string+ version:+ example: 344c10f+ type: string+ required:+ - charging+ - id+ - owner+ - timestamp+ - user_id+ - version+ type: object+ entities.Message:+ properties:+ can_be_polled:+ example: false+ type: boolean+ contact:+ example: "+18005550100"+ type: string+ content:+ example: This is a sample text message+ type: string+ created_at:+ example: "2022-06-05T14:26:02.302718+03:00"+ type: string+ delivered_at:+ example: "2022-06-05T14:26:09.527976+03:00"+ type: string+ expired_at:+ example: "2022-06-05T14:26:09.527976+03:00"+ type: string+ failed_at:+ example: "2022-06-05T14:26:09.527976+03:00"+ type: string+ failure_reason:+ example: UNKNOWN+ type: string+ id:+ example: 32343a19-da5e-4b1b-a767-3298a73703cb+ type: string+ last_attempted_at:+ example: "2022-06-05T14:26:09.527976+03:00"+ type: string+ max_send_attempts:+ example: 1+ type: integer+ order_timestamp:+ example: "2022-06-05T14:26:09.527976+03:00"+ type: string+ owner:+ example: "+18005550199"+ type: string+ received_at:+ example: "2022-06-05T14:26:09.527976+03:00"+ type: string+ request_id:+ example: 153554b5-ae44-44a0-8f4f-7bbac5657ad4+ type: string+ request_received_at:+ example: "2022-06-05T14:26:01.520828+03:00"+ type: string+ scheduled_at:+ example: "2022-06-05T14:26:09.527976+03:00"+ type: string+ send_attempt_count:+ example: 0+ type: integer+ send_time:+ description:+ SendDuration is the number of nanoseconds from when the request+ was received until when the mobile phone send the message+ example: 133414+ type: integer+ sent_at:+ example: "2022-06-05T14:26:09.527976+03:00"+ type: string+ sim:+ allOf:+ - $ref: "#/definitions/entities.SIM"+ description: |-+ SIM is the SIM card to use to send the message+ * SMS1: use the SIM card in slot 1+ * SMS2: use the SIM card in slot 2+ * DEFAULT: used the default communication SIM card+ example: DEFAULT+ status:+ example: pending+ type: string+ type:+ example: mobile-terminated+ type: string+ updated_at:+ example: "2022-06-05T14:26:10.303278+03:00"+ type: string+ user_id:+ example: WB7DRDWrJZRGbYrv2CKGkqbzvqdC+ type: string+ required:+ - can_be_polled+ - contact+ - content+ - created_at+ - delivered_at+ - expired_at+ - failed_at+ - failure_reason+ - id+ - last_attempted_at+ - max_send_attempts+ - order_timestamp+ - owner+ - received_at+ - request_id+ - request_received_at+ - scheduled_at+ - send_attempt_count+ - send_time+ - sent_at+ - sim+ - status+ - type+ - updated_at+ - user_id+ type: object+ entities.MessageThread:+ properties:+ color:+ example: indigo+ type: string+ contact:+ example: "+18005550100"+ type: string+ created_at:+ example: "2022-06-05T14:26:09.527976+03:00"+ type: string+ id:+ example: 32343a19-da5e-4b1b-a767-3298a73703ca+ type: string+ is_archived:+ example: false+ type: boolean+ last_message_content:+ example: This is a sample message content+ type: string+ last_message_id:+ example: 32343a19-da5e-4b1b-a767-3298a73703ca+ type: string+ order_timestamp:+ example: "2022-06-05T14:26:09.527976+03:00"+ type: string+ owner:+ example: "+18005550199"+ type: string+ status:+ example: PENDING+ type: string+ updated_at:+ example: "2022-06-05T14:26:09.527976+03:00"+ type: string+ user_id:+ example: WB7DRDWrJZRGbYrv2CKGkqbzvqdC+ type: string+ required:+ - color+ - contact+ - created_at+ - id+ - is_archived+ - last_message_content+ - last_message_id+ - order_timestamp+ - owner+ - status+ - updated_at+ - user_id+ type: object+ entities.Phone:+ properties:+ created_at:+ example: "2022-06-05T14:26:02.302718+03:00"+ type: string+ fcm_token:+ example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzd.....+ type: string+ id:+ example: 32343a19-da5e-4b1b-a767-3298a73703cb+ type: string+ max_send_attempts:+ description:+ MaxSendAttempts determines how many times to retry sending an+ SMS message+ example: 2+ type: integer+ message_expiration_seconds:+ description:+ MessageExpirationSeconds is the duration in seconds after sending+ a message when it is considered to be expired.+ type: integer+ messages_per_minute:+ example: 1+ type: integer+ phone_number:+ example: "+18005550199"+ type: string+ sim:+ $ref: "#/definitions/entities.SIM"+ updated_at:+ example: "2022-06-05T14:26:10.303278+03:00"+ type: string+ user_id:+ example: WB7DRDWrJZRGbYrv2CKGkqbzvqdC+ type: string+ required:+ - created_at+ - fcm_token+ - id+ - max_send_attempts+ - message_expiration_seconds+ - messages_per_minute+ - phone_number+ - sim+ - updated_at+ - user_id+ type: object+ entities.SIM:+ enum:+ - SIM1+ - SIM2+ type: string+ x-enum-varnames:+ - SIM1+ - SIM2+ entities.SubscriptionName:+ enum:+ - free+ - pro-monthly+ - pro-yearly+ - ultra-monthly+ - ultra-yearly+ - pro-lifetime+ - 20k-monthly+ - 20k-yearly+ type: string+ x-enum-varnames:+ - SubscriptionNameFree+ - SubscriptionNameProMonthly+ - SubscriptionNameProYearly+ - SubscriptionNameUltraMonthly+ - SubscriptionNameUltraYearly+ - SubscriptionNameProLifetime+ - SubscriptionName20KMonthly+ - SubscriptionName20KYearly+ entities.User:+ properties:+ active_phone_id:+ example: 32343a19-da5e-4b1b-a767-3298a73703cb+ type: string+ api_key:+ example: xyz+ type: string+ created_at:+ example: "2022-06-05T14:26:02.302718+03:00"+ type: string+ email:+ example: [email protected]+ type: string+ id:+ example: WB7DRDWrJZRGbYrv2CKGkqbzvqdC+ type: string+ notification_heartbeat_enabled:+ example: true+ type: boolean+ notification_message_status_enabled:+ example: true+ type: boolean+ notification_webhook_enabled:+ example: true+ type: boolean+ subscription_ends_at:+ example: "2022-06-05T14:26:02.302718+03:00"+ type: string+ subscription_id:+ example: 8f9c71b8-b84e-4417-8408-a62274f65a08+ type: string+ subscription_name:+ allOf:+ - $ref: "#/definitions/entities.SubscriptionName"+ example: free+ subscription_renews_at:+ example: "2022-06-05T14:26:02.302718+03:00"+ type: string+ subscription_status:+ example: on_trial+ type: string+ timezone:+ example: Europe/Helsinki+ type: string+ updated_at:+ example: "2022-06-05T14:26:10.303278+03:00"+ type: string+ required:+ - active_phone_id+ - api_key+ - created_at+ - id+ - notification_heartbeat_enabled+ - notification_message_status_enabled+ - notification_webhook_enabled+ - subscription_ends_at+ - subscription_id+ - subscription_name+ - subscription_renews_at+ - subscription_status+ - timezone+ - updated_at+ type: object+ entities.Webhook:+ properties:+ created_at:+ example: "2022-06-05T14:26:02.302718+03:00"+ type: string+ events:+ example:+ - "[message.phone.received]"+ items:+ type: string+ type: array+ id:+ example: 32343a19-da5e-4b1b-a767-3298a73703cb+ type: string+ phone_numbers:+ example:+ - "[+18005550199"+ - +18005550100]+ items:+ type: string+ type: array+ signing_key:+ example: DGW8NwQp7mxKaSZ72Xq9v67SLqSbWQvckzzmK8D6rvd7NywSEkdMJtuxKyEkYnCY+ type: string+ updated_at:+ example: "2022-06-05T14:26:10.303278+03:00"+ type: string+ url:+ example: https://example.com+ type: string+ user_id:+ example: WB7DRDWrJZRGbYrv2CKGkqbzvqdC+ type: string+ required:+ - created_at+ - events+ - id+ - phone_numbers+ - signing_key+ - updated_at+ - url+ - user_id+ type: object+ requests.DiscordStore:+ properties:+ incoming_channel_id:+ type: string+ name:+ type: string+ server_id:+ type: string+ required:+ - incoming_channel_id+ - name+ - server_id+ type: object+ requests.DiscordUpdate:+ properties:+ incoming_channel_id:+ type: string+ name:+ type: string+ server_id:+ type: string+ required:+ - incoming_channel_id+ - name+ - server_id+ type: object+ requests.HeartbeatStore:+ properties:+ charging:+ type: boolean+ owner:+ type: string+ required:+ - charging+ - owner+ type: object+ requests.MessageBulkSend:+ properties:+ content:+ example: This is a sample text message+ type: string+ from:+ example: "+18005550199"+ type: string+ request_id:+ description:+ RequestID is an optional parameter used to track a request from+ the client's perspective+ example: 153554b5-ae44-44a0-8f4f-7bbac5657ad4+ type: string+ to:+ example:+ - "+18005550100"+ - "+18005550100"+ items:+ type: string+ type: array+ required:+ - content+ - from+ - to+ type: object+ requests.MessageEvent:+ properties:+ event_name:+ description: |-+ EventName is the type of event+ * SENT: is emitted when a message is sent by the mobile phone+ * FAILED: is event is emitted when the message could not be sent by the mobile phone+ * DELIVERED: is event is emitted when a delivery report has been received by the mobile phone+ example: SENT+ type: string+ reason:+ description: Reason is the exact error message in case the event is an error+ type: string+ timestamp:+ description:+ Timestamp is the time when the event was emitted, Please send+ the timestamp in UTC with as much precision as possible+ example: "2022-06-05T14:26:09.527976+03:00"+ type: string+ required:+ - event_name+ - reason+ - timestamp+ type: object+ requests.MessageReceive:+ properties:+ content:+ example: This is a sample text message received on a phone+ type: string+ from:+ example: "+18005550199"+ type: string+ sim:+ allOf:+ - $ref: "#/definitions/entities.SIM"+ description: SIM card that received the message+ example: SIM1+ timestamp:+ description:+ Timestamp is the time when the event was emitted, Please send+ the timestamp in UTC with as much precision as possible+ example: "2022-06-05T14:26:09.527976+03:00"+ type: string+ to:+ example: "+18005550100"+ type: string+ required:+ - content+ - from+ - sim+ - timestamp+ - to+ type: object+ requests.MessageSend:+ properties:+ content:+ example: This is a sample text message+ type: string+ from:+ example: "+18005550199"+ type: string+ request_id:+ description:+ RequestID is an optional parameter used to track a request from+ the client's perspective+ example: 153554b5-ae44-44a0-8f4f-7bbac5657ad4+ type: string+ to:+ example: "+18005550100"+ type: string+ required:+ - content+ - from+ - to+ type: object+ requests.MessageThreadUpdate:+ properties:+ is_archived:+ example: true+ type: boolean+ required:+ - is_archived+ type: object+ requests.PhoneUpsert:+ properties:+ fcm_token:+ example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzd.....+ type: string+ max_send_attempts:+ description:+ MaxSendAttempts is the number of attempts when sending an SMS+ message to handle the case where the phone is offline.+ example: 2+ type: integer+ message_expiration_seconds:+ description:+ MessageExpirationSeconds is the duration in seconds after sending+ a message when it is considered to be expired.+ example: 12345+ type: integer+ messages_per_minute:+ example: 1+ type: integer+ phone_number:+ example: "+18005550199"+ type: string+ sim:+ description:+ SIM is the SIM slot of the phone in case the phone has more than+ 1 SIM slot+ example: SIM1+ type: string+ required:+ - fcm_token+ - max_send_attempts+ - message_expiration_seconds+ - messages_per_minute+ - phone_number+ - sim+ type: object+ requests.UserNotificationUpdate:+ properties:+ heartbeat_enabled:+ example: true+ type: boolean+ message_status_enabled:+ example: true+ type: boolean+ webhook_enabled:+ example: true+ type: boolean+ required:+ - heartbeat_enabled+ - message_status_enabled+ - webhook_enabled+ type: object+ requests.UserUpdate:+ properties:+ active_phone_id:+ example: 32343a19-da5e-4b1b-a767-3298a73703cb+ type: string+ timezone:+ example: Europe/Helsinki+ type: string+ required:+ - active_phone_id+ - timezone+ type: object+ requests.WebhookStore:+ properties:+ events:+ items:+ type: string+ type: array+ phone_numbers:+ example:+ - "+18005550100"+ - "+18005550100"+ items:+ type: string+ type: array+ signing_key:+ type: string+ url:+ type: string+ required:+ - events+ - phone_numbers+ - signing_key+ - url+ type: object+ requests.WebhookUpdate:+ properties:+ events:+ items:+ type: string+ type: array+ phone_numbers:+ example:+ - "+18005550100"+ - "+18005550100"+ items:+ type: string+ type: array+ signing_key:+ type: string+ url:+ type: string+ required:+ - events+ - phone_numbers+ - signing_key+ - url+ type: object+ responses.BadRequest:+ properties:+ data:+ example: The request body is not a valid JSON string+ type: string+ message:+ example: The request isn't properly formed+ type: string+ status:+ example: error+ type: string+ required:+ - data+ - message+ - status+ type: object+ responses.BillingUsageResponse:+ properties:+ data:+ $ref: "#/definitions/entities.BillingUsage"+ message:+ example: item created successfully+ type: string+ status:+ example: success+ type: string+ required:+ - data+ - message+ - status+ type: object+ responses.BillingUsagesResponse:+ properties:+ data:+ items:+ $ref: "#/definitions/entities.BillingUsage"+ type: array+ message:+ example: item created successfully+ type: string+ status:+ example: success+ type: string+ required:+ - data+ - message+ - status+ type: object+ responses.DiscordResponse:+ properties:+ data:+ $ref: "#/definitions/entities.Discord"+ message:+ example: item created successfully+ type: string+ status:+ example: success+ type: string+ required:+ - data+ - message+ - status+ type: object+ responses.DiscordsResponse:+ properties:+ data:+ items:+ $ref: "#/definitions/entities.Discord"+ type: array+ message:+ example: item created successfully+ type: string+ status:+ example: success+ type: string+ required:+ - data+ - message+ - status+ type: object+ responses.HeartbeatResponse:+ properties:+ data:+ $ref: "#/definitions/entities.Heartbeat"+ message:+ example: item created successfully+ type: string+ status:+ example: success+ type: string+ required:+ - data+ - message+ - status+ type: object+ responses.HeartbeatsResponse:+ properties:+ data:+ items:+ $ref: "#/definitions/entities.Heartbeat"+ type: array+ message:+ example: item created successfully+ type: string+ status:+ example: success+ type: string+ required:+ - data+ - message+ - status+ type: object+ responses.InternalServerError:+ properties:+ message:+ example: We ran into an internal error while handling the request.+ type: string+ status:+ example: error+ type: string+ required:+ - message+ - status+ type: object+ responses.MessageResponse:+ properties:+ data:+ $ref: "#/definitions/entities.Message"+ message:+ example: item created successfully+ type: string+ status:+ example: success+ type: string+ required:+ - data+ - message+ - status+ type: object+ responses.MessageThreadsResponse:+ properties:+ data:+ items:+ $ref: "#/definitions/entities.MessageThread"+ type: array+ message:+ example: item created successfully+ type: string+ status:+ example: success+ type: string+ required:+ - data+ - message+ - status+ type: object+ responses.MessagesResponse:+ properties:+ data:+ items:+ $ref: "#/definitions/entities.Message"+ type: array+ message:+ example: item created successfully+ type: string+ status:+ example: success+ type: string+ required:+ - data+ - message+ - status+ type: object+ responses.NoContent:+ properties:+ message:+ example: action performed successfully+ type: string+ status:+ example: success+ type: string+ required:+ - message+ - status+ type: object+ responses.NotFound:+ properties:+ message:+ example: cannot find message with ID [32343a19-da5e-4b1b-a767-3298a73703ca]+ type: string+ status:+ example: error+ type: string+ required:+ - message+ - status+ type: object+ responses.OkString:+ properties:+ data:+ type: string+ message:+ example: Request handled successfully+ type: string+ status:+ example: success+ type: string+ required:+ - data+ - message+ - status+ type: object+ responses.PhoneResponse:+ properties:+ data:+ $ref: "#/definitions/entities.Phone"+ message:+ example: item created successfully+ type: string+ status:+ example: success+ type: string+ required:+ - data+ - message+ - status+ type: object+ responses.PhonesResponse:+ properties:+ data:+ items:+ $ref: "#/definitions/entities.Phone"+ type: array+ message:+ example: item created successfully+ type: string+ status:+ example: success+ type: string+ required:+ - data+ - message+ - status+ type: object+ responses.Unauthorized:+ properties:+ data:+ example: Make sure your API key is set in the [X-API-Key] header in the request+ type: string+ message:+ example: You are not authorized to carry out this request.+ type: string+ status:+ example: error+ type: string+ required:+ - data+ - message+ - status+ type: object+ responses.UnprocessableEntity:+ properties:+ data:+ additionalProperties:+ items:+ type: string+ type: array+ type: object+ message:+ example: validation errors while sending message+ type: string+ status:+ example: error+ type: string+ required:+ - data+ - message+ - status+ type: object+ responses.UserResponse:+ properties:+ data:+ $ref: "#/definitions/entities.User"+ message:+ example: item created successfully+ type: string+ status:+ example: success+ type: string+ required:+ - data+ - message+ - status+ type: object+ responses.WebhookResponse:+ properties:+ data:+ $ref: "#/definitions/entities.Webhook"+ message:+ example: item created successfully+ type: string+ status:+ example: success+ type: string+ required:+ - data+ - message+ - status+ type: object+ responses.WebhooksResponse:+ properties:+ data:+ items:+ $ref: "#/definitions/entities.Webhook"+ type: array+ message:+ example: item created successfully+ type: string+ status:+ example: success+ type: string+ required:+ - data+ - message+ - status+ type: object+host: api.httpsms.com+info:+ contact:+ email: [email protected]+ name: HTTP SMS+ description:+ API to send SMS messages using android [SmsManager](https://developer.android.com/reference/android/telephony/SmsManager)+ via HTTP+ license:+ name: AGPL-3.0+ url: https://raw.githubusercontent.com/NdoleStudio/http-sms-manager/main/LICENSE+ title: HTTP SMS API+ version: "1.0"+paths:+ /billing/usage:+ get:+ consumes:+ - application/json+ description:+ Get the summary of sent and received messages for a user in the+ current month+ produces:+ - application/json+ responses:+ "200":+ description: OK+ schema:+ $ref: "#/definitions/responses.BillingUsageResponse"+ "400":+ description: Bad Request+ schema:+ $ref: "#/definitions/responses.BadRequest"+ "401":+ description: Unauthorized+ schema:+ $ref: "#/definitions/responses.Unauthorized"+ "422":+ description: Unprocessable Entity+ schema:+ $ref: "#/definitions/responses.UnprocessableEntity"+ "500":+ description: Internal Server Error+ schema:+ $ref: "#/definitions/responses.InternalServerError"+ security:+ - ApiKeyAuth: []+ summary: Get Billing Usage.+ tags:+ - Billing+ /billing/usage-history:+ get:+ consumes:+ - application/json+ description:+ Get billing usage records of sent and received messages for a user+ in the past. It will be sorted by timestamp in descending order.+ parameters:+ - description: number of heartbeats to skip+ in: query+ minimum: 0+ name: skip+ type: integer+ - description: number of heartbeats to return+ in: query+ maximum: 100+ minimum: 1+ name: limit+ type: integer+ produces:+ - application/json+ responses:+ "200":+ description: OK+ schema:+ $ref: "#/definitions/responses.BillingUsagesResponse"+ "400":+ description: Bad Request+ schema:+ $ref: "#/definitions/responses.BadRequest"+ "401":+ description: Unauthorized+ schema:+ $ref: "#/definitions/responses.Unauthorized"+ "422":+ description: Unprocessable Entity+ schema:+ $ref: "#/definitions/responses.UnprocessableEntity"+ "500":+ description: Internal Server Error+ schema:+ $ref: "#/definitions/responses.InternalServerError"+ security:+ - ApiKeyAuth: []+ summary: Get billing usage history.+ tags:+ - Billing+ /bulk-messages:+ post:+ consumes:+ - application/json+ description: Sends bulk SMS messages to multiple users from a CSV file.+ produces:+ - application/json+ responses:+ "202":+ description: Accepted+ schema:+ $ref: "#/definitions/responses.NoContent"+ "400":+ description: Bad Request+ schema:+ $ref: "#/definitions/responses.BadRequest"+ "401":+ description: Unauthorized+ schema:+ $ref: "#/definitions/responses.Unauthorized"+ "422":+ description: Unprocessable Entity+ schema:+ $ref: "#/definitions/responses.UnprocessableEntity"+ "500":+ description: Internal Server Error+ schema:+ $ref: "#/definitions/responses.InternalServerError"+ security:+ - ApiKeyAuth: []+ summary: Store bulk SMS file+ tags:+ - BulkSMS+ /discord-integrations:+ get:+ consumes:+ - application/json+ description: Get the discord integrations of a user+ parameters:+ - description: number of discord integrations to skip+ in: query+ minimum: 0+ name: skip+ type: integer+ - description: filter discord integrations containing query+ in: query+ name: query+ type: string+ - description: number of discord integrations to return+ in: query+ maximum: 20+ minimum: 1+ name: limit+ type: integer+ produces:+ - application/json+ responses:+ "200":+ description: OK+ schema:+ $ref: "#/definitions/responses.DiscordsResponse"+ "400":+ description: Bad Request+ schema:+ $ref: "#/definitions/responses.BadRequest"+ "401":+ description: Unauthorized+ schema:+ $ref: "#/definitions/responses.Unauthorized"+ "422":+ description: Unprocessable Entity+ schema:+ $ref: "#/definitions/responses.UnprocessableEntity"+ "500":+ description: Internal Server Error+ schema:+ $ref: "#/definitions/responses.InternalServerError"+ security:+ - ApiKeyAuth: []+ summary: Get discord integrations of a user+ tags:+ - DiscordIntegration+ post:+ consumes:+ - application/json+ description: Store a discord integration for the authenticated user+ parameters:+ - description: Payload of the discord integration request+ in: body+ name: payload+ required: true+ schema:+ $ref: "#/definitions/requests.DiscordStore"+ produces:+ - application/json+ responses:+ "201":+ description: Created+ schema:+ $ref: "#/definitions/responses.DiscordResponse"+ "400":+ description: Bad Request+ schema:+ $ref: "#/definitions/responses.BadRequest"+ "401":+ description: Unauthorized+ schema:+ $ref: "#/definitions/responses.Unauthorized"+ "422":+ description: Unprocessable Entity+ schema:+ $ref: "#/definitions/responses.UnprocessableEntity"+ "500":+ description: Internal Server Error+ schema:+ $ref: "#/definitions/responses.InternalServerError"+ security:+ - ApiKeyAuth: []+ summary: Store discord integration+ tags:+ - DiscordIntegration+ /discord-integrations/{discordID}:+ delete:+ consumes:+ - application/json+ description: Delete a discord integration for a user+ parameters:+ - default: 32343a19-da5e-4b1b-a767-3298a73703ca+ description: ID of the discord integration+ in: path+ name: discordID+ required: true+ type: string+ produces:+ - application/json+ responses:+ "204":+ description: No Content+ schema:+ $ref: "#/definitions/responses.NoContent"+ "400":+ description: Bad Request+ schema:+ $ref: "#/definitions/responses.BadRequest"+ "401":+ description: Unauthorized+ schema:+ $ref: "#/definitions/responses.Unauthorized"+ "422":+ description: Unprocessable Entity+ schema:+ $ref: "#/definitions/responses.UnprocessableEntity"+ "500":+ description: Internal Server Error+ schema:+ $ref: "#/definitions/responses.InternalServerError"+ security:+ - ApiKeyAuth: []+ summary: Delete discord integration+ tags:+ - Webhooks+ put:+ consumes:+ - application/json+ description: Update a discord integration for the currently authenticated user+ parameters:+ - default: 32343a19-da5e-4b1b-a767-3298a73703ca+ description: ID of the discord integration+ in: path+ name: discordID+ required: true+ type: string+ - description: Payload of discord integration to update+ in: body+ name: payload+ required: true+ schema:+ $ref: "#/definitions/requests.DiscordUpdate"+ produces:+ - application/json+ responses:+ "200":+ description: OK+ schema:+ $ref: "#/definitions/responses.DiscordResponse"+ "400":+ description: Bad Request+ schema:+ $ref: "#/definitions/responses.BadRequest"+ "401":+ description: Unauthorized+ schema:+ $ref: "#/definitions/responses.Unauthorized"+ "422":+ description: Unprocessable Entity+ schema:+ $ref: "#/definitions/responses.UnprocessableEntity"+ "500":+ description: Internal Server Error+ schema:+ $ref: "#/definitions/responses.InternalServerError"+ security:+ - ApiKeyAuth: []+ summary: Update a discord integration+ tags:+ - DiscordIntegration+ /discord/event:+ post:+ consumes:+ - application/json+ description: Publish a discord event to the registered listeners+ produces:+ - application/json+ responses:+ "204":+ description: No Content+ schema:+ $ref: "#/definitions/responses.NoContent"+ "400":+ description: Bad Request+ schema:+ $ref: "#/definitions/responses.BadRequest"+ "401":+ description: Unauthorized+ schema:+ $ref: "#/definitions/responses.Unauthorized"+ "422":+ description: Unprocessable Entity+ schema:+ $ref: "#/definitions/responses.UnprocessableEntity"+ "500":+ description: Internal Server Error+ schema:+ $ref: "#/definitions/responses.InternalServerError"+ summary: Consume a discord event+ tags:+ - Discord+ /heartbeats:+ get:+ consumes:+ - application/json+ description:+ Get the last time a phone number requested for outstanding messages.+ It will be sorted by timestamp in descending order.+ parameters:+ - default: "+18005550199"+ description: the owner's phone number+ in: query+ name: owner+ required: true+ type: string+ - description: number of heartbeats to skip+ in: query+ minimum: 0+ name: skip+ type: integer+ - description: filter containing query+ in: query+ name: query+ type: string+ - description: number of heartbeats to return+ in: query+ maximum: 20+ minimum: 1+ name: limit+ type: integer+ produces:+ - application/json+ responses:+ "200":+ description: OK+ schema:+ $ref: "#/definitions/responses.HeartbeatsResponse"+ "400":+ description: Bad Request+ schema:+ $ref: "#/definitions/responses.BadRequest"+ "401":+ description: Unauthorized+ schema:+ $ref: "#/definitions/responses.Unauthorized"+ "422":+ description: Unprocessable Entity+ schema:+ $ref: "#/definitions/responses.UnprocessableEntity"+ "500":+ description: Internal Server Error+ schema:+ $ref: "#/definitions/responses.InternalServerError"+ security:+ - ApiKeyAuth: []+ summary: Get heartbeats of an owner phone number+ tags:+ - Heartbeats+ post:+ consumes:+ - application/json+ description:+ Store the heartbeat to make notify that a phone number is still+ active+ parameters:+ - description: Payload of the heartbeat request+ in: body+ name: payload+ required: true+ schema:+ $ref: "#/definitions/requests.HeartbeatStore"+ produces:+ - application/json+ responses:+ "200":+ description: OK+ schema:+ $ref: "#/definitions/responses.HeartbeatResponse"+ "400":+ description: Bad Request+ schema:+ $ref: "#/definitions/responses.BadRequest"+ "401":+ description: Unauthorized+ schema:+ $ref: "#/definitions/responses.Unauthorized"+ "422":+ description: Unprocessable Entity+ schema:+ $ref: "#/definitions/responses.UnprocessableEntity"+ "500":+ description: Internal Server Error+ schema:+ $ref: "#/definitions/responses.InternalServerError"+ security:+ - ApiKeyAuth: []+ summary: Register heartbeat of an owner phone number+ tags:+ - Heartbeats+ /integration/3cx/messages:+ post:+ consumes:+ - application/json+ description: Sends an SMS message from the 3CX platform+ produces:+ - application/json+ responses:+ "204":+ description: No Content+ schema:+ $ref: "#/definitions/responses.NoContent"+ "400":+ description: Bad Request+ schema:+ $ref: "#/definitions/responses.BadRequest"+ "401":+ description: Unauthorized+ schema:+ $ref: "#/definitions/responses.Unauthorized"+ "422":+ description: Unprocessable Entity+ schema:+ $ref: "#/definitions/responses.UnprocessableEntity"+ "500":+ description: Internal Server Error+ schema:+ $ref: "#/definitions/responses.InternalServerError"+ summary: Sends a 3CX SMS message+ tags:+ - 3CXIntegration+ /lemonsqueezy/event:+ post:+ consumes:+ - application/json+ description: Publish a lemonsqueezy event to the registered listeners+ produces:+ - application/json+ responses:+ "204":+ description: No Content+ schema:+ $ref: "#/definitions/responses.NoContent"+ "400":+ description: Bad Request+ schema:+ $ref: "#/definitions/responses.BadRequest"+ "401":+ description: Unauthorized+ schema:+ $ref: "#/definitions/responses.Unauthorized"+ "422":+ description: Unprocessable Entity+ schema:+ $ref: "#/definitions/responses.UnprocessableEntity"+ "500":+ description: Internal Server Error+ schema:+ $ref: "#/definitions/responses.InternalServerError"+ summary: Consume a lemonsqueezy event+ tags:+ - Lemonsqueezy+ /message-threads:+ get:+ consumes:+ - application/json+ description:+ Get list of contacts which a phone number has communicated with+ (threads). It will be sorted by timestamp in descending order.+ parameters:+ - default: "+18005550199"+ description: owner phone number+ in: query+ name: owner+ required: true+ type: string+ - description: number of messages to skip+ in: query+ minimum: 0+ name: skip+ type: integer+ - description: filter message threads containing query+ in: query+ name: query+ type: string+ - description: number of messages to return+ in: query+ maximum: 20+ minimum: 1+ name: limit+ type: integer+ produces:+ - application/json+ responses:+ "200":+ description: OK+ schema:+ $ref: "#/definitions/responses.MessageThreadsResponse"+ "400":+ description: Bad Request+ schema:+ $ref: "#/definitions/responses.BadRequest"+ "401":+ description: Unauthorized+ schema:+ $ref: "#/definitions/responses.Unauthorized"+ "422":+ description: Unprocessable Entity+ schema:+ $ref: "#/definitions/responses.UnprocessableEntity"+ "500":+ description: Internal Server Error+ schema:+ $ref: "#/definitions/responses.InternalServerError"+ security:+ - ApiKeyAuth: []+ summary: Get message threads for a phone number+ tags:+ - Channel Threads+ /message-threads/{messageThreadID}:+ put:+ consumes:+ - application/json+ description: Updates the details of a message thread+ parameters:+ - default: 32343a19-da5e-4b1b-a767-3298a73703ca+ description: ID of the message thread+ in: path+ name: messageThreadID+ required: true+ type: string+ - description: Payload of message thread details to update+ in: body+ name: payload+ required: true+ schema:+ $ref: "#/definitions/requests.MessageThreadUpdate"+ produces:+ - application/json+ responses:+ "200":+ description: OK+ schema:+ $ref: "#/definitions/responses.PhoneResponse"+ "400":+ description: Bad Request+ schema:+ $ref: "#/definitions/responses.BadRequest"+ "401":+ description: Unauthorized+ schema:+ $ref: "#/definitions/responses.Unauthorized"+ "422":+ description: Unprocessable Entity+ schema:+ $ref: "#/definitions/responses.UnprocessableEntity"+ "500":+ description: Internal Server Error+ schema:+ $ref: "#/definitions/responses.InternalServerError"+ security:+ - ApiKeyAuth: []+ summary: Update a message thread+ tags:+ - Channel Threads+ /messages:+ get:+ consumes:+ - application/json+ description:+ Get list of messages which are sent between 2 phone numbers. It+ will be sorted by timestamp in descending order.+ parameters:+ - default: "+18005550199"+ description: the owner's phone number+ in: query+ name: owner+ required: true+ type: string+ - default: "+18005550100"+ description: the contact's phone number+ in: query+ name: contact+ required: true+ type: string+ - description: number of messages to skip+ in: query+ minimum: 0+ name: skip+ type: integer+ - description: filter messages containing query+ in: query+ name: query+ type: string+ - description: number of messages to return+ in: query+ maximum: 20+ minimum: 1+ name: limit+ type: integer+ produces:+ - application/json+ responses:+ "200":+ description: OK+ schema:+ $ref: "#/definitions/responses.MessagesResponse"+ "400":+ description: Bad Request+ schema:+ $ref: "#/definitions/responses.BadRequest"+ "401":+ description: Unauthorized+ schema:+ $ref: "#/definitions/responses.Unauthorized"+ "422":+ description: Unprocessable Entity+ schema:+ $ref: "#/definitions/responses.UnprocessableEntity"+ "500":+ description: Internal Server Error+ schema:+ $ref: "#/definitions/responses.InternalServerError"+ security:+ - ApiKeyAuth: []+ summary: Get messages which are sent between 2 phone numbers+ tags:+ - Messages+ /messages/{messageID}/events:+ post:+ consumes:+ - application/json+ description:+ Use this endpoint to send events for a message when it is failed,+ sent or delivered by the mobile phone.+ parameters:+ - default: 32343a19-da5e-4b1b-a767-3298a73703ca+ description: ID of the message+ in: path+ name: messageID+ required: true+ type: string+ - description: Payload of the event emitted.+ in: body+ name: payload+ required: true+ schema:+ $ref: "#/definitions/requests.MessageEvent"+ produces:+ - application/json+ responses:+ "200":+ description: OK+ schema:+ $ref: "#/definitions/responses.MessageResponse"+ "400":+ description: Bad Request+ schema:+ $ref: "#/definitions/responses.BadRequest"+ "401":+ description: Unauthorized+ schema:+ $ref: "#/definitions/responses.Unauthorized"+ "404":+ description: Not Found+ schema:+ $ref: "#/definitions/responses.NotFound"+ "422":+ description: Unprocessable Entity+ schema:+ $ref: "#/definitions/responses.UnprocessableEntity"+ "500":+ description: Internal Server Error+ schema:+ $ref: "#/definitions/responses.InternalServerError"+ security:+ - ApiKeyAuth: []+ summary: Upsert an event for a message on the mobile phone+ tags:+ - Messages+ /messages/bulk-send:+ post:+ consumes:+ - application/json+ description: Add bulk SMS messages to be sent by the android phone+ parameters:+ - description: Bulk send message request payload+ in: body+ name: payload+ required: true+ schema:+ $ref: "#/definitions/requests.MessageBulkSend"+ produces:+ - application/json+ responses:+ "200":+ description: OK+ schema:+ items:+ $ref: "#/definitions/responses.MessagesResponse"+ type: array+ "400":+ description: Bad Request+ schema:+ $ref: "#/definitions/responses.BadRequest"+ "401":+ description: Unauthorized+ schema:+ $ref: "#/definitions/responses.Unauthorized"+ "422":+ description: Unprocessable Entity+ schema:+ $ref: "#/definitions/responses.UnprocessableEntity"+ "500":+ description: Internal Server Error+ schema:+ $ref: "#/definitions/responses.InternalServerError"+ security:+ - ApiKeyAuth: []+ summary: Send bulk SMS messages+ tags:+ - Messages+ /messages/outstanding:+ get:+ consumes:+ - application/json+ description: Get an outstanding message to be sent by an android phone+ parameters:+ - default: 32343a19-da5e-4b1b-a767-3298a73703cb+ description: The ID of the message+ in: query+ name: message_id+ required: true+ type: string+ produces:+ - application/json+ responses:+ "200":+ description: OK+ schema:+ $ref: "#/definitions/responses.MessageResponse"+ "400":+ description: Bad Request+ schema:+ $ref: "#/definitions/responses.BadRequest"+ "401":+ description: Unauthorized+ schema:+ $ref: "#/definitions/responses.Unauthorized"+ "422":+ description: Unprocessable Entity+ schema:+ $ref: "#/definitions/responses.UnprocessableEntity"+ "500":+ description: Internal Server Error+ schema:+ $ref: "#/definitions/responses.InternalServerError"+ security:+ - ApiKeyAuth: []+ summary: Get an outstanding message+ tags:+ - Messages+ /messages/receive:+ post:+ consumes:+ - application/json+ description: Add a new message received from a mobile phone+ parameters:+ - description: Received message request payload+ in: body+ name: payload+ required: true+ schema:+ $ref: "#/definitions/requests.MessageReceive"+ produces:+ - application/json+ responses:+ "200":+ description: OK+ schema:+ $ref: "#/definitions/responses.MessageResponse"+ "400":+ description: Bad Request+ schema:+ $ref: "#/definitions/responses.BadRequest"+ "422":+ description: Unprocessable Entity+ schema:+ $ref: "#/definitions/responses.UnprocessableEntity"+ "500":+ description: Internal Server Error+ schema:+ $ref: "#/definitions/responses.InternalServerError"+ security:+ - ApiKeyAuth: []+ summary: Receive a new SMS message from a mobile phone+ tags:+ - Messages+ /messages/send:+ post:+ consumes:+ - application/json+ description: Add a new SMS message to be sent by the android phone+ parameters:+ - description: PostSend message request payload+ in: body+ name: payload+ required: true+ schema:+ $ref: "#/definitions/requests.MessageSend"+ produces:+ - application/json+ responses:+ "200":+ description: OK+ schema:+ $ref: "#/definitions/responses.MessageResponse"+ "400":+ description: Bad Request+ schema:+ $ref: "#/definitions/responses.BadRequest"+ "401":+ description: Unauthorized+ schema:+ $ref: "#/definitions/responses.Unauthorized"+ "422":+ description: Unprocessable Entity+ schema:+ $ref: "#/definitions/responses.UnprocessableEntity"+ "500":+ description: Internal Server Error+ schema:+ $ref: "#/definitions/responses.InternalServerError"+ security:+ - ApiKeyAuth: []+ summary: Send a new SMS message+ tags:+ - Messages+ /phones:+ get:+ consumes:+ - application/json+ description:+ Get list of phones which a user has registered on the http sms+ application+ parameters:+ - description: number of heartbeats to skip+ in: query+ minimum: 0+ name: skip+ type: integer+ - description: filter phones containing query+ in: query+ name: query+ type: string+ - description: number of phones to return+ in: query+ maximum: 20+ minimum: 1+ name: limit+ type: integer+ produces:+ - application/json+ responses:+ "200":+ description: OK+ schema:+ $ref: "#/definitions/responses.PhonesResponse"+ "400":+ description: Bad Request+ schema:+ $ref: "#/definitions/responses.BadRequest"+ "401":+ description: Unauthorized+ schema:+ $ref: "#/definitions/responses.Unauthorized"+ "422":+ description: Unprocessable Entity+ schema:+ $ref: "#/definitions/responses.UnprocessableEntity"+ "500":+ description: Internal Server Error+ schema:+ $ref: "#/definitions/responses.InternalServerError"+ security:+ - ApiKeyAuth: []+ summary: Get phones of a user+ tags:+ - Phones+ put:+ consumes:+ - application/json+ description:+ Updates properties of a user's phone. If the phone with this number+ does not exist, a new one will be created. Think of this method like an 'upsert'+ parameters:+ - description: Payload of new phone number.+ in: body+ name: payload+ required: true+ schema:+ $ref: "#/definitions/requests.PhoneUpsert"+ produces:+ - application/json+ responses:+ "200":+ description: OK+ schema:+ $ref: "#/definitions/responses.PhoneResponse"+ "400":+ description: Bad Request+ schema:+ $ref: "#/definitions/responses.BadRequest"+ "401":+ description: Unauthorized+ schema:+ $ref: "#/definitions/responses.Unauthorized"+ "422":+ description: Unprocessable Entity+ schema:+ $ref: "#/definitions/responses.UnprocessableEntity"+ "500":+ description: Internal Server Error+ schema:+ $ref: "#/definitions/responses.InternalServerError"+ security:+ - ApiKeyAuth: []+ summary: Upsert Phone+ tags:+ - Phones+ /phones/{phoneID}:+ delete:+ consumes:+ - application/json+ description: Delete a phone that has been sored in the database+ parameters:+ - default: 32343a19-da5e-4b1b-a767-3298a73703ca+ description: ID of the phone+ in: path+ name: phoneID+ required: true+ type: string+ produces:+ - application/json+ responses:+ "204":+ description: No Content+ schema:+ $ref: "#/definitions/responses.NoContent"+ "400":+ description: Bad Request+ schema:+ $ref: "#/definitions/responses.BadRequest"+ "401":+ description: Unauthorized+ schema:+ $ref: "#/definitions/responses.Unauthorized"+ "422":+ description: Unprocessable Entity+ schema:+ $ref: "#/definitions/responses.UnprocessableEntity"+ "500":+ description: Internal Server Error+ schema:+ $ref: "#/definitions/responses.InternalServerError"+ security:+ - ApiKeyAuth: []+ summary: Delete Phone+ tags:+ - Phones+ /users/{userID}/notifications:+ put:+ consumes:+ - application/json+ description: Update the email notification settings for a user+ parameters:+ - default: 32343a19-da5e-4b1b-a767-3298a73703ca+ description: ID of the user to update+ in: path+ name: userID+ required: true+ type: string+ - description: User notification details to update+ in: body+ name: payload+ required: true+ schema:+ $ref: "#/definitions/requests.UserNotificationUpdate"+ produces:+ - application/json+ responses:+ "200":+ description: OK+ schema:+ $ref: "#/definitions/responses.UserResponse"+ "400":+ description: Bad Request+ schema:+ $ref: "#/definitions/responses.BadRequest"+ "401":+ description: Unauthorized+ schema:+ $ref: "#/definitions/responses.Unauthorized"+ "422":+ description: Unprocessable Entity+ schema:+ $ref: "#/definitions/responses.UnprocessableEntity"+ "500":+ description: Internal Server Error+ schema:+ $ref: "#/definitions/responses.InternalServerError"+ security:+ - ApiKeyAuth: []+ summary: Update notification settings+ tags:+ - Users+ /users/me:+ get:+ consumes:+ - application/json+ description: Get details of the currently authenticated user+ produces:+ - application/json+ responses:+ "200":+ description: OK+ schema:+ $ref: "#/definitions/responses.UserResponse"+ "400":+ description: Bad Request+ schema:+ $ref: "#/definitions/responses.BadRequest"+ "401":+ description: Unauthorized+ schema:+ $ref: "#/definitions/responses.Unauthorized"+ "422":+ description: Unprocessable Entity+ schema:+ $ref: "#/definitions/responses.UnprocessableEntity"+ "500":+ description: Internal Server Error+ schema:+ $ref: "#/definitions/responses.InternalServerError"+ security:+ - ApiKeyAuth: []+ summary: Get current user+ tags:+ - Users+ put:+ consumes:+ - application/json+ description: Updates the details of the currently authenticated user+ parameters:+ - description: Payload of user details to update+ in: body+ name: payload+ required: true+ schema:+ $ref: "#/definitions/requests.UserUpdate"+ produces:+ - application/json+ responses:+ "200":+ description: OK+ schema:+ $ref: "#/definitions/responses.PhoneResponse"+ "400":+ description: Bad Request+ schema:+ $ref: "#/definitions/responses.BadRequest"+ "401":+ description: Unauthorized+ schema:+ $ref: "#/definitions/responses.Unauthorized"+ "422":+ description: Unprocessable Entity+ schema:+ $ref: "#/definitions/responses.UnprocessableEntity"+ "500":+ description: Internal Server Error+ schema:+ $ref: "#/definitions/responses.InternalServerError"+ security:+ - ApiKeyAuth: []+ summary: Update a user+ tags:+ - Users+ /users/subscription:+ delete:+ description: Cancel the subscription of the authenticated user.+ produces:+ - application/json+ responses:+ "200":+ description: OK+ schema:+ $ref: "#/definitions/responses.NoContent"+ "400":+ description: Bad Request+ schema:+ $ref: "#/definitions/responses.BadRequest"+ "401":+ description: Unauthorized+ schema:+ $ref: "#/definitions/responses.Unauthorized"+ "422":+ description: Unprocessable Entity+ schema:+ $ref: "#/definitions/responses.UnprocessableEntity"+ "500":+ description: Internal Server Error+ schema:+ $ref: "#/definitions/responses.InternalServerError"+ security:+ - ApiKeyAuth: []+ summary: Cancel the user's subscription+ tags:+ - Users+ /users/subscription-update-url:+ get:+ description: Fetches the subscription URL of the authenticated user.+ produces:+ - application/json+ responses:+ "200":+ description: OK+ schema:+ $ref: "#/definitions/responses.OkString"+ "400":+ description: Bad Request+ schema:+ $ref: "#/definitions/responses.BadRequest"+ "401":+ description: Unauthorized+ schema:+ $ref: "#/definitions/responses.Unauthorized"+ "422":+ description: Unprocessable Entity+ schema:+ $ref: "#/definitions/responses.UnprocessableEntity"+ "500":+ description: Internal Server Error+ schema:+ $ref: "#/definitions/responses.InternalServerError"+ security:+ - ApiKeyAuth: []+ summary: Currently authenticated user subscription update URL+ tags:+ - Users+ /webhooks:+ get:+ consumes:+ - application/json+ description: Get the webhooks of a user+ parameters:+ - description: number of webhooks to skip+ in: query+ minimum: 0+ name: skip+ type: integer+ - description: filter webhooks containing query+ in: query+ name: query+ type: string+ - description: number of webhooks to return+ in: query+ maximum: 20+ minimum: 1+ name: limit+ type: integer+ produces:+ - application/json+ responses:+ "200":+ description: OK+ schema:+ $ref: "#/definitions/responses.WebhooksResponse"+ "400":+ description: Bad Request+ schema:+ $ref: "#/definitions/responses.BadRequest"+ "401":+ description: Unauthorized+ schema:+ $ref: "#/definitions/responses.Unauthorized"+ "422":+ description: Unprocessable Entity+ schema:+ $ref: "#/definitions/responses.UnprocessableEntity"+ "500":+ description: Internal Server Error+ schema:+ $ref: "#/definitions/responses.InternalServerError"+ security:+ - ApiKeyAuth: []+ summary: Get webhooks of a user+ tags:+ - Webhooks+ post:+ consumes:+ - application/json+ description: Store a webhook for the authenticated user+ parameters:+ - description: Payload of the webhook request+ in: body+ name: payload+ required: true+ schema:+ $ref: "#/definitions/requests.WebhookStore"+ produces:+ - application/json+ responses:+ "200":+ description: OK+ schema:+ $ref: "#/definitions/responses.WebhookResponse"+ "400":+ description: Bad Request+ schema:+ $ref: "#/definitions/responses.BadRequest"+ "401":+ description: Unauthorized+ schema:+ $ref: "#/definitions/responses.Unauthorized"+ "422":+ description: Unprocessable Entity+ schema:+ $ref: "#/definitions/responses.UnprocessableEntity"+ "500":+ description: Internal Server Error+ schema:+ $ref: "#/definitions/responses.InternalServerError"+ security:+ - ApiKeyAuth: []+ summary: Store a webhook+ tags:+ - Webhooks+ /webhooks/{webhookID}:+ delete:+ consumes:+ - application/json+ description: Delete a webhook for a user+ parameters:+ - default: 32343a19-da5e-4b1b-a767-3298a73703ca+ description: ID of the webhook+ in: path+ name: webhookID+ required: true+ type: string+ produces:+ - application/json+ responses:+ "204":+ description: No Content+ schema:+ $ref: "#/definitions/responses.NoContent"+ "400":+ description: Bad Request+ schema:+ $ref: "#/definitions/responses.BadRequest"+ "401":+ description: Unauthorized+ schema:+ $ref: "#/definitions/responses.Unauthorized"+ "422":+ description: Unprocessable Entity+ schema:+ $ref: "#/definitions/responses.UnprocessableEntity"+ "500":+ description: Internal Server Error+ schema:+ $ref: "#/definitions/responses.InternalServerError"+ security:+ - ApiKeyAuth: []+ summary: Delete webhook+ tags:+ - Webhooks+ put:+ consumes:+ - application/json+ description: Update a webhook for the currently authenticated user+ parameters:+ - default: 32343a19-da5e-4b1b-a767-3298a73703ca+ description: ID of the webhook+ in: path+ name: webhookID+ required: true+ type: string+ - description: Payload of webhook details to update+ in: body+ name: payload+ required: true+ schema:+ $ref: "#/definitions/requests.WebhookUpdate"+ produces:+ - application/json+ responses:+ "200":+ description: OK+ schema:+ $ref: "#/definitions/responses.WebhookResponse"+ "400":+ description: Bad Request+ schema:+ $ref: "#/definitions/responses.BadRequest"+ "401":+ description: Unauthorized+ schema:+ $ref: "#/definitions/responses.Unauthorized"+ "422":+ description: Unprocessable Entity+ schema:+ $ref: "#/definitions/responses.UnprocessableEntity"+ "500":+ description: Internal Server Error+ schema:+ $ref: "#/definitions/responses.InternalServerError"+ security:+ - ApiKeyAuth: []+ summary: Update a webhook+ tags:+ - Webhooks+schemes:+ - https+securityDefinitions:+ ApiKeyAuth:+ in: header+ name: x-api-Key+ type: apiKey+swagger: "2.0"