> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.yunojuno.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.yunojuno.com/_mcp/server.

# Update a contract's custom fields

POST https://api.yunojuno.com/contracts/{contract_id}/custom_fields/
Content-Type: application/json

Update the custom fields for a contract.

Custom fields are client-defined metadata configured on your YunoJuno account (for example cost centres, project codes or internal tags). Only the fields supplied are validated and updated; required fields not included in the request are left unchanged.

Reference: https://docs.yunojuno.com/client-api/contracts/custom-fields-create

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Path parameters

- `contract_id` (string, required)

### Body (application/json)

This endpoint expects an UpdateContractCustomFields.

- `custom_fields` (list of CustomField, required) — An array of custom fields to update for the contract.

## Response

### 200

- `data` (Contract, required) — The contract object. This objects represents a contract on the YunoJuno platform between a client and a freelancer.

## Errors

### 400 Bad Request Error

The request body does not match the expected shape: custom_fields is missing or empty, or an entry is missing name or value, or one of those values is too long.

- `error` (Error, required)

### 401 Unauthorized Error

The access token is missing or invalid.

- `error` (Error, required)

### 404 Not Found Error

No contract with this ID belongs to the client account the access token was issued for.

- `error` (Error, required)

### 422 Unprocessable Entity Error

The request is well-formed but cannot be applied: the contract is not draft, offered or accepted, or a field you sent is not configured on your account, is no longer active, or was sent blank when your account requires a value.

- `error` (Error, required)

## Types

### CustomField

Represents a single custom field.

- `name` (string, required) — The name of the custom field.
- `value` (string, required) — The value of the custom field.

### Contract

The contract object. This objects represents a contract on the YunoJuno platform between a client and a freelancer.

- `contract_id` (string, required)
- `freelancer` (Freelancer, required) — The freelancer object. This object represents a freelancer on the YunoJuno platform.
- `freelancer_operating_jurisdiction` (Country, required, nullable) — The jurisdiction in which the contractor operates as a business or individual, including the country name and ISO 3166-1 two-character code
- `freelancer_personal_tax_jurisdiction` (Country, required, nullable) — The jurisdiction in which the contractor pays personal taxes, including the country name and ISO 3166-1 two-character code
- `client` (Client, required) — The client object. This object represents a client on the YunoJuno platform.
- `client_contact` (ClientContact, required) — The client contact object. This object represents the lifetime relationship between a client and a freelancer on the platform.
- `hirers` (list of Hirer, required)
- `title` (string, required)
- `job_title` (string, required)
- `description` (string, required)
- `start_date` (string, required)
- `end_date` (string, required)
- `actual_end_date` (string, required, nullable)
- `rate` (Rate, required) — The rate object. This object represents a static amount for a particular rate unit in a particular currency.
- `work_time_type` (string, required)
- `fee_schedule` (FeeSchedule, required) — The complete fee schedule for a contract.
- `notice_period_days` (integer, required)
- `work_location` (string, required)
- `minutes_in_working_day` (integer, required)
- `custom_fields` (list of CustomField, required)
- `pre_offer_approval_flow` (ApprovalFlowReference, required, nullable)
- `spend_request` (SpendRequest, required) — The spend requisition object. This object represents a request to commit spend on the YunoJuno platform. Spend Requisition was previously named Spend Request in the API documentation; some programmatic names use the old terminology.
- `renewal_meta` (RenewalMeta, required)
- `historical_meta` (HistoricalMeta, required)
- `url` (string, required)

### Error

- `code` (string, required) — A machine-readable code, such as AUTH_TOKEN_INVALID.
- `message` (string, required) — A description you can show to a person.
- `details` (list of ErrorDetail, optional) — Present on validation errors, one entry per failing field.
- `sentry_id` (string, optional) — Present on server errors. Quote it when you contact support.

### Freelancer

The freelancer object. This object represents a freelancer on the YunoJuno platform.

- `freelancer_id` (string, required)
- `first_name` (string, required)
- `last_name` (string, required)
- `full_name` (string, required)
- `email` (string, required)
- `date_of_birth` (string, required)
- `legal_name` (string, required)

### Country

The country object. This object represents a country with its name and ISO code.

- `name` (string, required)
- `country_code` (string, required)

### Client

The client object. This object represents a client on the YunoJuno platform.

- `client_id` (string, required)
- `name` (string, required)

### ClientContact

The client contact object. This object represents the lifetime relationship between a client and a freelancer on the platform.

- `client_contact_id` (string, required)
- `freelancer_id` (string, required)
- `custom_fields` (list of CustomField, required) — An array of custom fields to apply only when creating a new client contact.
- `url` (string, required) — The fully-qualified URL of the client contact detail page

