Skip to main content
GET
https://nostrapi.com
/
api
/
v1
/
dm
curl --location --request POST 'https://nostrapi.com/api/v1/dm' \
--header 'Content-Type: application/json' \
--header 'apikey: <YOUR_KEY_HERE>' \
--data-raw '{
    "relays": ["wss://nostr.zbd.gg", "wss://relay.damus.io"],
    "message": "this is super fun!",
    "address": "[email protected]",
    "when": 1685405495
}'
{
  "success": true,
  "message": "Successfully published e52941ffa7f9ef4749b6e230dc379f95003d7ba4840627e7b4931ffc57fc83f7 event."
}

Body

address
string
The address of the recipient of the message — can be a Nostr NIP05 address (e.g. [email protected]), or a Nostr public key in NPUB or HEX format.
message
string
The message you wish to send to the recipient.
relays
array
The array of relay URLs you wish to publish your message to.
when
number
If you want to schedule the message to be sent at a later time, you can pass a UNIX timestamp number here. If you do not pass this parameter, the message will be sent immediately.

Response

success
boolean
Indicates whether the call was successful. true if successful, false if not.
message
string
Message detailing the results of the operation.
curl --location --request POST 'https://nostrapi.com/api/v1/dm' \
--header 'Content-Type: application/json' \
--header 'apikey: <YOUR_KEY_HERE>' \
--data-raw '{
    "relays": ["wss://nostr.zbd.gg", "wss://relay.damus.io"],
    "message": "this is super fun!",
    "address": "[email protected]",
    "when": 1685405495
}'
{
  "success": true,
  "message": "Successfully published e52941ffa7f9ef4749b6e230dc379f95003d7ba4840627e7b4931ffc57fc83f7 event."
}