Get somewhere to put a member's opt-out notice
Returns a short-lived URL to PUT the notice to, so the document goes straight to storage rather than through the service. The employer must keep the original or a copy of every opt-out notice for four years (TPR detailed guidance 7, paragraph 72), and it stays readable after the membership is deleted. Each notice gets its own id, so re-submitting one keeps the original as well.
curl --request POST \
--url https://api.sandbox.flowpayroll.ai/v2/pension/employee-pension/{employeeId}/opt-out-notices \
--header 'Content-Type: application/json' \
--data '
{
"membershipEndDate": "2023-12-25",
"fileName": "<string>",
"contentType": "<string>"
}
'import requests
url = "https://api.sandbox.flowpayroll.ai/v2/pension/employee-pension/{employeeId}/opt-out-notices"
payload = {
"membershipEndDate": "2023-12-25",
"fileName": "<string>",
"contentType": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({membershipEndDate: '2023-12-25', fileName: '<string>', contentType: '<string>'})
};
fetch('https://api.sandbox.flowpayroll.ai/v2/pension/employee-pension/{employeeId}/opt-out-notices', 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.sandbox.flowpayroll.ai/v2/pension/employee-pension/{employeeId}/opt-out-notices",
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([
'membershipEndDate' => '2023-12-25',
'fileName' => '<string>',
'contentType' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"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.sandbox.flowpayroll.ai/v2/pension/employee-pension/{employeeId}/opt-out-notices"
payload := strings.NewReader("{\n \"membershipEndDate\": \"2023-12-25\",\n \"fileName\": \"<string>\",\n \"contentType\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.sandbox.flowpayroll.ai/v2/pension/employee-pension/{employeeId}/opt-out-notices")
.header("Content-Type", "application/json")
.body("{\n \"membershipEndDate\": \"2023-12-25\",\n \"fileName\": \"<string>\",\n \"contentType\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.flowpayroll.ai/v2/pension/employee-pension/{employeeId}/opt-out-notices")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"membershipEndDate\": \"2023-12-25\",\n \"fileName\": \"<string>\",\n \"contentType\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"message": {
"token": "<string>",
"text": "<string>",
"tokenArguments": [
{
"name": "<string>",
"value": null
}
],
"textId": "<string>",
"textParameters": [
{
"key": "<string>",
"value": "<string>"
}
]
},
"content": {
"data": {
"noticeId": "<string>",
"uploadUrl": "<string>",
"contentType": "<string>",
"retainUntil": "2023-12-25"
},
"metadata": {
"dateFormat": "<string>",
"dateTimeFormat": "<string>",
"paginationToken": "<string>"
}
},
"validationIssues": [
{
"field": "<string>",
"reason": "<string>",
"reasonToken": "<string>",
"reasonTokenArguments": [
{
"name": "<string>",
"value": null
}
]
}
],
"errors": [
{
"field": "<string>",
"reasonText": "<string>",
"reasonId": "<string>",
"reasonParameters": [
{
"key": "<string>",
"value": "<string>"
}
]
}
],
"metadata": {
"dateFormat": "<string>",
"dateTimeFormat": "<string>",
"paginationToken": "<string>"
}
}{
"message": {
"token": "<string>",
"text": "<string>",
"tokenArguments": [
{
"name": "<string>",
"value": null
}
],
"textId": "<string>",
"textParameters": [
{
"key": "<string>",
"value": "<string>"
}
]
},
"content": {
"data": null,
"metadata": {
"dateFormat": "<string>",
"dateTimeFormat": "<string>",
"paginationToken": "<string>"
}
},
"validationIssues": [
{
"field": "<string>",
"reason": "<string>",
"reasonToken": "<string>",
"reasonTokenArguments": [
{
"name": "<string>",
"value": null
}
]
}
],
"errors": [
{
"field": "<string>",
"reasonText": "<string>",
"reasonId": "<string>",
"reasonParameters": [
{
"key": "<string>",
"value": "<string>"
}
]
}
],
"metadata": {
"dateFormat": "<string>",
"dateTimeFormat": "<string>",
"paginationToken": "<string>"
}
}{
"message": {
"token": "<string>",
"text": "<string>",
"tokenArguments": [
{
"name": "<string>",
"value": null
}
],
"textId": "<string>",
"textParameters": [
{
"key": "<string>",
"value": "<string>"
}
]
},
"content": {
"data": null,
"metadata": {
"dateFormat": "<string>",
"dateTimeFormat": "<string>",
"paginationToken": "<string>"
}
},
"validationIssues": [
{
"field": "<string>",
"reason": "<string>",
"reasonToken": "<string>",
"reasonTokenArguments": [
{
"name": "<string>",
"value": null
}
]
}
],
"errors": [
{
"field": "<string>",
"reasonText": "<string>",
"reasonId": "<string>",
"reasonParameters": [
{
"key": "<string>",
"value": "<string>"
}
]
}
],
"metadata": {
"dateFormat": "<string>",
"dateTimeFormat": "<string>",
"paginationToken": "<string>"
}
}{
"message": {
"token": "<string>",
"text": "<string>",
"tokenArguments": [
{
"name": "<string>",
"value": null
}
],
"textId": "<string>",
"textParameters": [
{
"key": "<string>",
"value": "<string>"
}
]
},
"content": {
"data": null,
"metadata": {
"dateFormat": "<string>",
"dateTimeFormat": "<string>",
"paginationToken": "<string>"
}
},
"validationIssues": [
{
"field": "<string>",
"reason": "<string>",
"reasonToken": "<string>",
"reasonTokenArguments": [
{
"name": "<string>",
"value": null
}
]
}
],
"errors": [
{
"field": "<string>",
"reasonText": "<string>",
"reasonId": "<string>",
"reasonParameters": [
{
"key": "<string>",
"value": "<string>"
}
]
}
],
"metadata": {
"dateFormat": "<string>",
"dateTimeFormat": "<string>",
"paginationToken": "<string>"
}
}{
"message": {
"token": "<string>",
"text": "<string>",
"tokenArguments": [
{
"name": "<string>",
"value": null
}
],
"textId": "<string>",
"textParameters": [
{
"key": "<string>",
"value": "<string>"
}
]
},
"content": {
"data": null,
"metadata": {
"dateFormat": "<string>",
"dateTimeFormat": "<string>",
"paginationToken": "<string>"
}
},
"validationIssues": [
{
"field": "<string>",
"reason": "<string>",
"reasonToken": "<string>",
"reasonTokenArguments": [
{
"name": "<string>",
"value": null
}
]
}
],
"errors": [
{
"field": "<string>",
"reasonText": "<string>",
"reasonId": "<string>",
"reasonParameters": [
{
"key": "<string>",
"value": "<string>"
}
]
}
],
"metadata": {
"dateFormat": "<string>",
"dateTimeFormat": "<string>",
"paginationToken": "<string>"
}
}Path Parameters
Body
Response
OK
The response envelope every FlowPayroll API answers with: a message, the
content, and any validationIssues. errors and the top-level
metadata are deprecated copies of validationIssues and
content.metadata, and will be removed.
What happened, as English text and a stable token to translate from.
textId and textParameters are deprecated copies of token and tokenArguments.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Deprecated: the same issues as validationIssues (reasonText is reason, reasonId is reasonToken, reasonParameters is reasonTokenArguments). Read validationIssues; this will be removed.
Show child attributes
Show child attributes
Deprecated: the same values as content.metadata. Read that; this will be removed.
Show child attributes
Show child attributes
Was this page helpful?
curl --request POST \
--url https://api.sandbox.flowpayroll.ai/v2/pension/employee-pension/{employeeId}/opt-out-notices \
--header 'Content-Type: application/json' \
--data '
{
"membershipEndDate": "2023-12-25",
"fileName": "<string>",
"contentType": "<string>"
}
'import requests
url = "https://api.sandbox.flowpayroll.ai/v2/pension/employee-pension/{employeeId}/opt-out-notices"
payload = {
"membershipEndDate": "2023-12-25",
"fileName": "<string>",
"contentType": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({membershipEndDate: '2023-12-25', fileName: '<string>', contentType: '<string>'})
};
fetch('https://api.sandbox.flowpayroll.ai/v2/pension/employee-pension/{employeeId}/opt-out-notices', 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.sandbox.flowpayroll.ai/v2/pension/employee-pension/{employeeId}/opt-out-notices",
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([
'membershipEndDate' => '2023-12-25',
'fileName' => '<string>',
'contentType' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"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.sandbox.flowpayroll.ai/v2/pension/employee-pension/{employeeId}/opt-out-notices"
payload := strings.NewReader("{\n \"membershipEndDate\": \"2023-12-25\",\n \"fileName\": \"<string>\",\n \"contentType\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.sandbox.flowpayroll.ai/v2/pension/employee-pension/{employeeId}/opt-out-notices")
.header("Content-Type", "application/json")
.body("{\n \"membershipEndDate\": \"2023-12-25\",\n \"fileName\": \"<string>\",\n \"contentType\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.flowpayroll.ai/v2/pension/employee-pension/{employeeId}/opt-out-notices")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"membershipEndDate\": \"2023-12-25\",\n \"fileName\": \"<string>\",\n \"contentType\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"message": {
"token": "<string>",
"text": "<string>",
"tokenArguments": [
{
"name": "<string>",
"value": null
}
],
"textId": "<string>",
"textParameters": [
{
"key": "<string>",
"value": "<string>"
}
]
},
"content": {
"data": {
"noticeId": "<string>",
"uploadUrl": "<string>",
"contentType": "<string>",
"retainUntil": "2023-12-25"
},
"metadata": {
"dateFormat": "<string>",
"dateTimeFormat": "<string>",
"paginationToken": "<string>"
}
},
"validationIssues": [
{
"field": "<string>",
"reason": "<string>",
"reasonToken": "<string>",
"reasonTokenArguments": [
{
"name": "<string>",
"value": null
}
]
}
],
"errors": [
{
"field": "<string>",
"reasonText": "<string>",
"reasonId": "<string>",
"reasonParameters": [
{
"key": "<string>",
"value": "<string>"
}
]
}
],
"metadata": {
"dateFormat": "<string>",
"dateTimeFormat": "<string>",
"paginationToken": "<string>"
}
}{
"message": {
"token": "<string>",
"text": "<string>",
"tokenArguments": [
{
"name": "<string>",
"value": null
}
],
"textId": "<string>",
"textParameters": [
{
"key": "<string>",
"value": "<string>"
}
]
},
"content": {
"data": null,
"metadata": {
"dateFormat": "<string>",
"dateTimeFormat": "<string>",
"paginationToken": "<string>"
}
},
"validationIssues": [
{
"field": "<string>",
"reason": "<string>",
"reasonToken": "<string>",
"reasonTokenArguments": [
{
"name": "<string>",
"value": null
}
]
}
],
"errors": [
{
"field": "<string>",
"reasonText": "<string>",
"reasonId": "<string>",
"reasonParameters": [
{
"key": "<string>",
"value": "<string>"
}
]
}
],
"metadata": {
"dateFormat": "<string>",
"dateTimeFormat": "<string>",
"paginationToken": "<string>"
}
}{
"message": {
"token": "<string>",
"text": "<string>",
"tokenArguments": [
{
"name": "<string>",
"value": null
}
],
"textId": "<string>",
"textParameters": [
{
"key": "<string>",
"value": "<string>"
}
]
},
"content": {
"data": null,
"metadata": {
"dateFormat": "<string>",
"dateTimeFormat": "<string>",
"paginationToken": "<string>"
}
},
"validationIssues": [
{
"field": "<string>",
"reason": "<string>",
"reasonToken": "<string>",
"reasonTokenArguments": [
{
"name": "<string>",
"value": null
}
]
}
],
"errors": [
{
"field": "<string>",
"reasonText": "<string>",
"reasonId": "<string>",
"reasonParameters": [
{
"key": "<string>",
"value": "<string>"
}
]
}
],
"metadata": {
"dateFormat": "<string>",
"dateTimeFormat": "<string>",
"paginationToken": "<string>"
}
}{
"message": {
"token": "<string>",
"text": "<string>",
"tokenArguments": [
{
"name": "<string>",
"value": null
}
],
"textId": "<string>",
"textParameters": [
{
"key": "<string>",
"value": "<string>"
}
]
},
"content": {
"data": null,
"metadata": {
"dateFormat": "<string>",
"dateTimeFormat": "<string>",
"paginationToken": "<string>"
}
},
"validationIssues": [
{
"field": "<string>",
"reason": "<string>",
"reasonToken": "<string>",
"reasonTokenArguments": [
{
"name": "<string>",
"value": null
}
]
}
],
"errors": [
{
"field": "<string>",
"reasonText": "<string>",
"reasonId": "<string>",
"reasonParameters": [
{
"key": "<string>",
"value": "<string>"
}
]
}
],
"metadata": {
"dateFormat": "<string>",
"dateTimeFormat": "<string>",
"paginationToken": "<string>"
}
}{
"message": {
"token": "<string>",
"text": "<string>",
"tokenArguments": [
{
"name": "<string>",
"value": null
}
],
"textId": "<string>",
"textParameters": [
{
"key": "<string>",
"value": "<string>"
}
]
},
"content": {
"data": null,
"metadata": {
"dateFormat": "<string>",
"dateTimeFormat": "<string>",
"paginationToken": "<string>"
}
},
"validationIssues": [
{
"field": "<string>",
"reason": "<string>",
"reasonToken": "<string>",
"reasonTokenArguments": [
{
"name": "<string>",
"value": null
}
]
}
],
"errors": [
{
"field": "<string>",
"reasonText": "<string>",
"reasonId": "<string>",
"reasonParameters": [
{
"key": "<string>",
"value": "<string>"
}
]
}
],
"metadata": {
"dateFormat": "<string>",
"dateTimeFormat": "<string>",
"paginationToken": "<string>"
}
}