Invite an email address to create an organization account
curl --request POST \
--url https://harness.example.com/admin/invitations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "developer@example.com"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({email: 'developer@example.com'})
};
fetch('https://harness.example.com/admin/invitations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://harness.example.com/admin/invitations"
payload = { "email": "developer@example.com" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"email": "jsmith@example.com",
"role": "admin",
"status": "pending",
"expires_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"inviter_email": "jsmith@example.com"
}User management
Invite an email address to create an organization account
The recipient email and role are fixed. The recipient supplies only a password during acceptance.
POST
/
admin
/
invitations
Invite an email address to create an organization account
curl --request POST \
--url https://harness.example.com/admin/invitations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "developer@example.com"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({email: 'developer@example.com'})
};
fetch('https://harness.example.com/admin/invitations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://harness.example.com/admin/invitations"
payload = { "email": "developer@example.com" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"email": "jsmith@example.com",
"role": "admin",
"status": "pending",
"expires_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"inviter_email": "jsmith@example.com"
}Authorizations
oauthDevicedashboardSession
OAuth 2.0 access token obtained through RFC 8628 at /api/auth/device/code and /api/auth/oauth2/token. The API enforces governance:read, session:write, and client-status:write as appropriate.
Body
application/json
Response
Invitation created
