Skip to content

Custom Fields

Attach arbitrary key-value data to resources in StrawBlond when working with the API. Typically used for storing metadata or other useful information when working with third-party solutions.

Custom fields are readable and writeable via the custom_fields property.

Supported resources

Custom fields are currently supported on following resources: Contact, Company, Project, Time Tracking, Invoice, Offer, and Expense.

Limitations and validation

  • Custom fields are limited to 50 fields per resource.
  • Data can be stored as String, Number, Boolean or null.
  • Strings cannot be longer than 5000 characters.

Adding custom fields

When creating or updating a resource, add a custom_fields property in the JSON payload containing your custom fields as a JSON object (key/value pairs).

Example

In this example, we're creating a new company object with two custom fields (my_internal_id and is_important).

post
/company
json
// Request body
{
    "name": "Acme Inc",
    "custom_fields": {
        "my_internal_id": 143,
        "is_important": true,
    }
}

WARNING

Always provide all custom fields you want to store, even when you're just updating a single field.

Filtering by custom fields

When querying resources, you may filter by a specific custom field.

Use a basic Filter with custom_field as the filter key. The filter value must be your custom field key and value seperated by a comma.

In this example, we're searching for a company where my_internal_id equals 42.

get
/company?filter[custom_field]=my_internal_id,42