(POST) Create partners
Create one or more partners. Each partner requires a name.
Endpoint
POST /api/partners
Create one or more partners. Accepts an array of partner objects. Each partner requires a name. Email and phone are optional.
Endpoint text
POST /api/partnersAuthentication
Requires authentication with an API key that has the partnersWrite scope.
Request Body
The request body must be an array of partner objects. Each object represents one partner to create.
You can create up to 10,000 partners in a single request. Requests above 10,000 items are rejected.
| Parameter | Type | Required | Description |
|---|---|---|---|
name (body) | string | Yes | The name of the partner. |
email (body) | string (email) | No | Email address of the partner. |
phone (body) | string | No | Phone number of the partner. |
Request Size
Ensure the request body contains at least one partner object.
Examples
Request cURL
curl -X POST "https://hoko.to/api/partners" \
-H "Authorization: Bearer <API_KEY>" \
-H "Content-Type: application/json" \
-d '[
{
"name": "Partner Name",
"email": "partner@example.com",
"phone": "+1234567890"
}
]'Request JavaScript
const response = await fetch("https://hoko.to/api/partners", {
method: "POST",
headers: {
"Authorization": "Bearer <API_KEY>",
"Content-Type": "application/json"
},
body: JSON.stringify([
{
name: "Partner Name",
email: "partner@example.com",
phone: "+1234567890"
}
])
});
const partners = await response.json();Response json
[
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Partner Name",
"email": "partner@example.com",
"phone": "+1234567890",
"createdAt": "2024-01-01T00:00:00Z",
"updatedAt": "2024-01-01T00:00:00Z"
}
]