See all members, including invited ones.
Invite member
POST /organizations/{org_id}/users/invite
This endpoint sends an invitation email to a new user, prompting them to join your organization.
Replace {org_id}
with your Organization ID.
Authorization: Bearer {your_access_token}
Accept: application/json
X-Tallyfy-Client: APIClient
Content-Type: application/json
The request body requires a JSON object containing the details of the user to invite.
Refer to the #definitions/inviteInput
schema in Swagger. Key fields:
email
(string, required): The email address of the person to invite.first_name
(string, optional): First name of the invitee.last_name
(string, optional): Last name of the invitee.role
(string, optional): The role to assign upon joining (e.g.,standard
,light
,admin
). Defaults may apply if omitted.timezone
(string, optional): Timezone for the new user (e.g.,America/New_York
).
Example Body:
{ "email": "new.user@example.com", "first_name": "Charlie", "last_name": "Brown", "role": "standard"}
const accessToken = 'YOUR_PERSONAL_ACCESS_TOKEN';const orgId = 'YOUR_ORGANIZATION_ID';const apiUrl = `https://go.tallyfy.com/api/organizations/${orgId}/users/invite`;
const inviteData = { email: "charlie.brown@example.com", first_name: "Charlie", last_name: "Brown", role: "standard" // or "light", "admin"};
const headers = new Headers();headers.append('Authorization', `Bearer ${accessToken}`);headers.append('Accept', 'application/json');headers.append('X-Tallyfy-Client', 'APIClient');headers.append('Content-Type', 'application/json');
fetch(apiUrl, { method: 'POST', headers: headers, body: JSON.stringify(inviteData)}).then(response => { if (!response.ok) { // Check for specific errors like 422 (user already exists) return response.json().then(errData => { throw new Error(`HTTP error! status: ${response.status}, message: ${JSON.stringify(errData)}`); }).catch(() => { throw new Error(`HTTP error! status: ${response.status}`); }); } // Successful invite might return the pending user details return response.json();}).then(data => { console.log('Successfully invited member:'); console.log(JSON.stringify(data, null, 2));}).catch(error => { console.error('Error inviting member:', error);});
import requestsimport jsonimport os
access_token = os.environ.get('TALLYFY_ACCESS_TOKEN', 'YOUR_PERSONAL_ACCESS_TOKEN')org_id = os.environ.get('TALLYFY_ORG_ID', 'YOUR_ORGANIZATION_ID')api_url = f'https://go.tallyfy.com/api/organizations/{org_id}/users/invite'
headers = { 'Authorization': f'Bearer {access_token}', 'Accept': 'application/json', 'X-Tallyfy-Client': 'APIClient', 'Content-Type': 'application/json'}
invite_payload = { 'email': 'lucy.vanpelt@example.com', 'first_name': 'Lucy', 'last_name': 'Van Pelt', 'role': 'light'}
try: response = requests.post(api_url, headers=headers, json=invite_payload) response.raise_for_status()
invite_response = response.json() print('Successfully invited member:') print(json.dumps(invite_response, indent=4))
except requests.exceptions.RequestException as e: print(f"Request failed: {e}") if response is not None: print(f"Response Status: {response.status_code}") try: # Common error is 422 if user already exists print(f"Response Body: {response.json()}") except json.JSONDecodeError: print(f"Response Body: {response.text}")
import java.net.URI;import java.net.http.HttpClient;import java.net.http.HttpRequest;import java.net.http.HttpResponse;import java.io.IOException;// Assumes JSON library
public class InviteMember { public static void main(String[] args) { String accessToken = System.getenv().getOrDefault("TALLYFY_ACCESS_TOKEN", "YOUR_PERSONAL_ACCESS_TOKEN"); String orgId = System.getenv().getOrDefault("TALLYFY_ORG_ID", "YOUR_ORGANIZATION_ID"); String apiUrl = "https://go.tallyfy.com/api/organizations/" + orgId + "/users/invite";
// Build payload using Map/POJO and JSON library // Map<String, String> inviteData = new HashMap<>(); // inviteData.put("email", "linus.vanpelt@example.com"); // inviteData.put("first_name", "Linus"); // inviteData.put("role", "standard"); // String jsonPayload = new ObjectMapper().writeValueAsString(inviteData);
String jsonPayload = "{\"email\": \"linus@example.com\", \"first_name\": \"Linus\", \"role\": \"standard\"}"; // Simple example
HttpClient client = HttpClient.newHttpClient(); HttpRequest request = HttpRequest.newBuilder() .uri(URI.create(apiUrl)) .header("Authorization", "Bearer " + accessToken) .header("Accept", "application/json") .header("X-Tallyfy-Client", "APIClient") .header("Content-Type", "application/json") .POST(HttpRequest.BodyPublishers.ofString(jsonPayload)) .build();
try { HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString()); if (response.statusCode() == 200 || response.statusCode() == 201) { System.out.println("Successfully invited member:"); System.out.println(response.body()); // TODO: Parse JSON } else { // Error handling (e.g., 422 if user exists) System.err.println("Failed. Status: " + response.statusCode()); System.err.println("Response: " + response.body()); } } catch (IOException | InterruptedException e) { // Error handling... System.err.println("Request failed: " + e.getMessage()); } }}
package main
import ( "bytes" "encoding/json" "fmt" "io/ioutil" "net/http" "os")
func main() { accessToken := os.Getenv("TALLYFY_ACCESS_TOKEN") orgId := os.Getenv("TALLYFY_ORG_ID") apiUrl := fmt.Sprintf("https://go.tallyfy.com/api/organizations/%s/users/invite", orgId)
inviteData := map[string]interface{}{ "email": "snoopy@example.com", "first_name": "Snoopy", "role": "light", }
jsonData, err := json.Marshal(inviteData) // Error handling...
client := &http.Client{} req, err := http.NewRequest(http.MethodPost, apiUrl, bytes.NewBuffer(jsonData)) // Error handling...
req.Header.Set("Authorization", "Bearer "+accessToken) req.Header.Set("Accept", "application/json") req.Header.Set("X-Tallyfy-Client", "APIClient") req.Header.Set("Content-Type", "application/json")
resp, err := client.Do(req) // Error handling... defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body) // Error handling...
if resp.StatusCode != http.StatusOK && resp.StatusCode != http.StatusCreated { // Error handling (check for 422) fmt.Printf("Failed. Status: %d\nBody: %s\n", resp.StatusCode, string(body)) return }
fmt.Println("Successfully invited member:") fmt.Println(string(body)) // TODO: Unmarshal JSON}
A successful request returns a 200 OK
or 201 Created
status code. The response body typically contains the details of the invited user, often showing a pending
or invited
status until they accept.
{ "data": { "id": 1005, // User ID assigned even before acceptance "email": "charlie.brown@example.com", "username": null, // Username set upon acceptance "first_name": "Charlie", "last_name": "Brown", "full_name": "Charlie Brown", "profile_pic": null, "active": false, // Not active until accepted "is_suspended": false, "created_at": "2024-05-21T10:00:00Z", "last_updated": "2024-05-21T10:00:00Z", "last_login_at": null, "activated_at": null, // Null until accepted "status": "invited", // Or similar status "user_role": "Standard" // ... other properties ... }}
If the email address already belongs to an existing member of the organization, you will likely receive a 422 Unprocessable Entity
error.
Retrieve details for a specific member.
About Tallyfy
- 2025 Tallyfy, Inc.
- Privacy Policy
- Terms of Use
- Report Issue
- Trademarks