curl --request POST \
--url https://api.getprimo.com/email-account-selection-intents/{intentId}/execute \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"providers": [
{
"saasId": "<string>",
"groups": [
{
"name": "<string>",
"id": "<string>"
}
],
"roles": [
{
"name": "<string>",
"id": "<string>"
}
],
"licenses": [
{
"name": "<string>",
"id": "<string>"
}
],
"organizationUnits": [
{
"name": "<string>",
"id": "<string>"
}
],
"credentialsRecipient": {
"email": "jsmith@example.com"
},
"email": "jsmith@example.com"
}
],
"scheduleDate": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://api.getprimo.com/email-account-selection-intents/{intentId}/execute"
payload = {
"providers": [
{
"saasId": "<string>",
"groups": [
{
"name": "<string>",
"id": "<string>"
}
],
"roles": [
{
"name": "<string>",
"id": "<string>"
}
],
"licenses": [
{
"name": "<string>",
"id": "<string>"
}
],
"organizationUnits": [
{
"name": "<string>",
"id": "<string>"
}
],
"credentialsRecipient": { "email": "jsmith@example.com" },
"email": "jsmith@example.com"
}
],
"scheduleDate": "2023-11-07T05:31:56Z"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
providers: [
{
saasId: '<string>',
groups: [{name: '<string>', id: '<string>'}],
roles: [{name: '<string>', id: '<string>'}],
licenses: [{name: '<string>', id: '<string>'}],
organizationUnits: [{name: '<string>', id: '<string>'}],
credentialsRecipient: {email: 'jsmith@example.com'},
email: 'jsmith@example.com'
}
],
scheduleDate: '2023-11-07T05:31:56Z'
})
};
fetch('https://api.getprimo.com/email-account-selection-intents/{intentId}/execute', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.getprimo.com/email-account-selection-intents/{intentId}/execute",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'providers' => [
[
'saasId' => '<string>',
'groups' => [
[
'name' => '<string>',
'id' => '<string>'
]
],
'roles' => [
[
'name' => '<string>',
'id' => '<string>'
]
],
'licenses' => [
[
'name' => '<string>',
'id' => '<string>'
]
],
'organizationUnits' => [
[
'name' => '<string>',
'id' => '<string>'
]
],
'credentialsRecipient' => [
'email' => 'jsmith@example.com'
],
'email' => 'jsmith@example.com'
]
],
'scheduleDate' => '2023-11-07T05:31:56Z'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.getprimo.com/email-account-selection-intents/{intentId}/execute"
payload := strings.NewReader("{\n \"providers\": [\n {\n \"saasId\": \"<string>\",\n \"groups\": [\n {\n \"name\": \"<string>\",\n \"id\": \"<string>\"\n }\n ],\n \"roles\": [\n {\n \"name\": \"<string>\",\n \"id\": \"<string>\"\n }\n ],\n \"licenses\": [\n {\n \"name\": \"<string>\",\n \"id\": \"<string>\"\n }\n ],\n \"organizationUnits\": [\n {\n \"name\": \"<string>\",\n \"id\": \"<string>\"\n }\n ],\n \"credentialsRecipient\": {\n \"email\": \"jsmith@example.com\"\n },\n \"email\": \"jsmith@example.com\"\n }\n ],\n \"scheduleDate\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.getprimo.com/email-account-selection-intents/{intentId}/execute")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"providers\": [\n {\n \"saasId\": \"<string>\",\n \"groups\": [\n {\n \"name\": \"<string>\",\n \"id\": \"<string>\"\n }\n ],\n \"roles\": [\n {\n \"name\": \"<string>\",\n \"id\": \"<string>\"\n }\n ],\n \"licenses\": [\n {\n \"name\": \"<string>\",\n \"id\": \"<string>\"\n }\n ],\n \"organizationUnits\": [\n {\n \"name\": \"<string>\",\n \"id\": \"<string>\"\n }\n ],\n \"credentialsRecipient\": {\n \"email\": \"jsmith@example.com\"\n },\n \"email\": \"jsmith@example.com\"\n }\n ],\n \"scheduleDate\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getprimo.com/email-account-selection-intents/{intentId}/execute")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"providers\": [\n {\n \"saasId\": \"<string>\",\n \"groups\": [\n {\n \"name\": \"<string>\",\n \"id\": \"<string>\"\n }\n ],\n \"roles\": [\n {\n \"name\": \"<string>\",\n \"id\": \"<string>\"\n }\n ],\n \"licenses\": [\n {\n \"name\": \"<string>\",\n \"id\": \"<string>\"\n }\n ],\n \"organizationUnits\": [\n {\n \"name\": \"<string>\",\n \"id\": \"<string>\"\n }\n ],\n \"credentialsRecipient\": {\n \"email\": \"jsmith@example.com\"\n },\n \"email\": \"jsmith@example.com\"\n }\n ],\n \"scheduleDate\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"outcome": "EXECUTED",
"intent": {
"id": "<string>",
"taskId": "<string>",
"ticketId": "<string>",
"employeeId": "<string>",
"proposedProviders": [
{
"saasId": "<string>",
"groups": [
{
"id": "<string>",
"name": "<string>"
}
],
"roles": [
{
"id": "<string>",
"name": "<string>"
}
],
"licenses": [
{
"id": "<string>",
"name": "<string>"
}
],
"organizationUnits": [
{
"id": "<string>",
"name": "<string>"
}
],
"credentialsRecipient": {
"type": "ADMIN",
"email": "<string>"
}
}
],
"executedAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}Execute an email account selection intent
Validate the email account selection of an onboarding: opens one EMAIL_ACCOUNT task per provider in providers under the onboarding ticket, started now or SCHEDULED until scheduleDate, then completes the “Choose the email accounts” task (type EMAIL_ACCOUNT_SELECTION). This is the only way to complete an EMAIL_ACCOUNT_SELECTION task: updateTaskStatus refuses it with TaskLockedByTypeError naming this operation. Start providers from proposedProviders of getEmailAccountSelectionIntent, taking each saasId from there or from getSaas (an application with isEmailProvider): a provider that is not a connected email provider of the company is refused; an empty providers opens none. To create one email account without this task, use createEmailAccountIntent. Safe to retry: a selection validated earlier answers outcome: ALREADY_EXECUTED and opens nothing again. Refused with INVALID_EMAIL_ACCOUNT_SELECTION (a saasId that is not a connected email provider, the same saasId twice, or a recipient without an email), TICKET_CLOSED (the task was cancelled), EXECUTION_IN_PROGRESS, INTENT_NOT_FOUND.
curl --request POST \
--url https://api.getprimo.com/email-account-selection-intents/{intentId}/execute \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"providers": [
{
"saasId": "<string>",
"groups": [
{
"name": "<string>",
"id": "<string>"
}
],
"roles": [
{
"name": "<string>",
"id": "<string>"
}
],
"licenses": [
{
"name": "<string>",
"id": "<string>"
}
],
"organizationUnits": [
{
"name": "<string>",
"id": "<string>"
}
],
"credentialsRecipient": {
"email": "jsmith@example.com"
},
"email": "jsmith@example.com"
}
],
"scheduleDate": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://api.getprimo.com/email-account-selection-intents/{intentId}/execute"
payload = {
"providers": [
{
"saasId": "<string>",
"groups": [
{
"name": "<string>",
"id": "<string>"
}
],
"roles": [
{
"name": "<string>",
"id": "<string>"
}
],
"licenses": [
{
"name": "<string>",
"id": "<string>"
}
],
"organizationUnits": [
{
"name": "<string>",
"id": "<string>"
}
],
"credentialsRecipient": { "email": "jsmith@example.com" },
"email": "jsmith@example.com"
}
],
"scheduleDate": "2023-11-07T05:31:56Z"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
providers: [
{
saasId: '<string>',
groups: [{name: '<string>', id: '<string>'}],
roles: [{name: '<string>', id: '<string>'}],
licenses: [{name: '<string>', id: '<string>'}],
organizationUnits: [{name: '<string>', id: '<string>'}],
credentialsRecipient: {email: 'jsmith@example.com'},
email: 'jsmith@example.com'
}
],
scheduleDate: '2023-11-07T05:31:56Z'
})
};
fetch('https://api.getprimo.com/email-account-selection-intents/{intentId}/execute', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.getprimo.com/email-account-selection-intents/{intentId}/execute",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'providers' => [
[
'saasId' => '<string>',
'groups' => [
[
'name' => '<string>',
'id' => '<string>'
]
],
'roles' => [
[
'name' => '<string>',
'id' => '<string>'
]
],
'licenses' => [
[
'name' => '<string>',
'id' => '<string>'
]
],
'organizationUnits' => [
[
'name' => '<string>',
'id' => '<string>'
]
],
'credentialsRecipient' => [
'email' => 'jsmith@example.com'
],
'email' => 'jsmith@example.com'
]
],
'scheduleDate' => '2023-11-07T05:31:56Z'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.getprimo.com/email-account-selection-intents/{intentId}/execute"
payload := strings.NewReader("{\n \"providers\": [\n {\n \"saasId\": \"<string>\",\n \"groups\": [\n {\n \"name\": \"<string>\",\n \"id\": \"<string>\"\n }\n ],\n \"roles\": [\n {\n \"name\": \"<string>\",\n \"id\": \"<string>\"\n }\n ],\n \"licenses\": [\n {\n \"name\": \"<string>\",\n \"id\": \"<string>\"\n }\n ],\n \"organizationUnits\": [\n {\n \"name\": \"<string>\",\n \"id\": \"<string>\"\n }\n ],\n \"credentialsRecipient\": {\n \"email\": \"jsmith@example.com\"\n },\n \"email\": \"jsmith@example.com\"\n }\n ],\n \"scheduleDate\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.getprimo.com/email-account-selection-intents/{intentId}/execute")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"providers\": [\n {\n \"saasId\": \"<string>\",\n \"groups\": [\n {\n \"name\": \"<string>\",\n \"id\": \"<string>\"\n }\n ],\n \"roles\": [\n {\n \"name\": \"<string>\",\n \"id\": \"<string>\"\n }\n ],\n \"licenses\": [\n {\n \"name\": \"<string>\",\n \"id\": \"<string>\"\n }\n ],\n \"organizationUnits\": [\n {\n \"name\": \"<string>\",\n \"id\": \"<string>\"\n }\n ],\n \"credentialsRecipient\": {\n \"email\": \"jsmith@example.com\"\n },\n \"email\": \"jsmith@example.com\"\n }\n ],\n \"scheduleDate\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getprimo.com/email-account-selection-intents/{intentId}/execute")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"providers\": [\n {\n \"saasId\": \"<string>\",\n \"groups\": [\n {\n \"name\": \"<string>\",\n \"id\": \"<string>\"\n }\n ],\n \"roles\": [\n {\n \"name\": \"<string>\",\n \"id\": \"<string>\"\n }\n ],\n \"licenses\": [\n {\n \"name\": \"<string>\",\n \"id\": \"<string>\"\n }\n ],\n \"organizationUnits\": [\n {\n \"name\": \"<string>\",\n \"id\": \"<string>\"\n }\n ],\n \"credentialsRecipient\": {\n \"email\": \"jsmith@example.com\"\n },\n \"email\": \"jsmith@example.com\"\n }\n ],\n \"scheduleDate\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"outcome": "EXECUTED",
"intent": {
"id": "<string>",
"taskId": "<string>",
"ticketId": "<string>",
"employeeId": "<string>",
"proposedProviders": [
{
"saasId": "<string>",
"groups": [
{
"id": "<string>",
"name": "<string>"
}
],
"roles": [
{
"id": "<string>",
"name": "<string>"
}
],
"licenses": [
{
"id": "<string>",
"name": "<string>"
}
],
"organizationUnits": [
{
"id": "<string>",
"name": "<string>"
}
],
"credentialsRecipient": {
"type": "ADMIN",
"email": "<string>"
}
}
],
"executedAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}Authorizations
Use your Primo API key in the Authorization header as Bearer <API_KEY>.
Path Parameters
Body
The email providers to open an email account task on — start from proposedProviders of getEmailAccountSelectionIntent, then drop, add or adjust. An empty list opens none and completes the task.
Show child attributes
Show child attributes
Creates each email account task SCHEDULED until this date when it is in the future; without it they start now.
^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$