### Hirer

The hirer object. This object represents a hirer on the YunoJuno platform.

- `hirer_id` (string, required)
- `first_name` (string, required)
- `last_name` (string, required)
- `full_name` (string, required)
- `email` (string, required)

### Rate

The rate object. This object represents a static amount for a particular rate unit in a particular currency.

- `value` (string, required)
- `unit` (string, required)
- `currency` (enum, required) — * `AUD` - $ AUD * `CAD` - $ CAD * `CHF` - ₣ CHF * `CZK` - Kč CZK * `DKK` - kr DKK * `EUR` - € EUR * `GBP` - £ GBP * `HKD` - $ HKD * `INR` - ₹ INR * `NOK` - kr NOK * `NZD` - $ NZD * `PLN` - zł PLN * `SEK` - kr SEK * `SGD` - $ SGD * `AED` - د.إ AED * `USD` - $ USD * `ZAR` - R ZAR
  - Allowed values: `AUD`, `CAD`, `CHF`, `CZK`, `DKK`, `EUR`, `GBP`, `HKD`, `INR`, `NOK`, `NZD`, `PLN`, `SEK`, `SGD`, `AED`, `USD`, `ZAR`

### FeeSchedule

The complete fee schedule for a contract.

- `periods` (list of FeePeriod, required)

### ApprovalFlowReference

- `approval_flow_id` (string, required)
- `current_approval_step` (CurrentApprovalStepReference, required, nullable)

### SpendRequest

The spend requisition object. This object represents a request to commit spend on the YunoJuno platform. Spend Requisition was previously named Spend Request in the API documentation; some programmatic names use the old terminology.

- `spend_request_id` (string, required)
- `url` (string, required, nullable)
- `external_id` (string, required, nullable)
- `title` (string, required)
- `description` (string, required)
- `amount` (string, required)
- `amount_type` (enum, required) — * `DAY_RATE` - Day rate * `TOTAL` - Total
  - Allowed values: `DAY_RATE`, `TOTAL`
- `currency` (enum, required) — * `AUD` - $ AUD * `CAD` - $ CAD * `CHF` - ₣ CHF * `CZK` - Kč CZK * `DKK` - kr DKK * `EUR` - € EUR * `GBP` - £ GBP * `HKD` - $ HKD * `INR` - ₹ INR * `NOK` - kr NOK * `NZD` - $ NZD * `PLN` - zł PLN * `SEK` - kr SEK * `SGD` - $ SGD * `AED` - د.إ AED * `USD` - $ USD * `ZAR` - R ZAR
  - Allowed values: `AUD`, `CAD`, `CHF`, `CZK`, `DKK`, `EUR`, `GBP`, `HKD`, `INR`, `NOK`, `NZD`, `PLN`, `SEK`, `SGD`, `AED`, `USD`, `ZAR`
- `custom_fields` (list of CustomField, required)
- `approval_flow` (ApprovalFlowReference, required, nullable)
- `attachment_url` (string, required, nullable)

### RenewalMeta

- `is_initial_contract` (boolean, required) — Whether the contract is the first in the renewal chain
- `is_renewal` (boolean, required) — Whether the contract is a renewal of a prior contract
- `has_subsequent_renewal` (boolean, required) — Whether the contract has a renewal following it
- `initial_contract_id` (string, required) — The ID of the very first contract in the renewal chain
- `parent_contract_id` (string, required, nullable) — The ID of the previous contract in the renewal chain
- `renewal_chain_position` (integer, required) — The position of this contract in the renewal chain, with the initial contract being 1
- `renewal_chain` (list of string, required) — List of all contract IDs in the renewal chain

### HistoricalMeta

- `has_previously_accepted_contract` (boolean, required) — Whether any other contract between this client and freelancer was accepted/signed previously (excludes this contract).

### ErrorDetail

One field-level problem, listed on a validation error.

- `code` (string, required) — A machine-readable code, such as VALIDATION_REQUIRED.
- `field` (string, required) — The input field at fault. Nested fields and list indexes are dot-separated, such as data.1.contract.
- `message` (string, required) — What is wrong with the field.

### FeePeriod

Represents a period of fees with effective date and totals.

- `effective_from` (string, required)
- `fees` (list of Fee, required)
- `total_fees` (Total, required) — Represents a total amount with currency.
- `total_cost` (Total, required) — Represents a total amount with currency.

### CurrentApprovalStepReference

- `approval_step_id` (string, required)

### Fee

Represents a single fee in a fee period.

- `percentage` (string, required)
- `value` (string, required)
- `currency` (string, required)
- `name` (string, required)

