> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developers.jazzhq.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developers.jazzhq.ai/_mcp/server.

# Add users to a partner

POST https://api.jazzhq.ai/api/v1/vendors/partners/{partnerId}/users
Content-Type: application/json

Invites one or more additional people into a partner company that is already
connected to your vendor account. Each user is created and sent a portal invite
email.

This is all-or-nothing. Every email address is validated before anything is
written, so a single bad entry rejects the whole batch and no users are created.
A batch is rejected if any `emailAddress` already belongs to an existing user, or
if the same address appears more than once in the request.


Reference: https://developers.jazzhq.ai/api-reference/vendor-customer-ap-is/partner/add-partner-users

## Authentication

- `X-API-KEY` header (required) — Your vendor API key. Required on every request under /api/v1/vendors/**.

## Request

### Path parameters

- `partnerId` (long, required) — ID of the partner to add users to.

### Body (application/json)

This endpoint expects an AddPartnerUsersRequest.

- `users` (list of PartnerUserRequest, required)

## Response

### 200

Users invited successfully.

- `success` (boolean, optional)
- `message` (string, optional)
- `data` (list of PartnerUser, optional)
- `timestamp` (datetime, optional)

## Errors

### 400 Bad Request Error

The request was invalid: a required field was missing/malformed (`VALIDATION_FAILED`), the body wasn't valid JSON (`INVALID_REQUEST`), or one of the email addresses is already in use or duplicated within the request (`DUPLICATE_ENTRY`).

- `message` (string, optional) — Machine-readable error code. One of: VALIDATION_FAILED, INVALID_REQUEST, DUPLICATE_ENTRY, RESOURCE_NOT_FOUND, INVALID_STATE_TRANSITION, INTERNAL_SERVER_ERROR.
- `status` (integer, optional)
- `success` (boolean, optional)
- `errors` (list of ValidationErrorDetail, optional)
- `timestamp` (datetime, optional)

### 401 Unauthorized Error

Authentication failed - the X-API-KEY header was missing or invalid, or the request path is outside the /api/v1/vendors/ namespace this key is authorized for.

- `success` (boolean, optional)
- `message` (string, optional) — One of: API_KEY_MISSING, INVALID_API_KEY, UNKNOWN_API_NAMESPACE.
- `data` (AuthErrorResponseData, optional, nullable)
- `timestamp` (datetime, optional)

### 404 Not Found Error

No partner with this `partnerId` exists, or it isn't connected to your vendor account.

- `message` (string, optional) — Machine-readable error code. One of: VALIDATION_FAILED, INVALID_REQUEST, DUPLICATE_ENTRY, RESOURCE_NOT_FOUND, INVALID_STATE_TRANSITION, INTERNAL_SERVER_ERROR.
- `status` (integer, optional)
- `success` (boolean, optional)
- `errors` (list of ValidationErrorDetail, optional)
- `timestamp` (datetime, optional)

### 500 Internal Server Error

An unexpected error occurred.

- `message` (string, optional) — Machine-readable error code. One of: VALIDATION_FAILED, INVALID_REQUEST, DUPLICATE_ENTRY, RESOURCE_NOT_FOUND, INVALID_STATE_TRANSITION, INTERNAL_SERVER_ERROR.
- `status` (integer, optional)
- `success` (boolean, optional)
- `errors` (list of ValidationErrorDetail, optional)
- `timestamp` (datetime, optional)

## Types

### PartnerUserRequest

- `firstName` (string, required)
- `emailAddress` (string, required)
- `lastName` (string, optional, nullable)
- `phoneNumber` (string, optional, nullable)
- `jobTitle` (string, optional, nullable)

### PartnerUser

- `id` (long, optional)
- `firstName` (string, optional)
- `lastName` (string, optional, nullable)
- `emailAddress` (string, optional)
- `phoneNumber` (string, optional, nullable)
- `jobTitle` (string, optional, nullable)
- `lastActiveAt` (datetime, optional, nullable) — When this user was last active in the partner portal, updated at most once per 24 hours. Null means they have never signed in - i.e. the invite is still outstanding.

### ValidationErrorDetail

- `field` (string, optional) — Name of the request field this error relates to.
- `error` (string, optional) — Human-readable description of what's wrong.

### AuthErrorResponseData

## Examples

**Request**

```json
{
  "users": [
    {
      "firstName": "Jane",
      "emailAddress": "jane@acme.com"
    }
  ]
}
```

**Response**

```json
{
  "success": true,
  "message": "PARTNER_USERS_INVITE_SUCCESSFUL",
  "data": [
    {
      "id": 101,
      "firstName": "string",
      "lastName": "string",
      "emailAddress": "string",
      "phoneNumber": "string",
      "jobTitle": "string",
      "lastActiveAt": "2024-01-15T09:30:00Z"
    }
  ],
  "timestamp": "2024-01-15T09:30:00Z"
}
```

**SDK Code**

```python
import requests

url = "https://api.jazzhq.ai/api/v1/vendors/partners/1/users"

payload = { "users": [
        {
            "firstName": "Jane",
            "emailAddress": "jane@acme.com"
        }
    ] }
headers = {
    "X-API-KEY": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.jazzhq.ai/api/v1/vendors/partners/1/users';
const options = {
  method: 'POST',
  headers: {'X-API-KEY': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"users":[{"firstName":"Jane","emailAddress":"jane@acme.com"}]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.jazzhq.ai/api/v1/vendors/partners/1/users"

	payload := strings.NewReader("{\n  \"users\": [\n    {\n      \"firstName\": \"Jane\",\n      \"emailAddress\": \"jane@acme.com\"\n    }\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("X-API-KEY", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.jazzhq.ai/api/v1/vendors/partners/1/users")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"users\": [\n    {\n      \"firstName\": \"Jane\",\n      \"emailAddress\": \"jane@acme.com\"\n    }\n  ]\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.jazzhq.ai/api/v1/vendors/partners/1/users")
  .header("X-API-KEY", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"users\": [\n    {\n      \"firstName\": \"Jane\",\n      \"emailAddress\": \"jane@acme.com\"\n    }\n  ]\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.jazzhq.ai/api/v1/vendors/partners/1/users', [
  'body' => '{
  "users": [
    {
      "firstName": "Jane",
      "emailAddress": "jane@acme.com"
    }
  ]
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'X-API-KEY' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.jazzhq.ai/api/v1/vendors/partners/1/users");
var request = new RestRequest(Method.POST);
request.AddHeader("X-API-KEY", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"users\": [\n    {\n      \"firstName\": \"Jane\",\n      \"emailAddress\": \"jane@acme.com\"\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "X-API-KEY": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = ["users": [
    [
      "firstName": "Jane",
      "emailAddress": "jane@acme.com"
    ]
  ]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.jazzhq.ai/api/v1/vendors/partners/1/users")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```