apiv2

package
v0.32.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 14, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package apiv2 provides typed wrappers for ClickUp API v2 operations that are missing from the go-clickup library.

go-clickup handles most V2 operations correctly. This package fills the gaps documented in api/GO_CLICKUP_GAPS.md:

  • UpdateTask with points and markdown_content
  • Time entry CRUD
  • Comment replies (threaded comments)
  • Space tags

All wrappers use the existing api.Client for HTTP transport (auth, rate limiting) and auto-generated clickupv2 types for request/response serialization.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddDependencyLocal

func AddDependencyLocal(ctx context.Context, client *api.Client, taskID string, body any, qs string) error

AddDependencyLocal adds a dependency to a task.

func CreateTaskLocal

func CreateTaskLocal(ctx context.Context, client *api.Client, listID string, req *clickup.TaskRequest, qs string) (*clickup.Task, error)

CreateTaskLocal creates a task in a list.

func DeleteDependencyLocal

func DeleteDependencyLocal(ctx context.Context, client *api.Client, taskID, qs string) error

DeleteDependencyLocal deletes a dependency from a task.

func DeleteTaskLocal

func DeleteTaskLocal(ctx context.Context, client *api.Client, taskID, qs string) error

DeleteTaskLocal deletes a task.

func DependencyQuery

func DependencyQuery(dependsOn, dependencyOf string, customTaskIDs bool, teamID string) string

DependencyQuery builds a query string for dependency endpoints.

func Do

func Do(ctx context.Context, client *api.Client, method, path string, body any, result any) error

Do is a public wrapper around the unexported do() helper, for use by the attachments module.

func FetchTeamTasks

func FetchTeamTasks(ctx context.Context, client *api.Client, teamID string, page int, extraParams string) ([]clickup.Task, error)

FetchTeamTasks fetches one page of tasks from the team endpoint with optional extra query params. Used by inbox and view for paginated team task fetching.

func GetAccessibleCustomFieldsLocal

func GetAccessibleCustomFieldsLocal(ctx context.Context, client *api.Client, listID string) ([]clickup.CustomField, error)

GetAccessibleCustomFieldsLocal fetches accessible custom fields for a list.

func GetFilteredTeamTasksLocal

func GetFilteredTeamTasksLocal(ctx context.Context, client *api.Client, teamID string, params FilteredTeamTasksParams) ([]clickup.Task, error)

GetFilteredTeamTasksLocal fetches filtered tasks across a team/workspace.

func GetFolderlessListsLocal

func GetFolderlessListsLocal(ctx context.Context, client *api.Client, spaceID string, archived bool) ([]clickup.List, error)

GetFolderlessListsLocal fetches folderless lists for a space.

func GetFoldersLocal

func GetFoldersLocal(ctx context.Context, client *api.Client, spaceID string, archived bool) ([]clickup.Folder, error)

GetFoldersLocal fetches folders for a space.

func GetListLocal

func GetListLocal(ctx context.Context, client *api.Client, listID string) (*clickup.List, error)

GetListLocal fetches a single list.

func GetListsLocal

func GetListsLocal(ctx context.Context, client *api.Client, folderID string, archived bool) ([]clickup.List, error)

GetListsLocal fetches lists for a folder.

func GetSpacesLocal

func GetSpacesLocal(ctx context.Context, client *api.Client, teamID string, archived bool) ([]clickup.Space, error)

GetSpacesLocal fetches spaces for a team.

func GetTaskLocal

func GetTaskLocal(ctx context.Context, client *api.Client, taskID, qs string) (*clickup.Task, error)

GetTaskLocal fetches a single task. qs is a query string (e.g. from TaskQuery).

func GetTasksLocal

func GetTasksLocal(ctx context.Context, client *api.Client, listID, qs string) ([]clickup.Task, error)

GetTasksLocal fetches tasks from a list. qs is a query string.

func GetTeamsLocal

func GetTeamsLocal(ctx context.Context, client *api.Client) ([]clickup.Team, error)

GetTeamsLocal fetches all teams (workspaces).

func RemoveCustomFieldValueLocal

func RemoveCustomFieldValueLocal(ctx context.Context, client *api.Client, taskID, fieldID, qs string) error

RemoveCustomFieldValueLocal removes a custom field value from a task.

func SetCustomFieldValueLocal

func SetCustomFieldValueLocal(ctx context.Context, client *api.Client, taskID, fieldID string, value any, qs string) error

SetCustomFieldValueLocal sets a custom field value on a task.

func TaskQuery

func TaskQuery(customTaskIDs bool, teamID string, includeSubtasks bool) string

TaskQuery builds a query string for task endpoints supporting custom task IDs and optional subtask inclusion.

func TaskQueryMD

func TaskQueryMD(customTaskIDs bool, teamID string) string

TaskQueryMD builds a query string like TaskQuery but also includes include_markdown_description=true.

func UpdateTaskLocal

func UpdateTaskLocal(ctx context.Context, client *api.Client, taskID string, req any, qs string) (*clickup.Task, error)

UpdateTaskLocal updates a task. req is any because both TaskUpdateRequest and TaskAssigneeUpdateRequest are used.

Types

type AttachmentResponse

type AttachmentResponse struct {
	ID             string `json:"id"`
	Version        string `json:"version"`
	Date           int    `json:"date"`
	Title          string `json:"title"`
	Extension      string `json:"extension"`
	ThumbnailSmall string `json:"thumbnail_small"`
	ThumbnailLarge string `json:"thumbnail_large"`
	URL            string `json:"url"`
}

AttachmentResponse is the response from CreateTaskAttachment.

func CreateTaskAttachment

func CreateTaskAttachment(ctx context.Context, client *api.Client, taskID, filename string, reader io.Reader, params ...CreateTaskAttachmentParams) (*AttachmentResponse, error)

CreateTaskAttachment uploads a file as an attachment to a task.

type CreateTaskAttachmentParams

type CreateTaskAttachmentParams struct {
	CustomTaskIDs bool
	TeamID        string
}

CreateTaskAttachmentParams holds optional parameters for attachment upload.

type FilteredTeamTasksParams

type FilteredTeamTasksParams struct {
	OrderBy       string
	Reverse       bool
	Subtasks      bool
	Assignees     []string
	Page          int
	ListIDs       []string
	Statuses      []string
	Tags          []string
	DateUpdGt     int64
	DateUpdLt     int64
	DateCreatedGt int64
	DateCreatedLt int64
	DueDateGt     int64
	DueDateLt     int64
	IncludeClosed bool
	Archived      bool
}

FilteredTeamTasksParams holds parameters for GetFilteredTeamTasksLocal.

type UserInfo added in v0.32.0

type UserInfo struct {
	ID       int    `json:"id"`
	Username string `json:"username"`
}

UserInfo holds the current user's identity from the /user endpoint.

func GetUserLocal added in v0.32.0

func GetUserLocal(ctx context.Context, client *api.Client) (*UserInfo, error)

GetUserLocal fetches the currently authenticated user.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL