curl -X POST "$API_URL/v1/orgs/$ORG_ID/invitations" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"email": "ada@example.com",
"role": "member"
}'
body := strings.NewReader(`{
"email": "ada@example.com",
"role": "member"
}`)
req, err := http.NewRequestWithContext(ctx, http.MethodPost,
apiURL + "/v1/orgs/" + orgID + "/invitations", body)
if err != nil {
return err
}
req.Header.Set("Authorization", "Bearer "+token)
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
return err
}
defer res.Body.Close()
const res = await fetch(`${apiUrl}/v1/orgs/${orgId}/invitations`, {
method: "POST",
headers: {
Authorization: `Bearer ${token}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"email": "ada@example.com",
"role": "member"
}),
});
const data = await res.json();
{
"created_at": "2026-09-15T12:00:00Z",
"email": "ada@example.com",
"expired": false,
"expires_at": "2026-09-15T12:00:00Z",
"id": "inv_mfrggzdfmztwq2lkmfrggzdfmy",
"role": "member"
}
{
"code": "string",
"status": 401,
"title": "Unauthorized",
"detail": "string",
"request_id": "req_9f86d081884c7d65",
"type": "string"
}
{
"code": "string",
"status": 403,
"title": "Forbidden",
"detail": "string",
"request_id": "req_9f86d081884c7d65",
"type": "string"
}
{
"code": "string",
"status": 404,
"title": "Not Found",
"detail": "string",
"request_id": "req_9f86d081884c7d65",
"type": "string"
}
{
"code": "string",
"status": 409,
"title": "Conflict",
"detail": "string",
"request_id": "req_9f86d081884c7d65",
"type": "string"
}
{
"code": "string",
"status": 422,
"title": "Unprocessable Entity",
"detail": "string",
"errors": [
{
"message": "expected length >= 1",
"location": "body.name"
}
],
"request_id": "req_9f86d081884c7d65",
"type": "string"
}
{
"code": "string",
"status": 429,
"title": "Too Many Requests",
"detail": "string",
"request_id": "req_9f86d081884c7d65",
"type": "string"
}