### Total

Represents a total amount with currency.

- `currency` (string, required)
- `value` (string, required)

## Examples

**Request**

```json
{
  "custom_fields": [
    {
      "name": "string",
      "value": "string"
    }
  ]
}
```

**Response**

```json
{
  "data": {
    "contract_id": "string",
    "freelancer": {
      "freelancer_id": "string",
      "first_name": "string",
      "last_name": "string",
      "full_name": "string",
      "email": "string",
      "date_of_birth": "2023-01-15",
      "legal_name": "string"
    },
    "freelancer_operating_jurisdiction": {
      "name": "string",
      "country_code": "string"
    },
    "freelancer_personal_tax_jurisdiction": {
      "name": "string",
      "country_code": "string"
    },
    "client": {
      "client_id": "string",
      "name": "string"
    },
    "client_contact": {
      "client_contact_id": "string",
      "freelancer_id": "string",
      "custom_fields": [
        {
          "name": "string",
          "value": "string",
          "metadata": null
        }
      ],
      "url": "string"
    },
    "hirers": [
      {
        "hirer_id": "string",
        "first_name": "string",
        "last_name": "string",
        "full_name": "string",
        "email": "string"
      }
    ],
    "title": "string",
    "job_title": "string",
    "description": "string",
    "start_date": "2023-01-15",
    "end_date": "2023-01-15",
    "actual_end_date": "string",
    "rate": {
      "value": "string",
      "unit": "string",
      "currency": "AUD"
    },
    "work_time_type": "string",
    "fee_schedule": {
      "periods": [
        {
          "effective_from": "2023-01-15",
          "fees": [
            {
              "percentage": "string",
              "value": "string",
              "currency": "string",
              "name": "string"
            }
          ],
          "total_fees": {
            "currency": "string",
            "value": "string"
          },
          "total_cost": {
            "currency": "string",
            "value": "string"
          }
        }
      ]
    },
    "notice_period_days": 1,
    "work_location": "string",
    "minutes_in_working_day": 1,
    "custom_fields": [
      {
        "name": "string",
        "value": "string",
        "metadata": null
      }
    ],
    "pre_offer_approval_flow": {
      "approval_flow_id": "string",
      "current_approval_step": {
        "approval_step_id": "string"
      }
    },
    "spend_request": {
      "spend_request_id": "string",
      "url": "string",
      "external_id": "string",
      "title": "string",
      "description": "string",
      "amount": "string",
      "amount_type": "DAY_RATE",
      "currency": "AUD",
      "custom_fields": [
        {
          "name": "string",
          "value": "string",
          "metadata": null
        }
      ],
      "approval_flow": {
        "approval_flow_id": "string",
        "current_approval_step": {
          "approval_step_id": "string"
        }
      },
      "attachment_url": "string"
    },
    "renewal_meta": {
      "is_initial_contract": true,
      "is_renewal": true,
      "has_subsequent_renewal": true,
      "initial_contract_id": "string",
      "parent_contract_id": "string",
      "renewal_chain_position": 1,
      "renewal_chain": [
        "string"
      ]
    },
    "historical_meta": {
      "has_previously_accepted_contract": true
    },
    "url": "string"
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.yunojuno.com/contracts/contract_id/custom_fields/"

payload = { "custom_fields": [
        {
            "name": "string",
            "value": "string"
        }
    ] }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://api.yunojuno.com/contracts/contract_id/custom_fields/';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"custom_fields":[{"name":"string","value":"string"}]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.yunojuno.com/contracts/contract_id/custom_fields/"

	payload := strings.NewReader("{\n  \"custom_fields\": [\n    {\n      \"name\": \"string\",\n      \"value\": \"string\"\n    }\n  ]\n}")

	req, _ := http.NewRequest("POST", 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(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.yunojuno.com/contracts/contract_id/custom_fields/")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"custom_fields\": [\n    {\n      \"name\": \"string\",\n      \"value\": \"string\"\n    }\n  ]\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.yunojuno.com/contracts/contract_id/custom_fields/")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"custom_fields\": [\n    {\n      \"name\": \"string\",\n      \"value\": \"string\"\n    }\n  ]\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.yunojuno.com/contracts/contract_id/custom_fields/', [
  'body' => '{
  "custom_fields": [
    {
      "name": "string",
      "value": "string"
    }
  ]
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.yunojuno.com/contracts/contract_id/custom_fields/");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"custom_fields\": [\n    {\n      \"name\": \"string\",\n      \"value\": \"string\"\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["custom_fields": [
    [
      "name": "string",
      "value": "string"
    ]
  ]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.yunojuno.com/contracts/contract_id/custom_fields/")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```