create_alert

Create an alert.

Input fields

details (JSON)

A set of key value pairs that can be used to produce a translated alert message. Please contact Sentera for a list of available translation keys and dynamic data details.

expires_at (ISO8601DateTime)

The date and time the alert will expire. If not specified defaults to 6 weeks after the alert was created.

field_sentera_id (ID!)

The ID of the field this alert is associated with.

key (String)

A client-defined key.

message (String!)

Alert message. Maximum length is 65,535 characters.

name (String!)

Alert name. Maximum length is 255 characters.

url (Url)

A URL pointing to a page with more information about this alert.

Return fields

acknowledged_at (ISO8601DateTime)

Date and time this alert was acknowledged.

created_at (ISO8601DateTime!)

Date and time this alert was created.

created_by (User!)

The user that created this alert.

details (JSON)

Key value pairs to be used along with key data to generate language specific alert strings.

expires_at (ISO8601DateTime!)

The date and time when the alert is set to expire.

key (String)

A client-defined key. Can be used in combination with the details field to generate language specific alert strings.

message (String!)

Message for this alert.

name (String!)

Name for this alert.

sentera_id (ID!)

A system-generated key identifying a specific instance of an alert.

status (AlertStatusType!)

Status of this alert.

url (Url)

A URL pointing at more information about the alert.

Examples

Create Alert With Default Expiration

Creates an alert for a field. By default it expires in 6 weeks.

Try this example in GraphiQL
mutation CreateAlertExample {
  create_alert (
  field_sentera_id: "q1xgn9n_AS_SHORT1_CV_test_54364c66_190124_151245"
  name: "Southern Corn Rust Alert"
  message: "Current weather conditions indicate that this field is susceptible to southern corn rust."
  )
  {
  sentera_id
  name
  message
  created_by {
    sentera_id
    first_name
    last_name
    email
  }
  created_at
  expires_at
  }
}

{
  "data": {
  "create_alert": {
    "sentera_id": "stx6n84_FL_SHORT1_CV_test_db0cedc1_190124_154249",
    "name": "Southern Corn Rust Alert",
    "message": "Current weather conditions indicate that this field is susceptible to southern corn rust.",
    "created_by": {
      "sentera_id": "u2q30iq_US_SHORT1_CV_test_54364c66_190124_151242",
      "first_name": "Joe",
      "last_name": "Carlson",
      "email": "joe.carlson@example.com"
    },
    "created_at": "2026-03-24T17:11:37Z",
    "expires_at": "2026-05-05T17:11:37Z"
  }
  }
}

Create Alert With Expiration

Creates an alert for a field with a specific expiration date.

Try this example in GraphiQL
mutation CreateAlertExample {
  create_alert (
  field_sentera_id: "q1xgn9n_AS_SHORT1_CV_test_54364c66_190124_151245"
  name: "Corn Gray Leaf Spot Risk Alert"
  message: "On 2021-09-22 weather conditions were optimal for corn gray leaf spot, consider scheduling scouting activity within the next week to check for symptoms of corn gray leaf spot.",
  expires_at: "2026-03-31T17:11:37Z"
  )
  {
  sentera_id
  name
  message
  created_by {
    sentera_id
    first_name
    last_name
    email
  }
  created_at
  expires_at
  }
}

{
  "data": {
  "create_alert": {
    "sentera_id": "stx6n84_FL_SHORT1_CV_test_db0cedc1_190124_154249",
    "name": "Corn Gray Leaf Spot Risk Alert",
    "message": "On 2021-09-22 weather conditions were optimal for corn gray leaf spot, consider scheduling scouting activity within the next week to check for symptoms of corn gray leaf spot.",
    "created_by": {
      "sentera_id": "u2q30iq_US_SHORT1_CV_test_54364c66_190124_151242",
      "first_name": "Joe",
      "last_name": "Carlson",
      "email": "joe.carlson@example.com"
    },
    "created_at": "2026-03-24T17:11:37Z",
    "expires_at": "2026-03-31T17:11:37Z"
  }
  }
}

Support alert message translation.

By specifying a key and a set of name/value pairs in the details field you can support language specific alert text. The message field MUST contain a fallback English string for clients that don't support message translation.

Please contact Sentera for a list of available translation keys and dynamic data details.

Example translated to Spanish by google translate:

Según su fecha de siembra y el clima, esperamos que su maíz se acerque a la etapa de crecimiento V6 para el 19 de septiembre de 2020.

Try this example in GraphiQL
mutation CreateAlertExample {
  create_alert (
  field_sentera_id: "q1xgn9n_AS_SHORT1_CV_test_54364c66_190124_151245"
  name: "Growth Stage Alert"
  message: "Based on your planting date and weather, we expect your corn to be approaching the V6 growth stage by September 19, 2020."
  key: "alerts.crops.corn.growth_stage"
  details: [
    { name: "stage", value: "V6" },
    { name: "date", value: "2020-09-19" }
  ]
  )
  {
  sentera_id
  name
  message
  key
  details
  }
}

{
  "data": {
  "create_alert": {
    "sentera_id": "stx6n84_FL_SHORT1_CV_test_db0cedc1_190124_154249",
    "name": "Southern Corn Rust Alert",
    "message": "Based on your planting date and weather, we expect your corn to be approaching the V6 growth stage by September 19, 2020.",
    "key": "alerts.crops.corn.growth_stage",
    "details": [
      {
        "name": "stage",
        "value": "V6"
      },
      {
        "name": "date",
        "value": "2020-09-19"
      }
    ]
  }
  }
}