> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://developer.vitablehealth.com/api/organization-user-invitations/invite-organization-user/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developer.vitablehealth.com/_mcp/server. # Invite a user to the organization POST https://api.vitablehealth.com/v1/organization-user-invitations Content-Type: application/json Invites an email address to join the authenticated organization. The identity provider sends the email and hosts acceptance; the membership is written on the invitee's first sign-in. Any email domain is accepted, which is the only way to add a teammate whose domain the organization does not claim. Reference: https://developer.vitablehealth.com/api/organization-user-invitations/invite-organization-user ## Authentication - `Authorization` header (bearer token, required) — API Key or Access Token authentication using Bearer token in Authorization header. API keys use the vit_apk_ prefix, access tokens use the vit_at_ prefix. ## Servers - `https://api.vitablehealth.com` (Production, default) - `https://api.uat.vitablehealth.com` (UAT) ## Request ### Headers - `X-Vitable-Organization` (string, optional) — Organization to act as for this request (e.g. `org_SGVsbG8gV29ybGQ`). Optional when your credentials reach a single organization. Required when they reach several — omitting it then returns 400 `organization_required`. A malformed value returns 400 `invalid_organization_header`, and naming an organization you do not have access to returns 403 `organization_access_denied`. ### Body (application/json) This endpoint expects an InviteOrganizationUserRequest. - `email` (string, required) — Address to invite. Any domain is accepted — this is the only way to add a teammate whose email domain the organization does not claim. For consumer domains the recipient must sign up with exactly this address. ## Response ### 201 - `data` (OrganizationUserInvitation, required) ## Errors ### 400 Bad Request Error Bad Request - Invalid input or validation error - `timestamp` (datetime, required) — ISO 8601 timestamp when the error occurred - `message` (string, required) — Human-readable error message - `error` (string, required) — Error message (same as message, for backwards compatibility) - `trace_id` (string, required) — Unique trace ID for debugging and support requests - `app_error_code` (string, optional, nullable) — Application-specific error code for programmatic handling ### 401 Unauthorized Error Unauthorized - Invalid or missing API key - `timestamp` (datetime, required) — ISO 8601 timestamp when the error occurred - `message` (string, required) — Human-readable error message - `error` (string, required) — Error message (same as message, for backwards compatibility) - `trace_id` (string, required) — Unique trace ID for debugging and support requests - `app_error_code` (string, optional, nullable) — Application-specific error code for programmatic handling ### 403 Forbidden Error Forbidden - Insufficient permissions for this resource - `timestamp` (datetime, required) — ISO 8601 timestamp when the error occurred - `message` (string, required) — Human-readable error message - `error` (string, required) — Error message (same as message, for backwards compatibility) - `trace_id` (string, required) — Unique trace ID for debugging and support requests - `app_error_code` (string, optional, nullable) — Application-specific error code for programmatic handling ### 404 Not Found Error Not Found - The requested resource does not exist - `timestamp` (datetime, required) — ISO 8601 timestamp when the error occurred - `message` (string, required) — Human-readable error message - `error` (string, required) — Error message (same as message, for backwards compatibility) - `trace_id` (string, required) — Unique trace ID for debugging and support requests - `app_error_code` (string, optional, nullable) — Application-specific error code for programmatic handling ### 409 Conflict Error `organization_user_already_invited` — a pending invitation for this address already exists; or `organization_not_federated` — see above. - `timestamp` (datetime, required) — ISO 8601 timestamp when the error occurred - `message` (string, required) — Human-readable error message - `error` (string, required) — Error message (same as message, for backwards compatibility) - `trace_id` (string, required) — Unique trace ID for debugging and support requests - `app_error_code` (string, optional, nullable) — Application-specific error code for programmatic handling ### 429 Too Many Requests Error Too Many Requests - Rate limit exceeded - `timestamp` (datetime, required) — ISO 8601 timestamp when the error occurred - `message` (string, required) — Human-readable error message - `error` (string, required) — Error message (same as message, for backwards compatibility) - `trace_id` (string, required) — Unique trace ID for debugging and support requests - `app_error_code` (string, optional, nullable) — Application-specific error code for programmatic handling ### 500 Internal Server Error Internal Server Error - An unexpected error occurred - `timestamp` (datetime, required) — ISO 8601 timestamp when the error occurred - `message` (string, required) — Human-readable error message - `error` (string, required) — Error message (same as message, for backwards compatibility) - `trace_id` (string, required) — Unique trace ID for debugging and support requests - `app_error_code` (string, optional, nullable) — Application-specific error code for programmatic handling ### 502 Bad Gateway Error Bad Gateway - External service error - `timestamp` (datetime, required) — ISO 8601 timestamp when the error occurred - `message` (string, required) — Human-readable error message - `error` (string, required) — Error message (same as message, for backwards compatibility) - `trace_id` (string, required) — Unique trace ID for debugging and support requests - `app_error_code` (string, optional, nullable) — Application-specific error code for programmatic handling ## Types ### OrganizationUserInvitation - `id` (string, required) — Identity-provider invitation id. - `email` (string, required) — Address the invitation was sent to. - `state` (string, required) — Invitation state (pending / accepted / expired / revoked). - `expires_at` (datetime, required) — When the invitation stops being redeemable. ## Examples ### Sent Invitation **Response** ```json { "data": { "id": "invitation_01H8ZQK", "email": "contractor@gmail.com", "state": "pending", "expires_at": "2026-09-17T00:00:00Z" } } ``` **SDK Code** ```python Sent Invitation import requests url = "https://api.vitablehealth.com/v1/organization-user-invitations" headers = {"Authorization": "Bearer "} response = requests.post(url, headers=headers) print(response.json()) ``` ```javascript Sent Invitation const url = 'https://api.vitablehealth.com/v1/organization-user-invitations'; const options = {method: 'POST', headers: {Authorization: 'Bearer '}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Sent Invitation package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.vitablehealth.com/v1/organization-user-invitations" req, _ := http.NewRequest("POST", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby Sent Invitation require 'uri' require 'net/http' url = URI("https://api.vitablehealth.com/v1/organization-user-invitations") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Authorization"] = 'Bearer ' response = http.request(request) puts response.read_body ``` ```java Sent Invitation import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.vitablehealth.com/v1/organization-user-invitations") .header("Authorization", "Bearer ") .asString(); ``` ```php Sent Invitation request('POST', 'https://api.vitablehealth.com/v1/organization-user-invitations', [ 'headers' => [ 'Authorization' => 'Bearer ', ], ]); echo $response->getBody(); ``` ```csharp Sent Invitation using RestSharp; var client = new RestClient("https://api.vitablehealth.com/v1/organization-user-invitations"); var request = new RestRequest(Method.POST); request.AddHeader("Authorization", "Bearer "); IRestResponse response = client.Execute(request); ``` ```swift Sent Invitation import Foundation let headers = ["Authorization": "Bearer "] let request = NSMutableURLRequest(url: NSURL(string: "https://api.vitablehealth.com/v1/organization-user-invitations")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers 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() ``` ### Invite Request **Request** ```json { "email": "contractor@gmail.com" } ``` **Response** ```json { "data": { "id": "invitation_01H8ZQK", "email": "contractor@gmail.com", "state": "pending", "expires_at": "2026-09-17T00:00:00Z" } } ``` **SDK Code** ```python Invite Request import requests url = "https://api.vitablehealth.com/v1/organization-user-invitations" payload = { "email": "contractor@gmail.com" } headers = { "Authorization": "Bearer ", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript Invite Request const url = 'https://api.vitablehealth.com/v1/organization-user-invitations'; const options = { method: 'POST', headers: {Authorization: 'Bearer ', 'Content-Type': 'application/json'}, body: '{"email":"contractor@gmail.com"}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Invite Request package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.vitablehealth.com/v1/organization-user-invitations" payload := strings.NewReader("{\n \"email\": \"contractor@gmail.com\"\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Authorization", "Bearer ") 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 Invite Request require 'uri' require 'net/http' url = URI("https://api.vitablehealth.com/v1/organization-user-invitations") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Authorization"] = 'Bearer ' request["Content-Type"] = 'application/json' request.body = "{\n \"email\": \"contractor@gmail.com\"\n}" response = http.request(request) puts response.read_body ``` ```java Invite Request import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.vitablehealth.com/v1/organization-user-invitations") .header("Authorization", "Bearer ") .header("Content-Type", "application/json") .body("{\n \"email\": \"contractor@gmail.com\"\n}") .asString(); ``` ```php Invite Request request('POST', 'https://api.vitablehealth.com/v1/organization-user-invitations', [ 'body' => '{ "email": "contractor@gmail.com" }', 'headers' => [ 'Authorization' => 'Bearer ', 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp Invite Request using RestSharp; var client = new RestClient("https://api.vitablehealth.com/v1/organization-user-invitations"); var request = new RestRequest(Method.POST); request.AddHeader("Authorization", "Bearer "); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"email\": \"contractor@gmail.com\"\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift Invite Request import Foundation let headers = [ "Authorization": "Bearer ", "Content-Type": "application/json" ] let parameters = ["email": "contractor@gmail.com"] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.vitablehealth.com/v1/organization-user-invitations")! 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() ```