https://api.revreply.com/v1/users
This endpoint requires authentication.
Try it
Use the following request to create a user:- cURL
- JavaScript
- Python
- PHP
- Go
curl -X POST "https://api.revreply.com/v1/users" \
-H "Authorization: Bearer <YOUR_JWT>" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"first_name": "John",
"last_name": "Doe",
"email": "john@example.com",
"company": "Acme Inc.",
"timezone": "America/New_York"
}'
const response = await fetch(
"https://api.revreply.com/v1/users",
{
method: "POST",
headers: {
"Authorization": "Bearer <YOUR_JWT>",
"Accept": "application/json",
"Content-Type": "application/json"
},
body: JSON.stringify({
first_name: "John",
last_name: "Doe",
email: "john@example.com",
company: "Acme Inc.",
timezone: "America/New_York"
})
}
);
const data = await response.json();
console.log(data);
import requests
response = requests.post(
"https://api.revreply.com/v1/users",
headers={
"Authorization": "Bearer <YOUR_JWT>",
"Accept": "application/json",
"Content-Type": "application/json",
},
json={
"first_name": "John",
"last_name": "Doe",
"email": "john@example.com",
"company": "Acme Inc.",
"timezone": "America/New_York",
},
)
data = response.json()
print(data)
<?php
$ch = curl_init("https://api.revreply.com/v1/users");
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <YOUR_JWT>",
"Accept: application/json",
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode([
"first_name" => "John",
"last_name" => "Doe",
"email" => "john@example.com",
"company" => "Acme Inc.",
"timezone" => "America/New_York",
]),
CURLOPT_RETURNTRANSFER => true,
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
package main
import (
"bytes"
"fmt"
"net/http"
)
func main() {
body := []byte(`{
"first_name": "John",
"last_name": "Doe",
"email": "john@example.com",
"company": "Acme Inc.",
"timezone": "America/New_York"
}`)
req, _ := http.NewRequest(
"POST",
"https://api.revreply.com/v1/users",
bytes.NewBuffer(body),
)
req.Header.Set("Authorization", "Bearer <YOUR_JWT>")
req.Header.Set("Accept", "application/json")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
response, _ := client.Do(req)
fmt.Println(response.Status)
}
Authentication
This endpoint uses Bearer authentication with a JWT.Request
Headers
| Header | Type | Required | Description |
|---|---|---|---|
Authorization | string | Yes | Bearer token used to authenticate the request. |
Accept | string | Yes | Specifies that the client expects the response in JSON format. |
Content-Type | string | Yes | Specifies that the request body is formatted as JSON. |
Authorization: Bearer <YOUR_JWT>
Accept: application/json
Content-Type: application/json
Body
The request body accepts the following fields:| Field | Type | Required | Description | Example |
|---|---|---|---|---|
first_name | string | Yes | User’s first name. Maximum length: 255 characters. | John |
last_name | string | Yes | User’s last name. Maximum length: 255 characters. | Doe |
email | string | Yes | User’s email address. Must be a valid email address and is limited to 255 characters. | john@example.com |
company | string | Yes | User’s company name. Maximum length: 255 characters. | Acme Inc. |
timezone | string | Yes | User’s timezone identifier. Maximum length: 100 characters. | America/New_York |
Request structure
{
"first_name": "John",
"last_name": "Doe",
"email": "john@example.com",
"company": "Acme Inc.",
"timezone": "America/New_York"
}
Request examples
The request is aPOST request to:
https://api.revreply.com/v1/users
Response
Response structure
A successful request returns an object indicating that the user was created successfully.| Field | Type | Required | Description |
|---|---|---|---|
success | integer | Yes | Indicates whether the operation was successful. The success value is 1. |
message | string | Yes | Message describing the result of the operation. |
Response example
{
"success": 1,
"message": "Operation completed successfully"
}
Errors
422 — Validation error
Returned when one or more request fields fail validation.{
"success": 0,
"message": "Validation failed",
"errors": {}
}