CREATE Custom Field Assignment
curl --request POST \
--url https://api.prophia.com/rest/v2/accounts/{accountId}/custom-fields/{fieldId}/assignments \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"buildingIds": [
"<string>"
],
"optionId": "<string>",
"value": "<string>"
}
'import requests
url = "https://api.prophia.com/rest/v2/accounts/{accountId}/custom-fields/{fieldId}/assignments"
payload = {
"buildingIds": ["<string>"],
"optionId": "<string>",
"value": "<string>"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({buildingIds: ['<string>'], optionId: '<string>', value: '<string>'})
};
fetch('https://api.prophia.com/rest/v2/accounts/{accountId}/custom-fields/{fieldId}/assignments', 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.prophia.com/rest/v2/accounts/{accountId}/custom-fields/{fieldId}/assignments",
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([
'buildingIds' => [
'<string>'
],
'optionId' => '<string>',
'value' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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.prophia.com/rest/v2/accounts/{accountId}/custom-fields/{fieldId}/assignments"
payload := strings.NewReader("{\n \"buildingIds\": [\n \"<string>\"\n ],\n \"optionId\": \"<string>\",\n \"value\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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.prophia.com/rest/v2/accounts/{accountId}/custom-fields/{fieldId}/assignments")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"buildingIds\": [\n \"<string>\"\n ],\n \"optionId\": \"<string>\",\n \"value\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.prophia.com/rest/v2/accounts/{accountId}/custom-fields/{fieldId}/assignments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"buildingIds\": [\n \"<string>\"\n ],\n \"optionId\": \"<string>\",\n \"value\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body[
{
"id": "<string>",
"fieldId": "<string>",
"buildingId": "<string>",
"optionId": "<string>",
"value": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
]{
"error": "Invalid Input",
"errorCode": "InvalidInput",
"message": "dba cannot be blank",
"status": "400 BAD_REQUEST",
"timestamp": "2026-09-02T20:41:03.118Z",
"localizedMessage": "dba cannot be blank"
}{
"error": "JWT authentication is not supported. Use an API key."
}{
"error": "Access Denied",
"errorCode": "AccessDenied",
"message": "Not authorized. Missing capabilities: WRITE:DOCUMENT",
"status": "403 FORBIDDEN",
"timestamp": "2026-09-02T20:41:03.118Z",
"localizedMessage": "Not authorized. Missing capabilities: WRITE:DOCUMENT"
}{
"error": "Entity Not Found",
"errorCode": "EntityNotFound",
"message": "This entity is not found in the system.",
"status": "404 NOT_FOUND",
"timestamp": "2026-09-02T20:41:03.118Z",
"localizedMessage": "This entity is not found in the system."
}Custom Fields
CREATE Custom Field Assignment
Sets the field’s value on each of the given Buildings, up to 200 per request.
Required capabilities: WRITE:CUSTOM_FIELD
POST
/
rest
/
v2
/
accounts
/
{accountId}
/
custom-fields
/
{fieldId}
/
assignments
CREATE Custom Field Assignment
curl --request POST \
--url https://api.prophia.com/rest/v2/accounts/{accountId}/custom-fields/{fieldId}/assignments \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"buildingIds": [
"<string>"
],
"optionId": "<string>",
"value": "<string>"
}
'import requests
url = "https://api.prophia.com/rest/v2/accounts/{accountId}/custom-fields/{fieldId}/assignments"
payload = {
"buildingIds": ["<string>"],
"optionId": "<string>",
"value": "<string>"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({buildingIds: ['<string>'], optionId: '<string>', value: '<string>'})
};
fetch('https://api.prophia.com/rest/v2/accounts/{accountId}/custom-fields/{fieldId}/assignments', 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.prophia.com/rest/v2/accounts/{accountId}/custom-fields/{fieldId}/assignments",
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([
'buildingIds' => [
'<string>'
],
'optionId' => '<string>',
'value' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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.prophia.com/rest/v2/accounts/{accountId}/custom-fields/{fieldId}/assignments"
payload := strings.NewReader("{\n \"buildingIds\": [\n \"<string>\"\n ],\n \"optionId\": \"<string>\",\n \"value\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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.prophia.com/rest/v2/accounts/{accountId}/custom-fields/{fieldId}/assignments")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"buildingIds\": [\n \"<string>\"\n ],\n \"optionId\": \"<string>\",\n \"value\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.prophia.com/rest/v2/accounts/{accountId}/custom-fields/{fieldId}/assignments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"buildingIds\": [\n \"<string>\"\n ],\n \"optionId\": \"<string>\",\n \"value\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body[
{
"id": "<string>",
"fieldId": "<string>",
"buildingId": "<string>",
"optionId": "<string>",
"value": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
]{
"error": "Invalid Input",
"errorCode": "InvalidInput",
"message": "dba cannot be blank",
"status": "400 BAD_REQUEST",
"timestamp": "2026-09-02T20:41:03.118Z",
"localizedMessage": "dba cannot be blank"
}{
"error": "JWT authentication is not supported. Use an API key."
}{
"error": "Access Denied",
"errorCode": "AccessDenied",
"message": "Not authorized. Missing capabilities: WRITE:DOCUMENT",
"status": "403 FORBIDDEN",
"timestamp": "2026-09-02T20:41:03.118Z",
"localizedMessage": "Not authorized. Missing capabilities: WRITE:DOCUMENT"
}{
"error": "Entity Not Found",
"errorCode": "EntityNotFound",
"message": "This entity is not found in the system.",
"status": "404 NOT_FOUND",
"timestamp": "2026-09-02T20:41:03.118Z",
"localizedMessage": "This entity is not found in the system."
}Authorizations
Body
application/json
Sets a Building Custom Field's value on one or more Buildings. Send value for a SINGLE field or optionId for a MULTI field — exactly one of the two. A Building that already has a value for the field is overwritten.
Response
OK

