JavaScript
import Courier from '@trycourier/courier';
const client = new Courier({
apiKey: process.env['COURIER_API_KEY'], // This is the default and can be omitted
});
await client.profiles.update('user_id', {
patch: [
{
op: 'op',
path: 'path',
value: 'value',
},
],
});import os
from courier import Courier
client = Courier(
api_key=os.environ.get("COURIER_API_KEY"), # This is the default and can be omitted
)
client.profiles.update(
user_id="user_id",
patch=[{
"op": "op",
"path": "path",
"value": "value",
}],
)package main
import (
"context"
"github.com/trycourier/courier-go"
"github.com/trycourier/courier-go/option"
)
func main() {
client := courier.NewClient(
option.WithAPIKey("My API Key"),
)
err := client.Profiles.Update(
context.TODO(),
"user_id",
courier.ProfileUpdateParams{
Patch: []courier.ProfileUpdateParamsPatch{{
Op: "op",
Path: "path",
Value: "value",
}},
},
)
if err != nil {
panic(err.Error())
}
}package com.courier.example;
import com.courier.client.CourierClient;
import com.courier.client.okhttp.CourierOkHttpClient;
import com.courier.models.profiles.ProfileUpdateParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
CourierClient client = CourierOkHttpClient.fromEnv();
ProfileUpdateParams params = ProfileUpdateParams.builder()
.userId("user_id")
.addPatch(ProfileUpdateParams.Patch.builder()
.op("op")
.path("path")
.value("value")
.build())
.build();
client.profiles().update(params);
}
}require "courier"
courier = Courier::Client.new(api_key: "My API Key")
result = courier.profiles.update("user_id", patch: [{op: "op", path: "path", value: "value"}])
puts(result)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Courier\Client;
use Courier\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('COURIER_API_KEY') ?: 'My API Key');
try {
$result = $client->profiles->update(
'user_id', patch: [['op' => 'op', 'path' => 'path', 'value' => 'value']]
);
var_dump($result);
} catch (APIException $e) {
echo $e->getMessage();
}using TryCourier;
using TryCourier.Models.Profiles;
CourierClient client = new();
ProfileUpdateParams parameters = new()
{
UserID = "user_id",
Patch =
[
new()
{
Op = "op",
Path = "path",
Value = "value",
},
],
};
await client.Profiles.Update(parameters);courier profiles update \
--api-key 'My API Key' \
--user-id user_id \
--patch '{op: op, path: path, value: value}'curl --request PATCH \
--url https://api.courier.com/profiles/{user_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"patch": [
{
"op": "<string>",
"path": "<string>",
"value": "<string>"
}
]
}
'User Profiles
Update a profile
PATCH
/
profiles
/
{user_id}
JavaScript
import Courier from '@trycourier/courier';
const client = new Courier({
apiKey: process.env['COURIER_API_KEY'], // This is the default and can be omitted
});
await client.profiles.update('user_id', {
patch: [
{
op: 'op',
path: 'path',
value: 'value',
},
],
});import os
from courier import Courier
client = Courier(
api_key=os.environ.get("COURIER_API_KEY"), # This is the default and can be omitted
)
client.profiles.update(
user_id="user_id",
patch=[{
"op": "op",
"path": "path",
"value": "value",
}],
)package main
import (
"context"
"github.com/trycourier/courier-go"
"github.com/trycourier/courier-go/option"
)
func main() {
client := courier.NewClient(
option.WithAPIKey("My API Key"),
)
err := client.Profiles.Update(
context.TODO(),
"user_id",
courier.ProfileUpdateParams{
Patch: []courier.ProfileUpdateParamsPatch{{
Op: "op",
Path: "path",
Value: "value",
}},
},
)
if err != nil {
panic(err.Error())
}
}package com.courier.example;
import com.courier.client.CourierClient;
import com.courier.client.okhttp.CourierOkHttpClient;
import com.courier.models.profiles.ProfileUpdateParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
CourierClient client = CourierOkHttpClient.fromEnv();
ProfileUpdateParams params = ProfileUpdateParams.builder()
.userId("user_id")
.addPatch(ProfileUpdateParams.Patch.builder()
.op("op")
.path("path")
.value("value")
.build())
.build();
client.profiles().update(params);
}
}require "courier"
courier = Courier::Client.new(api_key: "My API Key")
result = courier.profiles.update("user_id", patch: [{op: "op", path: "path", value: "value"}])
puts(result)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Courier\Client;
use Courier\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('COURIER_API_KEY') ?: 'My API Key');
try {
$result = $client->profiles->update(
'user_id', patch: [['op' => 'op', 'path' => 'path', 'value' => 'value']]
);
var_dump($result);
} catch (APIException $e) {
echo $e->getMessage();
}using TryCourier;
using TryCourier.Models.Profiles;
CourierClient client = new();
ProfileUpdateParams parameters = new()
{
UserID = "user_id",
Patch =
[
new()
{
Op = "op",
Path = "path",
Value = "value",
},
],
};
await client.Profiles.Update(parameters);courier profiles update \
--api-key 'My API Key' \
--user-id user_id \
--patch '{op: op, path: path, value: value}'curl --request PATCH \
--url https://api.courier.com/profiles/{user_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"patch": [
{
"op": "<string>",
"path": "<string>",
"value": "<string>"
}
]
}
'Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
A unique identifier representing the user associated with the requested user profile.
Body
application/json
List of patch operations to apply to the profile.
Show child attributes
Show child attributes
Response
204 - undefined
⌘I