(PUT) Update/Upsert partners
Update existing partners or create new ones with upsert operations.
Endpoint
PUT /partners
Upsert (update or insert) one or more partners. If id is provided, the partner is updated. If the ID does not exist, the request fails. To create new partners, omit the id field.
PUT /partnersAuthentication
Requires authentication with an API key that has the partnersWrite scope.
Request Body
The request body must be an array of partner objects. Include the id field to update an existing partner, or omit it to create a new one.
You can upsert up to 10,000 partners in a single request. Requests above 10,000 items are rejected.
Update Behavior
When updating, include at least one mutable field besides id. Only the fields you include are changed. Omitted fields keep their current values. Null contact fields are accepted only when the same insert or update payload also provides at least one non-null contact value.
Request Size
Ensure the request body contains at least one partner object.
Examples
curl -X PUT "https://api.hoko.to/partners" \
-H "Authorization: Bearer <API_KEY>" \
-H "Content-Type: application/json" \
-d '[
{
"id": "<partner_id>",
"name": "Updated Partner",
"email": "updated@example.com"
}
]'const response = await fetch('https://api.hoko.to/partners', {
method: 'PUT',
headers: {
Authorization: 'Bearer <API_KEY>',
'Content-Type': 'application/json'
},
body: JSON.stringify([
{
id: '<partner_id>',
name: 'Updated Partner',
email: 'updated@example.com'
}
])
});
const partners = await response.json();[
{
"id": "<partner_id>",
"name": "Updated Partner",
"email": "updated@example.com",
"phone": null,
"createdAt": "2024-01-01T00:00:00Z",
"updatedAt": "2024-01-01T00:00:00Z"
}
]