メインコンテンツへスキップ
PATCH
/
api
/
v1
/
organizations
/
{organizationId}
/
identity
/
fields
/
custom
/
{customFieldId}
Update a custom field for an organization
curl --request PATCH \
  --url https://api.itmc.i.moneyforward.com/api/v1/organizations/{organizationId}/identity/fields/custom/{customFieldId} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "attributeName": "foo bar",
  "attributeCode": "employee_id"
}
'
import requests

url = "https://api.itmc.i.moneyforward.com/api/v1/organizations/{organizationId}/identity/fields/custom/{customFieldId}"

payload = {
"attributeName": "foo bar",
"attributeCode": "employee_id"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({attributeName: 'foo bar', attributeCode: 'employee_id'})
};

fetch('https://api.itmc.i.moneyforward.com/api/v1/organizations/{organizationId}/identity/fields/custom/{customFieldId}', 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.itmc.i.moneyforward.com/api/v1/organizations/{organizationId}/identity/fields/custom/{customFieldId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'attributeName' => 'foo bar',
'attributeCode' => 'employee_id'
]),
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.itmc.i.moneyforward.com/api/v1/organizations/{organizationId}/identity/fields/custom/{customFieldId}"

payload := strings.NewReader("{\n \"attributeName\": \"foo bar\",\n \"attributeCode\": \"employee_id\"\n}")

req, _ := http.NewRequest("PATCH", 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.patch("https://api.itmc.i.moneyforward.com/api/v1/organizations/{organizationId}/identity/fields/custom/{customFieldId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"attributeName\": \"foo bar\",\n \"attributeCode\": \"employee_id\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.itmc.i.moneyforward.com/api/v1/organizations/{organizationId}/identity/fields/custom/{customFieldId}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"attributeName\": \"foo bar\",\n \"attributeCode\": \"employee_id\"\n}"

response = http.request(request)
puts response.read_body
{
  "id": 1,
  "uniqueName": "custom_text_field",
  "name": "Foo bar",
  "kind": "dropdown",
  "serviceSource": {
    "workspaceId": 1,
    "serviceFieldId": "smarthr_city"
  },
  "serviceDetails": {
    "id": 33,
    "name": "SmartHR",
    "uniqueName": "smarthr",
    "serviceTopUrl": "https://smarthr.jp/"
  },
  "configuration": {
    "values": [
      {
        "id": "option_1",
        "value": "Option 1",
        "group": "<string>",
        "label": {
          "ja": "こんにちは",
          "en": "Hello"
        }
      }
    ],
    "groups": [
      {
        "value": "phone",
        "label": {
          "ja": "こんにちは",
          "en": "Hello"
        }
      }
    ]
  },
  "required": true
}

承認

Authorization
string
header
必須

For authenticated requests, set the Authorization: Bearer your_api_key parameter in the header.
You can create and manage your API Keys by visiting the API Keys tab in the Settings page of your organization in Admina

パスパラメータ

organizationId
number
必須
customFieldId
number
必須

ボディ

application/json
attributeName
string
:

"foo bar"

attributeCode
string

Unique identifier for the custom field. Must contain only lowercase letters, numbers, and underscores. Cannot be changed to a value that already exists in the organization.

:

"employee_id"

レスポンス

id
number
必須
read-only
:

1

uniqueName
string
必須
read-only
:

"custom_text_field"

name
string
必須
read-only
:

"Foo bar"

kind
enum<string>
必須
利用可能なオプション:
text,
textarea,
date,
number,
dropdown,
email
:

"dropdown"

serviceSource
object | null
必須
serviceDetails
object | null
必須
configuration
object | null
必須
required
boolean
必須
read-only

This field will be always false in R1

:

true

最終更新日 2026年7月14日