Check job status
curl --request GET \
--url 'https://{environment}.userpilot.io/v1/background_jobs/{{job_id}}' \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"users": [
{
"user_id": "<string>",
"company_id": "<string>",
"metadata": {
"custom_user_property": "<string>"
}
}
]
}
'import requests
url = "https://{environment}.userpilot.io/v1/background_jobs/{{job_id}}"
payload = { "users": [
{
"user_id": "<string>",
"company_id": "<string>",
"metadata": { "custom_user_property": "<string>" }
}
] }
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.get(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
users: [
{
user_id: '<string>',
company_id: '<string>',
metadata: {custom_user_property: '<string>'}
}
]
})
};
fetch('https://{environment}.userpilot.io/v1/background_jobs/{{job_id}}', 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://{environment}.userpilot.io/v1/background_jobs/{{job_id}}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => json_encode([
'users' => [
[
'user_id' => '<string>',
'company_id' => '<string>',
'metadata' => [
'custom_user_property' => '<string>'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"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://{environment}.userpilot.io/v1/background_jobs/{{job_id}}"
payload := strings.NewReader("{\n \"users\": [\n {\n \"user_id\": \"<string>\",\n \"company_id\": \"<string>\",\n \"metadata\": {\n \"custom_user_property\": \"<string>\"\n }\n }\n ]\n}")
req, _ := http.NewRequest("GET", url, payload)
req.Header.Add("Authorization", "<authorization>")
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.get("https://{environment}.userpilot.io/v1/background_jobs/{{job_id}}")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"users\": [\n {\n \"user_id\": \"<string>\",\n \"company_id\": \"<string>\",\n \"metadata\": {\n \"custom_user_property\": \"<string>\"\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{environment}.userpilot.io/v1/background_jobs/{{job_id}}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"users\": [\n {\n \"user_id\": \"<string>\",\n \"company_id\": \"<string>\",\n \"metadata\": {\n \"custom_user_property\": \"<string>\"\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"completed_rows": 123,
"elapsed_time": 123,
"end_time": "<string>",
"file_size": 123,
"filename": "<string>",
"job_id": "<string>",
"links": "<string>",
"start_time": "<string>",
"total_rows": 123,
"type": "<string>"
}Endpoints
View Job ID
Get the status, progress, and results of a specific background job by its unique identifier.
GET
/
v1
/
background_jobs
/
{job_id}
Check job status
curl --request GET \
--url 'https://{environment}.userpilot.io/v1/background_jobs/{{job_id}}' \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"users": [
{
"user_id": "<string>",
"company_id": "<string>",
"metadata": {
"custom_user_property": "<string>"
}
}
]
}
'import requests
url = "https://{environment}.userpilot.io/v1/background_jobs/{{job_id}}"
payload = { "users": [
{
"user_id": "<string>",
"company_id": "<string>",
"metadata": { "custom_user_property": "<string>" }
}
] }
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.get(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
users: [
{
user_id: '<string>',
company_id: '<string>',
metadata: {custom_user_property: '<string>'}
}
]
})
};
fetch('https://{environment}.userpilot.io/v1/background_jobs/{{job_id}}', 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://{environment}.userpilot.io/v1/background_jobs/{{job_id}}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => json_encode([
'users' => [
[
'user_id' => '<string>',
'company_id' => '<string>',
'metadata' => [
'custom_user_property' => '<string>'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"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://{environment}.userpilot.io/v1/background_jobs/{{job_id}}"
payload := strings.NewReader("{\n \"users\": [\n {\n \"user_id\": \"<string>\",\n \"company_id\": \"<string>\",\n \"metadata\": {\n \"custom_user_property\": \"<string>\"\n }\n }\n ]\n}")
req, _ := http.NewRequest("GET", url, payload)
req.Header.Add("Authorization", "<authorization>")
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.get("https://{environment}.userpilot.io/v1/background_jobs/{{job_id}}")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"users\": [\n {\n \"user_id\": \"<string>\",\n \"company_id\": \"<string>\",\n \"metadata\": {\n \"custom_user_property\": \"<string>\"\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{environment}.userpilot.io/v1/background_jobs/{{job_id}}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"users\": [\n {\n \"user_id\": \"<string>\",\n \"company_id\": \"<string>\",\n \"metadata\": {\n \"custom_user_property\": \"<string>\"\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"completed_rows": 123,
"elapsed_time": 123,
"end_time": "<string>",
"file_size": 123,
"filename": "<string>",
"job_id": "<string>",
"links": "<string>",
"start_time": "<string>",
"total_rows": 123,
"type": "<string>"
}Headers
API authentication token in the format: Token {{API_KEY}}
Obtain your API key from the Userpilot Environment Settings.
Path Parameters
Body
application/json
Show child attributes
Show child attributes
Response
200 - application/json
OK - Check job status
Available options:
queued, validating, processing, pending_refresh, completed, failed Was this page helpful?
āI