AlertsCreate a contract alertpost

Create a contract alert

Magic create endpoint. Provide an alert kind and either params or inlined per-kind keys. The service derives fires_at, defaults recipients to the contract creator, and defaults the channel to…

curl -X POST "https://api.textmine.com/v3/legislate/contracts/123/alerts" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_TOKEN (`tm_<key>`)" \
  -d '{
  "kind": "before_termination",
  "name": "Notify before termination window",
  "params": {
    "days": 30
  },
  "channel": "email"
}'
{
  "id": 222,
  "contract_id": 67890,
  "kind": "before_termination",
  "name": "John Doe",
  "params": {},
  "recipients": [
    {
      "user_id": 123,
      "email": "user@example.com"
    }
  ],
  "channel": "email",
  "status": "scheduled",
  "fires_at": "2024-12-25T10:00:00Z",
  "fired_at": "2024-12-25T10:00:00Z",
  "error": "example_string",
  "created_at": "2024-12-25T10:00:00Z",
  "created_by_id": 123
}
POST
/v3/legislate/contracts/{contractId}/alerts
POST
Base URLstring

Target server for requests. Edit to use your own host.

Bearer Token (`tm_<key>`)
Bearer Tokenstring
Required

Use Authorization: Bearer tm_<key> for API-key access to /v3/** endpoints. V3 also accepts Auth0 JWT and HTTP Basic for user-session contexts.

Use Authorization: Bearer tm_<key> for API-key access to /v3/** endpoints. V3 also accepts Auth0 JWT and HTTP Basic for user-session contexts.
path
contractIdinteger
Required

Legislate contract ID.

Format: int64
Content-Typestring
Required

The media type of the request body

Options: application/json
Request Preview
Response

Response will appear here after sending the request

Authentication

header
Authorizationstring
Required

Bearer token (tm_<key>). Use Authorization: Bearer tm_<key> for API-key access to /v3/** endpoints. V3 also accepts Auth0 JWT and HTTP Basic for user-session contexts.

Path Parameters

contractIdinteger
Required

Legislate contract ID.

Body

application/json
kindstring
Required
Example:
before_termination
namestring
Example:
Notify before termination window
paramsobject
Example:
{"days":30}
recipientsarray
channelstring
Example:
email

Responses

Magic create endpoint. Provide an alert kind and either params or inlined per-kind keys. The service derives fires_at, defaults recipients to the contract creator, and defaults the channel to email.