message

Create a message.

Changed on

NOTE: When authenticating with a client token or basic auth, the request body must include "appid" referencing an application owned by the authenticated user. When authenticating with an application token, the application is derived from the token and any "appid" in the body is ignored.

post/message

Request

  • Base URL
    http://localhost
  • Auth
    • API key in header Authorization
    • or API key in header X-Gotify-Key
    • or API key in query parameter token
    • or API key in header Authorization
    • or API key in header X-Gotify-Key
    • or API key in query parameter token
    • or HTTP basic

Request body

appidinteger

The application id that send this message. Always set when returned via the API.

extrasobject

The extra data sent along the message.

The extra fields are stored in a key-value scheme. Only accepted in CreateMessage requests with application/json content-type.

The keys should be in the following format: <top-namespace>::[<sub-namespace>::]<action>

These namespaces are reserved and might be used in the official clients: gotify android ios web server client. Do not use them for other purposes.

messagestring required

The message. Markdown (excluding html) is allowed.

priorityinteger

The priority of the message. If unset, then the default priority of the application will be used.

titlestring

The title of the message.

Example request

{
  "appid": 5,
  "extras": {
    "home::appliances::lighting::on": {
      "brightness": 15
    },
    "home::appliances::thermostat::change_temperature": {
      "temperature": 23
    }
  },
  "message": "**Backup** was successfully finished.",
  "priority": 2,
  "title": "Backup"
}

Response

Ok

appidinteger required

The application id that send this message.

datestring date-time required

The date the message was created.

extrasobject

The extra data sent along the message.

The extra fields are stored in a key-value scheme. Only accepted in CreateMessage requests with application/json content-type.

The keys should be in the following format: <top-namespace>::[<sub-namespace>::]<action>

These namespaces are reserved and might be used in the official clients: gotify android ios web server client. Do not use them for other purposes.

idinteger required

The message id.

messagestring required

The message. Markdown (excluding html) is allowed.

priorityinteger

The priority of the message. If unset, then the default priority of the application will be used.

titlestring

The title of the message.

Example response

{
  "appid": 5,
  "date": "2018-02-27T19:36:10.5045044+01:00",
  "extras": {
    "home::appliances::lighting::on": {
      "brightness": 15
    },
    "home::appliances::thermostat::change_temperature": {
      "temperature": 23
    }
  },
  "id": 25,
  "message": "**Backup** was successfully finished.",
  "priority": 2,
  "title": "Backup"
}

Changes

    • info

      the endpoint scheme security basicAuth was added to the API

    • info

      the endpoint scheme security clientTokenAuthorizationHeader was added to the API

    • info

      the endpoint scheme security clientTokenHeader was added to the API

    • info

      the endpoint scheme security clientTokenQuery was added to the API

    • info

      the endpoint scheme security appTokenAuthorizationHeader was added to the API