How to Register Clients (People) Via API

Overview
The eAgenda platform API allows you to register clients (people) programmatically, adding information such as name, email, phone, and identification documents. This practical guide details how to send an HTTP POST request to the /api/v3/people/ endpoint and process the response. For more details, refer to the official eAgenda API documentation: https://eagenda.com.br/api/v3/documentation/#overview.
Environment Setup
Before getting started, you will need:
- API Key: Access the eAgenda dashboard to obtain your Bearer token (see the “How to Authenticate with the API” tutorial).
- HTTP request tool: Use cURL, Postman, or libraries such as requests (Python) or axios (JavaScript).
- Header configuration: Authentication is done via Bearer Token. Set the header Authorization: Bearer
and define Content-Type: application/json.
Tip: Refer to the authentication section in the API documentation to properly configure the token: https://eagenda.com.br/api/v3/documentation/#overview.
Client Data Definition
To register a client, send a JSON object in the request body with the following fields:
{
"name": "string",
"email": "email",
"phone": "string",
"identification_code": "string",
"identification_type": "string"
}
name (required)
- Description: Client’s full name.
- Constraints: 1 to 200 characters.
- Impact: Identifies the client in the system.
- Example: “John Smith”
email (optional)
- Description: Client’s email address.
- Impact: Used for notifications and unique identification.
- Example: “john.smith@example.com”
phone (optional)
- Description: Client’s phone number in E.164 format.
- Impact: Adds a phone contact for the client.
- Example: “+5511999999999”
identification_code (optional)
- Description: Client’s identification document number.
- Impact: Links the client to an official document.
- Example: “123.456.789-00”
identification_type (optional)
- Description: Type of identification document.
- Possible values: ar_dni, bo_ci, br_cpf, cl_run, co_cc, ec_ci, py_ci, pe_dni, uy_ci, ve_ci, ca_sin, mx_curp, us_ssn, jm_nin, gt_cui, hn_ci, cr_ci, do_ci, pa_ci, cn_ric, in_uid, id_nik, jp_myn, sa_id, kr_rrn, au_medicare, eg_nid, gh_card, ke_nin, ng_nin, za_id, ao_bi, mz_bi, de_personalausweis, es_dni_nie, fr_nir, it_cf, nl_bsn, pl_pesel, pt_nif_cc, se_personnummer, tr_tckn, uk_nin.
- Impact: Specifies the type of document provided in identification_code.
- Example: “br_cpf”
Note: The name field is required. All other fields are optional but recommended for greater detail and integration with appointments.
Basic Example:
{
"name": "John Smith",
"email": "john.smith@example.com",
"phone": "+5511999999999",
"identification_code": "123.456.789-00",
"identification_type": "br_cpf"
}
Sending the Request to Register a Client
To register a client, send an HTTP POST request to the endpoint:
https://eagenda.com.br/api/v3/people/
Request Configuration
- Method: POST
- Headers:
- accept: application/json
- Authorization: Bearer
- Content-Type: application/json
- Request body: JSON with the client data.
cURL Request Example
curl -X POST https://eagenda.com.br/api/v3/people/ \
-H "accept: application/json" \
-H "Authorization: Bearer ba08ab41bd58e9b9f82b4d2788b3cd9999ee9999" \
-H "Content-Type: application/json" \
-d '{
"name": "John Smith",
"email": "john.smith@example.com",
"phone": "+5511999999999",
"identification_code": "123.456.789-00",
"identification_type": "br_cpf"
}'
Python Example (using requests)
import requests
url = "https://eagenda.com.br/api/v3/people/"
headers = {
"accept": "application/json",
"Authorization": "Bearer ba08ab41bd58e9b9f82b4d2788b3cd9999ee9999",
"Content-Type": "application/json"
}
data = {
"name": "John Smith",
"email": "john.smith@example.com",
"phone": "+5511999999999",
"identification_code": "123.456.789-00",
"identification_type": "br_cpf"
}
response = requests.post(url, json=data, headers=headers)
print(response.status_code)
print(response.json())
Verifying the Response
The API will return a response with the client creation status. Check the following:
- HTTP status code:
- 201 Created: Client successfully registered.
- 400 Bad Request: Error in the submitted data (check the JSON).
- 401 Unauthorized: Invalid or missing token.
- Response body: Contains the registered client details, such as:
{ "person_key": "19753164-d190-4000-842c-43b82d3db780", "name": "John Smith", "email": "john.smith@example.com", "phone": "+5511999999999", "identification_code": "123.456.789-00", "identification_type": "br_cpf" }
The client will be registered in the system and can be linked to appointments or other operations. Use the person_key to reference the client in other requests.
Conclusion
With this tutorial, you learned how to register clients (people) via the eAgenda API, configuring information such as name, email, phone, and identification documents efficiently. This integration is ideal for automating client registration, simplifying contact management in the system. For more features, such as creating appointments or accounts, refer to the complete eAgenda API documentation: https://eagenda.com.br/api/v3/documentation/#overview.
Contact Us or Learn More
We are here to help with any questions! Access our official channels:
📞 WhatsApp : Click here to send us a message 🌐 eAgenda Platform : Discover eAgenda 🏢 Our Company : Mupi Systems – Innovative Solutions 📧 Email : contato@mupisystems.com.br 📚 Tutorials and Documentation : Access our guides and tutorials