1. Home
  2. Docs
  3. Server API
  4. Updating subscriber information

Updating subscriber information

Updating subscriber information

To update subscriber information via the API, send an HTTP POST to this endpoint:

https://app.prompty.io/api/[SITE_ID]/subscribers/[SUB_ID]?api_token=[API_TOKEN]

Be sure to replace [SUB_ID] with the actual subscriber ID. Your payload should be in JSON format.

Currently, the following fields are supported for updates:

{
	"name": "Subscriber Name",
	"email": "[email protected]",
	"external_id": "1001"
}
			

Note: Whitespace is trimmed from either side of an external_id, but otherwise the value is stored exactly as it is given. For example, “0001” is not converted to “1”.

CURL example

curl -d '{"name":"SUBSCRIBER NAME", "email":"[email protected]", "external_id":"1001"}' -H "Content-Type: application/json" -X POST "https://app.prompty.io/api/[SITE_ID]/subscribers/21?api_token=[API_TOKEN]"

Example success response

{"status":"success","code":"OK","message":"The subscriber was successfully updated."}
			

Example error response

{"status":"error","code":"UPDATE_FAILED","message":"The subscriber could not be updated."}
			

Note: You will receive this error if the specified subscriber ID does not exist.

Was this article helpful to you? Yes No

How can we help?