Create a custom field
curl --request POST \
--url https://public-api.hyperlocalise.com/v1/custom-fields \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"key": "<string>",
"name": "<string>",
"description": "<string>",
"options": [
{
"value": "<string>"
}
]
}
'const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
key: '<string>',
name: '<string>',
description: '<string>',
options: [{value: '<string>'}]
})
};
fetch('https://public-api.hyperlocalise.com/v1/custom-fields', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://public-api.hyperlocalise.com/v1/custom-fields"
payload = {
"key": "<string>",
"name": "<string>",
"description": "<string>",
"options": [{ "value": "<string>" }]
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://public-api.hyperlocalise.com/v1/custom-fields"
payload := strings.NewReader("{\n \"key\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"options\": [\n {\n \"value\": \"<string>\"\n }\n ]\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))
}{
"customField": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"key": "<string>",
"name": "<string>",
"description": "<string>",
"type": "text",
"options": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"value": "<string>"
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}Custom fields
Create a custom field
Requires custom-fields:write, which files:write grants to admins and localization managers. single_select and multi_select fields need at least one option; other types take none. The key and type cannot change later. A workspace has at most 200 fields.
POST
https://public-api.hyperlocalise.com
/
v1
/
custom-fields
Create a custom field
curl --request POST \
--url https://public-api.hyperlocalise.com/v1/custom-fields \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"key": "<string>",
"name": "<string>",
"description": "<string>",
"options": [
{
"value": "<string>"
}
]
}
'const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
key: '<string>',
name: '<string>',
description: '<string>',
options: [{value: '<string>'}]
})
};
fetch('https://public-api.hyperlocalise.com/v1/custom-fields', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://public-api.hyperlocalise.com/v1/custom-fields"
payload = {
"key": "<string>",
"name": "<string>",
"description": "<string>",
"options": [{ "value": "<string>" }]
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://public-api.hyperlocalise.com/v1/custom-fields"
payload := strings.NewReader("{\n \"key\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"options\": [\n {\n \"value\": \"<string>\"\n }\n ]\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))
}{
"customField": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"key": "<string>",
"name": "<string>",
"description": "<string>",
"type": "text",
"options": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"value": "<string>"
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}Body
application/json
Was this page helpful?

