Skip to content

Update a task

client.Task.Update(ctx, id, body) (*TaskUpdateResponse, error)
POST/v1/tasks/{id}

Updates an existing task by ID. Only included fields and relationships are modified.

The $note relationship is read-only — manage notes via their own relationships.

Supports idempotency via the Idempotency-Key header.

Required scope: tasks:update

Rate limit category: Write

ParametersExpand Collapse
id string

Unique identifier of the task to update.

body TaskUpdateParams
Fields param.Field[TaskUpdateParamsFields]Optional

Field values to update — only provided fields are modified; omitted fields are left unchanged. Tasks only support the documented system fields, all prefixed with $ (e.g. $title, $status). Call the definitions endpoint for available fields. See Fields and relationships for value type details.

Description stringOptional

Description of the task in markdown format.

DueAt stringOptional

Due date as an ISO 8601 datetime string.

Status stringOptional

Task status. One of: TODO, IN_PROGRESS, COMPLETE, CANCELLED.

Title stringOptional

Title of the task.

Relationships param.Field[map[string, TaskUpdateParamsRelationship]]Optional

Relationship operations to apply. System relationships use a $ prefix (e.g. $account, $assignedTo). Each value is an operation object with add, remove, or replace.

map[string, TaskUpdateParamsRelationship]
Add TaskUpdateParamsRelationshipAddUnionOptional

Entity ID(s) to add to the relationship.

One of the following:
string
type TaskUpdateParamsRelationshipAddArray []string
Remove TaskUpdateParamsRelationshipRemoveUnionOptional

Entity ID(s) to remove from the relationship.

One of the following:
string
type TaskUpdateParamsRelationshipRemoveArray []string
Replace TaskUpdateParamsRelationshipReplaceUnionOptional

Entity ID(s) to set as the entire relationship, replacing all existing associations.

One of the following:
string
type TaskUpdateParamsRelationshipReplaceArray []string
ReturnsExpand Collapse
type TaskUpdateResponse struct{…}
ID string

Unique identifier for the entity.

CreatedAt string

ISO 8601 timestamp of when the entity was created.

Fields map[string, TaskUpdateResponseField]

Map of field names to their typed values. System fields are prefixed with $ (e.g. $name, $email); custom attributes use their bare slug.

Value TaskUpdateResponseFieldValueUnion

The field value, or null if unset.

One of the following:
string
float64
bool
type TaskUpdateResponseFieldValueArray []string
type TaskUpdateResponseFieldValueAddress struct{…}
City stringOptional

City name.

Country stringOptional

2-letter ISO 3166-1 alpha-2 country code.

Latitude float64Optional

Latitude coordinate.

Longitude float64Optional

Longitude coordinate.

PostalCode stringOptional

Postal or ZIP code.

State stringOptional

State or province.

Street stringOptional

Street address line 1.

Street2 stringOptional

Street address line 2.

type TaskUpdateResponseFieldValueFullName struct{…}
FirstName stringOptional

The contact’s first name.

LastName stringOptional

The contact’s last name.

ValueType string

The data type of the field.

One of the following:
const TaskUpdateResponseFieldValueTypeAddress TaskUpdateResponseFieldValueType = "ADDRESS"
const TaskUpdateResponseFieldValueTypeCheckbox TaskUpdateResponseFieldValueType = "CHECKBOX"
const TaskUpdateResponseFieldValueTypeCurrency TaskUpdateResponseFieldValueType = "CURRENCY"
const TaskUpdateResponseFieldValueTypeDatetime TaskUpdateResponseFieldValueType = "DATETIME"
const TaskUpdateResponseFieldValueTypeEmail TaskUpdateResponseFieldValueType = "EMAIL"
const TaskUpdateResponseFieldValueTypeFullName TaskUpdateResponseFieldValueType = "FULL_NAME"
const TaskUpdateResponseFieldValueTypeMarkdown TaskUpdateResponseFieldValueType = "MARKDOWN"
const TaskUpdateResponseFieldValueTypeMultiSelect TaskUpdateResponseFieldValueType = "MULTI_SELECT"
const TaskUpdateResponseFieldValueTypeNumber TaskUpdateResponseFieldValueType = "NUMBER"
const TaskUpdateResponseFieldValueTypeSingleSelect TaskUpdateResponseFieldValueType = "SINGLE_SELECT"
const TaskUpdateResponseFieldValueTypeSocialHandle TaskUpdateResponseFieldValueType = "SOCIAL_HANDLE"
const TaskUpdateResponseFieldValueTypeTelephone TaskUpdateResponseFieldValueType = "TELEPHONE"
const TaskUpdateResponseFieldValueTypeText TaskUpdateResponseFieldValueType = "TEXT"
const TaskUpdateResponseFieldValueTypeURL TaskUpdateResponseFieldValueType = "URL"
Relationships map[string, TaskUpdateResponseRelationship]

Map of relationship names to their associated entities. System relationships are prefixed with $ (e.g. $owner, $contact).

Cardinality string

Whether the relationship is has_one or has_many.

ObjectType string

The type of the related object (e.g. account, contact).

Values []string

IDs of the related entities.

UpdatedAt string

ISO 8601 timestamp of when the entity was last updated, or null.

ExternalID stringOptional

External identifier for the entity, or null if unset.

Update a task

package main

import (
  "context"
  "fmt"

  "github.com/Lightfld/lightfield-go"
  "github.com/Lightfld/lightfield-go/option"
)

func main() {
  client := githubcomlightfldlightfieldgo.NewClient(
    option.WithAPIKey("My API Key"),
  )
  taskUpdateResponse, err := client.Task.Update(
    context.TODO(),
    "id",
    githubcomlightfldlightfieldgo.TaskUpdateParams{

    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", taskUpdateResponse.ID)
}
{
  "id": "id",
  "createdAt": "createdAt",
  "fields": {
    "foo": {
      "value": "string",
      "valueType": "ADDRESS"
    }
  },
  "httpLink": "httpLink",
  "relationships": {
    "foo": {
      "cardinality": "cardinality",
      "objectType": "objectType",
      "values": [
        "string"
      ]
    }
  },
  "updatedAt": "updatedAt",
  "externalId": "externalId"
}
Returns Examples
{
  "id": "id",
  "createdAt": "createdAt",
  "fields": {
    "foo": {
      "value": "string",
      "valueType": "ADDRESS"
    }
  },
  "httpLink": "httpLink",
  "relationships": {
    "foo": {
      "cardinality": "cardinality",
      "objectType": "objectType",
      "values": [
        "string"
      ]
    }
  },
  "updatedAt": "updatedAt",
  "externalId": "externalId"
}