The Esadax CLI and REST API provide robust tools for managing project members, allowing you to add, list, and remove users from your projects. This article walks through the key endpoints and functionalities available.
Before interacting with the Esadax API, ensure you have valid authentication credentials:
Authorization: Bearer <TOKEN> header in your requests.To add a member to a project, use the POST method on the endpoint:
await fetch("https://api.esadax.com/v1/projects/{idOrName}/members", {
method: "post",
headers: { Authorization: "Bearer <TOKEN>" },
body: JSON.stringify({
// Member details (e.g., email, username)
}),
});
Retrieve a list of all members in a project using the GET method:
fetch("https://api.esadax.com/v1/projects/{idOrName}/members", {
headers: { Authorization: "Bearer <TOKEN>" },
params: {
// Optional parameters (e.g., `limit`, `search`, `since`, `until`)
},
});
Delete a specific member from a project using the DELETE method:
fetch("https://api.esadax.com/v1/projects/{idOrName}/members/{uid}", {
method: "delete",
headers: { Authorization: "Bearer <TOKEN>" },
});
All endpoints return appropriate HTTP status codes. Ensure you handle errors by checking the response status code and status message.
The Esadax CLI and REST API provide a flexible and secure way to manage project members. Always ensure proper authentication and permissions when interacting with these endpoints.