Skip to main content

PATCH /profiles/:recipient_id

Unlike a PUT request, a PATCH request will update only a portion of a recipient's profile. PATCH syntax is a little more complicated. Courier uses the JSON Patch syntax described below.

Imagine that we have a profile with an email and phone_number. We want to update only the email address.

"profile": {
"email": "",
"phone_number": "555-555-5555",

Our patch request body will be JSON. The first key in a JSON Patch object will be op, which stands for the operation you are to perform. This is assigned a value of add, remove, replace, move, copy, or test. We already have an email address present, so we will use replace.

We list the value to be replaced by pointing to it using the path key. This path takes a value pointing to the key we want to target. The path is built using "/" characters. Our email key is one level deep, so we will use "/email". We then have a value key that is assigned the value we want to replace our existing email with. The entire line looks like this:

{ "op": "replace", "path": "/email", "value": "" }

To send the PATCH request, we send an array with our JSON Patch objects.

[{ "op": "replace", "path": "/email", "value": "" }]

If you want to update multiple values, your patch will look like this:

{ "op": "replace", "path": "/email", "value": "" },
{ "op": "replace", "path": "/phone_number", "value": "" }

More Examples

The following types of requests will not change the body of an existing Profile:

// Empty Patch Array
"patch": []

The above will result with:

"status": "SUCCESS"

For more details about JSON Patch syntax:


Method: PATCH

Path Parameters

A unique identifier representing the recipient associated with the requested profile.

Body Parameters

An array of patch operations. Learn more
+ Show Properties


status: 200 OK


status: 400 Bad Request

A message describing the error that occurred.
[invalid_request_error] The type of error that occurred.

Request Example

curl --request PATCH \
--url \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '
"patch": [
"op": "replace",
"path": "/email",
"value": ""

Responses Example

"status": "SUCCESS"
"message": "Error Message",
"type": "invalid_request_error"