client

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package client provides an HTTP client for interacting with the Prolific API. It handles authentication, request execution, and response parsing for all supported Prolific resources including studies, workspaces, projects, hooks, messages, and AI Task Builder operations.

Index

Constants

View Source
const DefaultRecordLimit = 200

DefaultRecordLimit defines how many records to return by default.

View Source
const DefaultRecordOffset = 0

DefaultRecordOffset defines how many records we should offset to start with.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API interface {
	GetMe() (*MeResponse, error)

	CreateStudy(model.CreateStudy) (*model.Study, error)
	DuplicateStudy(ID string) (*model.Study, error)
	GetStudies(status, projectID string) (*ListStudiesResponse, error)
	GetStudy(ID string) (*model.Study, error)
	GetSubmissions(ID string, limit, offset int) (*ListSubmissionsResponse, error)
	RequestSubmissionReturn(ID string, reasons []string) (*RequestSubmissionReturnResponse, error)
	TransitionSubmission(ID string, payload TransitionSubmissionPayload) (*TransitionSubmissionResponse, error)
	BulkApproveSubmissions(payload BulkApproveSubmissionsPayload) error
	TransitionStudy(ID, action string) (*TransitionStudyResponse, error)
	UpdateStudy(ID string, study any) (*model.Study, error)
	GetStudySubmissionCounts(ID string) (*model.SubmissionCounts, error)
	GetStudyCredentialsUsageReportCSV(ID string) (string, error)
	ExportDemographics(ID string) (string, error)
	TestStudy(ID string) (*TestStudyResponse, error)
	CreateCredentialPool(credentials string, workspaceID string) (*CredentialPoolResponse, error)
	UpdateCredentialPool(credentialPoolID string, credentials string) (*CredentialPoolResponse, error)
	ListCredentialPools(workspaceID string) (*ListCredentialPoolsResponse, error)

	GetCampaigns(workspaceID string, limit, offset int) (*ListCampaignsResponse, error)

	GetCollections(workspaceID string, limit, offset int) (*ListCollectionsResponse, error)
	GetCollection(ID string) (*model.Collection, error)
	InitiateCollectionExport(collectionID string) (*CollectionExportResponse, error)
	GetCollectionExportStatus(collectionID, exportID string) (*CollectionExportResponse, error)
	UpdateCollection(ID string, collection model.UpdateCollection) (*model.Collection, error)

	GetHooks(workspaceID string, enabled bool, limit, offset int) (*ListHooksResponse, error)
	GetHookEventTypes() (*ListHookEventTypesResponse, error)
	GetHookSecrets(workspaceID string) (*ListSecretsResponse, error)
	CreateHookSecret(payload CreateSecretPayload) (*model.Secret, error)
	GetEvents(subscriptionID string, limit, offset int) (*ListHookEventsResponse, error)
	CreateHookSubscription(payload CreateHookPayload) (*model.Hook, string, error)
	ConfirmHookSubscription(subscriptionID, secret string) (*model.Hook, error)
	UpdateHookSubscription(subscriptionID string, payload UpdateHookPayload) (*model.Hook, error)
	DeleteHookSubscription(subscriptionID string) error

	GetWorkspaces(limit, offset int) (*ListWorkspacesResponse, error)
	GetWorkspaceBalance(workspaceID string) (*WorkspaceBalanceResponse, error)
	CreateWorkspace(workspace model.Workspace) (*CreateWorkspacesResponse, error)

	CreateInvitation(invitation model.CreateInvitation) (*CreateInvitationResponse, error)

	GetProjects(workspaceID string, limit, offset int) (*ListProjectsResponse, error)
	CreateProject(workspaceID string, project model.Project) (*CreateProjectResponse, error)
	GetProject(ID string) (*model.Project, error)

	GetParticipantGroups(workspaceID string, limit, offset int) (*ListParticipantGroupsResponse, error)
	GetParticipantGroup(groupID string) (*ViewParticipantGroupResponse, error)
	CreateParticipantGroup(group model.CreateParticipantGroup) (*CreateParticipantGroupResponse, error)
	RemoveParticipantGroupMembers(groupID string, participantIDs []string) (*ViewParticipantGroupResponse, error)

	CreateTestParticipant(email string) (*CreateTestParticipantResponse, error)

	GetFilters() (*ListFiltersResponse, error)

	GetFilterSets(workspaceID string, limit, offset int) (*ListFilterSetsResponse, error)
	GetFilterSet(ID string) (*model.FilterSet, error)
	CreateFilterSet(filterSet model.CreateFilterSet) (*CreateFilterSetResponse, error)

	GetSurveys(researcherID string, limit, offset int) (*ListSurveysResponse, error)
	GetSurvey(ID string) (*model.Survey, error)
	CreateSurvey(survey model.CreateSurvey) (*CreateSurveyResponse, error)
	DeleteSurvey(ID string) error

	GetSurveyResponses(surveyID string, limit, offset int) (*ListSurveyResponsesResponse, error)
	GetSurveyResponse(surveyID, responseID string) (*model.SurveyResponse, error)
	CreateSurveyResponse(surveyID string, response model.CreateSurveyResponseRequest) (*CreateSurveyResponseResponse, error)
	DeleteSurveyResponse(surveyID, responseID string) error
	DeleteAllSurveyResponses(surveyID string) error
	GetSurveyResponseSummary(surveyID string) (*model.SurveySummary, error)

	GetMessages(userID *string, createdAfter *string) (*ListMessagesResponse, error)
	SendMessage(body, recipientID, studyID string) error
	GetUnreadMessages() (*ListUnreadMessagesResponse, error)
	BulkSendMessage(ids []string, body, studyID string) error
	SendGroupMessage(participantGroupID, body string, studyID *string) error

	CreateBonusPayments(payload CreateBonusPaymentsPayload) (*CreateBonusPaymentsResponse, error)
	PayBonusPayments(id string) error

	CreateAITaskBuilderBatch(params CreateBatchParams) (*CreateAITaskBuilderBatchResponse, error)
	CreateAITaskBuilderInstructions(batchID string, instructions CreateAITaskBuilderInstructionsPayload) (*CreateAITaskBuilderInstructionsResponse, error)
	SetupAITaskBuilderBatch(batchID, datasetID string, tasksPerGroup int) (*SetupAITaskBuilderBatchResponse, error)
	CreateAITaskBuilderDataset(workspaceID string, payload CreateAITaskBuilderDatasetPayload) (*CreateAITaskBuilderDatasetResponse, error)
	CreateAITaskBuilderCollection(payload model.CreateAITaskBuilderCollection) (*CreateAITaskBuilderCollectionResponse, error)
	GetAITaskBuilderBatch(batchID string) (*GetAITaskBuilderBatchResponse, error)
	UpdateAITaskBuilderBatch(params UpdateBatchParams) (*UpdateAITaskBuilderBatchResponse, error)
	GetAITaskBuilderBatchStatus(batchID string) (*GetAITaskBuilderBatchStatusResponse, error)
	GetAITaskBuilderBatches(workspaceID string) (*GetAITaskBuilderBatchesResponse, error)
	GetAITaskBuilderResponses(batchID string) (*GetAITaskBuilderResponsesResponse, error)
	GetAITaskBuilderTasks(batchID string) (*GetAITaskBuilderTasksResponse, error)
	InitiateBatchExport(batchID string) (*BatchExportResponse, error)
	GetBatchExportStatus(batchID, exportID string) (*BatchExportResponse, error)
	GetAITaskBuilderDatasetStatus(datasetID string) (*GetAITaskBuilderDatasetStatusResponse, error)
	GetAITaskBuilderDatasetUploadURL(datasetID, fileName string) (*GetAITaskBuilderDatasetUploadURLResponse, error)
}

API represents what is allowed to be called on the Prolific client.

type BatchExportResponse added in v1.0.0

type BatchExportResponse struct {
	Status    string `json:"status"`
	ExportID  string `json:"export_id,omitempty"`
	URL       string `json:"url,omitempty"`
	ExpiresAt string `json:"expires_at,omitempty"`
}

BatchExportResponse is the response for the batch export endpoints. For POST (initiate): Status is "generating" (ExportID set) or "complete" (URL/ExpiresAt set). For GET (poll): Status is "generating", "complete", or "failed".

type BulkApproveSubmissionsPayload added in v1.0.0

type BulkApproveSubmissionsPayload struct {
	SubmissionIDs  []string `json:"submission_ids,omitempty"`
	StudyID        string   `json:"study_id,omitempty"`
	ParticipantIDs []string `json:"participant_ids,omitempty"`
}

BulkApproveSubmissionsPayload represents the JSON payload for bulk approving submissions.

type BulkSendMessagePayload added in v0.0.58

type BulkSendMessagePayload struct {
	IDs     []string `json:"ids"`
	Body    string   `json:"body"`
	StudyID string   `json:"study_id"`
}

BulkSendMessagePayload represents the JSON payload for sending a message to multiple participants.

type Client

type Client struct {
	Client  *http.Client
	BaseURL string
	Token   string
	Debug   bool
}

Client is responsible for interacting with the Prolific API.

func New

func New() Client

New will return a new Prolific client.

func (*Client) BulkApproveSubmissions added in v1.0.0

func (c *Client) BulkApproveSubmissions(payload BulkApproveSubmissionsPayload) error

BulkApproveSubmissions will bulk approve multiple submissions.

func (*Client) BulkSendMessage added in v0.0.58

func (c *Client) BulkSendMessage(ids []string, body, studyID string) error

BulkSendMessage will send a message to multiple participants

func (*Client) ConfirmHookSubscription added in v1.0.0

func (c *Client) ConfirmHookSubscription(subscriptionID, secret string) (*model.Hook, error)

ConfirmHookSubscription confirms a webhook subscription using the secret returned in the X-Hook-Secret header when the subscription was created.

func (*Client) CreateAITaskBuilderBatch added in v0.0.57

func (c *Client) CreateAITaskBuilderBatch(params CreateBatchParams) (*CreateAITaskBuilderBatchResponse, error)

CreateAITaskBuilderBatch will create an AI Task Builder batch.

func (*Client) CreateAITaskBuilderCollection added in v0.0.58

func (c *Client) CreateAITaskBuilderCollection(payload model.CreateAITaskBuilderCollection) (*CreateAITaskBuilderCollectionResponse, error)

CreateAITaskBuilderCollection creates a new AI Task Builder collection.

func (*Client) CreateAITaskBuilderDataset added in v0.0.57

func (c *Client) CreateAITaskBuilderDataset(workspaceID string, payload CreateAITaskBuilderDatasetPayload) (*CreateAITaskBuilderDatasetResponse, error)

CreateAITaskBuilderDataset will create a new AI Task Builder dataset. The workspaceID parameter specifies which workspace the dataset belongs to.

func (*Client) CreateAITaskBuilderInstructions added in v0.0.57

func (c *Client) CreateAITaskBuilderInstructions(batchID string, instructions CreateAITaskBuilderInstructionsPayload) (*CreateAITaskBuilderInstructionsResponse, error)

CreateAITaskBuilderInstructions will create instructions for an AI Task Builder batch.

func (*Client) CreateBonusPayments added in v0.0.58

func (c *Client) CreateBonusPayments(payload CreateBonusPaymentsPayload) (*CreateBonusPaymentsResponse, error)

CreateBonusPayments creates bonus payment records for participants in a study.

func (*Client) CreateCredentialPool added in v0.0.57

func (c *Client) CreateCredentialPool(credentials string, workspaceID string) (*CredentialPoolResponse, error)

CreateCredentialPool creates a new credential pool with the provided credentials. credentials should be a comma-separated string with newlines between entries.

func (*Client) CreateFilterSet added in v1.0.0

func (c *Client) CreateFilterSet(filterSet model.CreateFilterSet) (*CreateFilterSetResponse, error)

CreateFilterSet will create a new filter set

func (*Client) CreateHookSecret added in v1.0.0

func (c *Client) CreateHookSecret(payload CreateSecretPayload) (*model.Secret, error)

CreateHookSecret will create (or replace) a secret for a Workspace.

func (*Client) CreateHookSubscription added in v1.0.0

func (c *Client) CreateHookSubscription(payload CreateHookPayload) (*model.Hook, string, error)

CreateHookSubscription will create a new hook subscription for a workspace. It returns the hook, the X-Hook-Secret header value needed to confirm the subscription, and any error.

func (*Client) CreateInvitation added in v1.0.0

func (c *Client) CreateInvitation(invitation model.CreateInvitation) (*CreateInvitationResponse, error)

CreateInvitation will create invitations for the given email addresses

func (*Client) CreateParticipantGroup added in v1.0.0

func (c *Client) CreateParticipantGroup(group model.CreateParticipantGroup) (*CreateParticipantGroupResponse, error)

CreateParticipantGroup will create a new participant group

func (*Client) CreateProject

func (c *Client) CreateProject(workspaceID string, project model.Project) (*CreateProjectResponse, error)

CreateProject will create you a project

func (*Client) CreateStudy

func (c *Client) CreateStudy(study model.CreateStudy) (*model.Study, error)

CreateStudy is responsible for hitting the Prolific API to create a study.

func (*Client) CreateSurvey added in v1.0.0

func (c *Client) CreateSurvey(survey model.CreateSurvey) (*CreateSurveyResponse, error)

CreateSurvey will create a new survey

func (*Client) CreateSurveyResponse added in v1.0.0

func (c *Client) CreateSurveyResponse(surveyID string, surveyResponse model.CreateSurveyResponseRequest) (*CreateSurveyResponseResponse, error)

CreateSurveyResponse will create a new survey response

func (*Client) CreateTestParticipant added in v1.0.0

func (c *Client) CreateTestParticipant(email string) (*CreateTestParticipantResponse, error)

CreateTestParticipant creates a test participant for the researcher with the given email.

func (*Client) CreateWorkspace

func (c *Client) CreateWorkspace(workspace model.Workspace) (*CreateWorkspacesResponse, error)

CreateWorkspace will create you a workspace

func (*Client) DeleteAllSurveyResponses added in v1.0.0

func (c *Client) DeleteAllSurveyResponses(surveyID string) error

DeleteAllSurveyResponses will delete all responses for a survey

func (*Client) DeleteHookSubscription added in v1.0.0

func (c *Client) DeleteHookSubscription(subscriptionID string) error

DeleteHookSubscription deletes a hook subscription by ID.

func (*Client) DeleteSurvey added in v1.0.0

func (c *Client) DeleteSurvey(ID string) error

DeleteSurvey will delete the survey with the given ID

func (*Client) DeleteSurveyResponse added in v1.0.0

func (c *Client) DeleteSurveyResponse(surveyID, responseID string) error

DeleteSurveyResponse will delete a single survey response

func (*Client) DuplicateStudy

func (c *Client) DuplicateStudy(ID string) (*model.Study, error)

DuplicateStudy will duplicate an existing study.

func (*Client) Execute

func (c *Client) Execute(method, url string, body any, response any) (*http.Response, error)

Execute runs an HTTP request.

func (*Client) ExportDemographics added in v1.0.0

func (c *Client) ExportDemographics(ID string) (string, error)

ExportDemographics triggers a demographic data export for all submissions in a study.

func (*Client) GetAITaskBuilderBatch

func (c *Client) GetAITaskBuilderBatch(batchID string) (*GetAITaskBuilderBatchResponse, error)

GetAITaskBuilderBatch will return details of an AI Task Builder batch.

func (*Client) GetAITaskBuilderBatchStatus

func (c *Client) GetAITaskBuilderBatchStatus(batchID string) (*GetAITaskBuilderBatchStatusResponse, error)

GetAITaskBuilderBatchStatus will return the status of an AI Task Builder batch.

func (*Client) GetAITaskBuilderBatches

func (c *Client) GetAITaskBuilderBatches(workspaceID string) (*GetAITaskBuilderBatchesResponse, error)

GetAITaskBuilderBatches will return the batches for a given workspace.

func (*Client) GetAITaskBuilderDatasetStatus

func (c *Client) GetAITaskBuilderDatasetStatus(datasetID string) (*GetAITaskBuilderDatasetStatusResponse, error)

GetAITaskBuilderDatasetStatus will return the status of an AI Task Builder dataset.

func (*Client) GetAITaskBuilderDatasetUploadURL added in v0.0.57

func (c *Client) GetAITaskBuilderDatasetUploadURL(datasetID, fileName string) (*GetAITaskBuilderDatasetUploadURLResponse, error)

GetAITaskBuilderDatasetUploadURL will get an upload URL for an AI Task Builder dataset.

func (*Client) GetAITaskBuilderResponses

func (c *Client) GetAITaskBuilderResponses(batchID string) (*GetAITaskBuilderResponsesResponse, error)

GetAITaskBuilderResponses will return the responses for an AI Task Builder batch.

func (*Client) GetAITaskBuilderTasks added in v0.0.57

func (c *Client) GetAITaskBuilderTasks(batchID string) (*GetAITaskBuilderTasksResponse, error)

GetAITaskBuilderTasks will return the tasks for an AI Task Builder batch.

func (*Client) GetBatchExportStatus added in v1.0.0

func (c *Client) GetBatchExportStatus(batchID, exportID string) (*BatchExportResponse, error)

GetBatchExportStatus polls the status of an in-progress batch export job. Returns "generating", "complete" (with URL), or "failed".

func (*Client) GetCampaigns

func (c *Client) GetCampaigns(workspaceID string, limit, offset int) (*ListCampaignsResponse, error)

GetCampaigns will return you a list of Campaign objects.

func (*Client) GetCollection added in v0.0.58

func (c *Client) GetCollection(ID string) (*model.Collection, error)

GetCollection will return a single Collection by ID.

func (*Client) GetCollectionExportStatus added in v0.0.64

func (c *Client) GetCollectionExportStatus(collectionID, exportID string) (*CollectionExportResponse, error)

GetCollectionExportStatus polls the status of an in-progress export job. Returns "generating", "complete" (with URL), or "failed".

func (*Client) GetCollections added in v0.0.58

func (c *Client) GetCollections(workspaceID string, limit, offset int) (*ListCollectionsResponse, error)

GetCollections will return a list of Collection objects for a workspace.

func (*Client) GetEvents

func (c *Client) GetEvents(subscriptionID string, limit, offset int) (*ListHookEventsResponse, error)

GetEvents will return events created for a subscription

func (*Client) GetFilterSet

func (c *Client) GetFilterSet(ID string) (*model.FilterSet, error)

GetFilterSet will return the filter set for the given filter set ID

func (*Client) GetFilterSets

func (c *Client) GetFilterSets(workspaceID string, limit, offset int) (*ListFilterSetsResponse, error)

GetFilterSets will return the filter sets in a workspace

func (*Client) GetFilters

func (c *Client) GetFilters() (*ListFiltersResponse, error)

func (*Client) GetHookEventTypes

func (c *Client) GetHookEventTypes() (*ListHookEventTypesResponse, error)

GetHookEventTypes will return all of the event types you can subscribe a hook for.

func (*Client) GetHookSecrets

func (c *Client) GetHookSecrets(workspaceID string) (*ListSecretsResponse, error)

GetHookSecrets will return the secrets for a Workspace

func (*Client) GetHooks

func (c *Client) GetHooks(workspaceID string, enabled bool, limit, offset int) (*ListHooksResponse, error)

GetHooks will return the subscriptions to event types for current user.

func (*Client) GetMe

func (c *Client) GetMe() (*MeResponse, error)

GetMe will return your user account details.

func (*Client) GetMessages

func (c *Client) GetMessages(userID *string, createdAfter *string) (*ListMessagesResponse, error)

GetMessages will return the messages for the authenticated user

func (*Client) GetParticipantGroup

func (c *Client) GetParticipantGroup(groupID string) (*ViewParticipantGroupResponse, error)

GetParticipantGroup will return the membership in the group

func (*Client) GetParticipantGroups

func (c *Client) GetParticipantGroups(workspaceID string, limit, offset int) (*ListParticipantGroupsResponse, error)

GetParticipantGroups will return all the participant groups you have access to for a given WorkspaceID

func (*Client) GetProject

func (c *Client) GetProject(ID string) (*model.Project, error)

GetProject will return the project for the given project ID

func (*Client) GetProjects

func (c *Client) GetProjects(workspaceID string, limit, offset int) (*ListProjectsResponse, error)

GetProjects will return the projects for the given workspace ID

func (*Client) GetStudies

func (c *Client) GetStudies(status, projectID string) (*ListStudiesResponse, error)

GetStudies will return you a list of Study objects.

func (*Client) GetStudy

func (c *Client) GetStudy(ID string) (*model.Study, error)

GetStudy will return a single study

func (*Client) GetStudyCredentialsUsageReportCSV added in v0.0.57

func (c *Client) GetStudyCredentialsUsageReportCSV(ID string) (string, error)

GetStudyCredentialsUsageReportCSV will return the credentials usage report for a study as CSV.

func (*Client) GetStudySubmissionCounts added in v1.0.0

func (c *Client) GetStudySubmissionCounts(ID string) (*model.SubmissionCounts, error)

GetStudySubmissionCounts returns submission counts grouped by status for a study.

func (*Client) GetSubmissions

func (c *Client) GetSubmissions(ID string, limit, offset int) (*ListSubmissionsResponse, error)

GetSubmissions will return submission data for a given study.

func (*Client) GetSurvey added in v1.0.0

func (c *Client) GetSurvey(ID string) (*model.Survey, error)

GetSurvey will return the survey for the given survey ID

func (*Client) GetSurveyResponse added in v1.0.0

func (c *Client) GetSurveyResponse(surveyID, responseID string) (*model.SurveyResponse, error)

GetSurveyResponse will return a single survey response

func (*Client) GetSurveyResponseSummary added in v1.0.0

func (c *Client) GetSurveyResponseSummary(surveyID string) (*model.SurveySummary, error)

GetSurveyResponseSummary will return the response summary for a survey

func (*Client) GetSurveyResponses added in v1.0.0

func (c *Client) GetSurveyResponses(surveyID string, limit, offset int) (*ListSurveyResponsesResponse, error)

GetSurveyResponses will return all responses for a survey

func (*Client) GetSurveys added in v1.0.0

func (c *Client) GetSurveys(researcherID string, limit, offset int) (*ListSurveysResponse, error)

GetSurveys will return the surveys for a researcher

func (*Client) GetUnreadMessages

func (c *Client) GetUnreadMessages() (*ListUnreadMessagesResponse, error)

GetUnreadMessages will return the unread messages for the authenticated user

func (*Client) GetWorkspaceBalance added in v1.0.0

func (c *Client) GetWorkspaceBalance(workspaceID string) (*WorkspaceBalanceResponse, error)

GetWorkspaceBalance will return the balance for a workspace.

func (*Client) GetWorkspaces

func (c *Client) GetWorkspaces(limit, offset int) (*ListWorkspacesResponse, error)

func (*Client) InitiateBatchExport added in v1.0.0

func (c *Client) InitiateBatchExport(batchID string) (*BatchExportResponse, error)

InitiateBatchExport starts a batch export job via POST. Returns "generating" + ExportID (202) if a new job was enqueued, or "complete" + URL immediately (200) if a valid export already exists.

func (*Client) InitiateCollectionExport added in v0.0.64

func (c *Client) InitiateCollectionExport(collectionID string) (*CollectionExportResponse, error)

InitiateCollectionExport starts a collection export job via POST. Returns "generating" + ExportID (202) if a new job was enqueued, or "complete" + URL immediately (200) if a valid export already exists.

func (*Client) ListCredentialPools added in v0.0.57

func (c *Client) ListCredentialPools(workspaceID string) (*ListCredentialPoolsResponse, error)

ListCredentialPools retrieves a list of credential pools for a specific workspace.

func (*Client) PayBonusPayments added in v0.0.58

func (c *Client) PayBonusPayments(id string) error

PayBonusPayments triggers asynchronous payment of previously created bonus records.

func (*Client) RemoveParticipantGroupMembers added in v1.0.0

func (c *Client) RemoveParticipantGroupMembers(groupID string, participantIDs []string) (*ViewParticipantGroupResponse, error)

func (*Client) RequestSubmissionReturn added in v0.0.62

func (c *Client) RequestSubmissionReturn(ID string, reasons []string) (*RequestSubmissionReturnResponse, error)

RequestSubmissionReturn requests a participant to return a submission.

func (*Client) SendGroupMessage added in v0.0.58

func (c *Client) SendGroupMessage(participantGroupID, body string, studyID *string) error

SendGroupMessage will send a message to a participant group

func (*Client) SendMessage

func (c *Client) SendMessage(body string, recipientID string, studyID string) error

SendMessage will send a message

func (*Client) SetupAITaskBuilderBatch added in v0.0.57

func (c *Client) SetupAITaskBuilderBatch(batchID, datasetID string, tasksPerGroup int) (*SetupAITaskBuilderBatchResponse, error)

SetupAITaskBuilderBatch will setup an AI Task Builder batch.

func (*Client) TestStudy added in v1.0.0

func (c *Client) TestStudy(ID string) (*TestStudyResponse, error)

TestStudy creates a test run of a study to validate configuration before going live.

func (*Client) TransitionStudy

func (c *Client) TransitionStudy(ID, action string) (*TransitionStudyResponse, error)

TransitionStudy will move the study status to a desired state.

func (*Client) TransitionSubmission added in v1.0.0

func (c *Client) TransitionSubmission(ID string, payload TransitionSubmissionPayload) (*TransitionSubmissionResponse, error)

TransitionSubmission will transition a submission to a new state.

func (*Client) UpdateAITaskBuilderBatch added in v1.0.0

func (c *Client) UpdateAITaskBuilderBatch(params UpdateBatchParams) (*UpdateAITaskBuilderBatchResponse, error)

UpdateAITaskBuilderBatch will update an AI Task Builder batch.

func (*Client) UpdateCollection added in v0.0.58

func (c *Client) UpdateCollection(ID string, collection model.UpdateCollection) (*model.Collection, error)

UpdateCollection will update a collection with the given ID

func (*Client) UpdateCredentialPool added in v0.0.57

func (c *Client) UpdateCredentialPool(credentialPoolID string, credentials string) (*CredentialPoolResponse, error)

UpdateCredentialPool updates an existing credential pool with new credentials. credentials should be a comma-separated string with newlines between entries.

func (*Client) UpdateHookSubscription added in v1.0.0

func (c *Client) UpdateHookSubscription(subscriptionID string, payload UpdateHookPayload) (*model.Hook, error)

UpdateHookSubscription updates an existing webhook subscription.

func (*Client) UpdateStudy

func (c *Client) UpdateStudy(ID string, study any) (*model.Study, error)

UpdateStudy is responsible for updating the Study with a PATCH request.

type CollectionExportResponse added in v0.0.64

type CollectionExportResponse struct {
	Status    string `json:"status"`
	ExportID  string `json:"export_id,omitempty"`
	URL       string `json:"url,omitempty"`
	ExpiresAt string `json:"expires_at,omitempty"`
}

CollectionExportResponse is the response for the collection export endpoints. For POST (initiate): Status is "generating" (ExportID set) or "complete" (URL/ExpiresAt set). For GET (poll): Status is "generating", "complete", or "failed".

type CompletionCodeData added in v1.0.0

type CompletionCodeData struct {
	PercentageOfReward   float64 `json:"percentage_of_reward"`
	MessageToParticipant string  `json:"message_to_participant,omitempty"`
}

CompletionCodeData represents the data for a dynamic payment completion code.

type CreateAITaskBuilderBatchPayload added in v0.0.57

type CreateAITaskBuilderBatchPayload struct {
	Name        string      `json:"name"`
	WorkspaceID string      `json:"workspace_id"`
	DatasetID   string      `json:"dataset_id"`
	TaskDetails TaskDetails `json:"task_details"`
}

CreateAITaskBuilderBatchPayload represents the JSON payload for creating an AI Task Builder batch

type CreateAITaskBuilderBatchResponse added in v0.0.57

type CreateAITaskBuilderBatchResponse struct {
	ID                    string              `json:"id"`
	CreatedAt             string              `json:"created_at"`
	CreatedBy             string              `json:"created_by"`
	Name                  string              `json:"name"`
	Status                string              `json:"status"`
	TotalTaskCount        int                 `json:"total_task_count"`
	TotalInstructionCount int                 `json:"total_instruction_count"`
	TotalTaskGroups       *int                `json:"total_task_groups,omitempty"`
	WorkspaceID           string              `json:"workspace_id"`
	Datasets              []DatasetReference  `json:"datasets"`
	TaskDetails           TaskDetailsResponse `json:"task_details"`
}

CreateAITaskBuilderBatchResponse is the response for creating an AI Task Builder batch.

type CreateAITaskBuilderCollectionResponse added in v0.0.58

type CreateAITaskBuilderCollectionResponse struct {
	ID              string                 `json:"id"`
	Name            string                 `json:"name"`
	WorkspaceID     string                 `json:"workspace_id"`
	SchemaVersion   int                    `json:"schema_version"`
	CreatedBy       string                 `json:"created_by"`
	TaskDetails     *model.TaskDetails     `json:"task_details,omitempty"`
	CollectionItems []model.CollectionPage `json:"collection_items"`
}

CreateAITaskBuilderCollectionResponse is the response for creating an AI Task Builder collection.

type CreateAITaskBuilderDatasetPayload added in v0.0.57

type CreateAITaskBuilderDatasetPayload struct {
	Name        string `json:"name"`
	WorkspaceID string `json:"workspace_id"`
}

CreateAITaskBuilderDatasetPayload represents the request for creating a dataset

type CreateAITaskBuilderDatasetResponse added in v0.0.57

type CreateAITaskBuilderDatasetResponse struct {
	ID                  string              `json:"id"`
	Name                string              `json:"name"`
	CreatedAt           string              `json:"created_at"`
	CreatedBy           string              `json:"created_by"`
	Status              model.DatasetStatus `json:"status"`
	TotalDatapointCount int                 `json:"total_datapoint_count"`
	WorkspaceID         string              `json:"workspace_id"`
}

CreateAITaskBuilderDatasetResponse is the response for creating a dataset

type CreateAITaskBuilderInstructionsPayload added in v0.0.57

type CreateAITaskBuilderInstructionsPayload struct {
	Instructions []Instruction `json:"instructions"`
}

CreateAITaskBuilderInstructionsPayload represents the JSON payload for creating AI Task Builder instructions

type CreateAITaskBuilderInstructionsResponse added in v0.0.57

type CreateAITaskBuilderInstructionsResponse []model.Instruction

CreateAITaskBuilderInstructionsResponse is the response for creating AI Task Builder instructions.

type CreateBatchParams added in v0.0.57

type CreateBatchParams struct {
	Name             string `json:"name"`
	WorkspaceID      string `json:"workspace_id"`
	DatasetID        string `json:"dataset_id"`
	TaskName         string `json:"task_name"`
	TaskIntroduction string `json:"task_introduction"`
	TaskSteps        string `json:"task_steps"`
}

CreateBatchParams represents the parameters for creating an AI Task Builder batch.

type CreateBonusPaymentsPayload added in v0.0.58

type CreateBonusPaymentsPayload struct {
	StudyID    string `json:"study_id"`
	CSVBonuses string `json:"csv_bonuses"`
}

CreateBonusPaymentsPayload represents the JSON payload for creating bonus payments

type CreateBonusPaymentsResponse added in v0.0.58

type CreateBonusPaymentsResponse struct {
	ID          string  `json:"id"`
	Study       string  `json:"study"`
	Amount      float64 `json:"amount"`
	Fees        float64 `json:"fees"`
	VAT         float64 `json:"vat"`
	TotalAmount float64 `json:"total_amount"`
}

CreateBonusPaymentsResponse is the response for creating bonus payments. Monetary fields are returned by the API as floats in minor currency units (e.g., 100.0 = £1.00). Divide by 100 before display via ui.RenderMoney().

type CreateFilterSetResponse added in v1.0.0

type CreateFilterSetResponse struct {
	model.FilterSet
}

CreateFilterSetResponse is the response for creating a filter set.

type CreateHookPayload added in v1.0.0

type CreateHookPayload struct {
	EventType   string `json:"event_type"`
	TargetURL   string `json:"target_url"`
	WorkspaceID string `json:"workspace_id"`
}

CreateHookPayload represents the JSON payload for creating a hook subscription.

type CreateInvitationResponse added in v1.0.0

type CreateInvitationResponse struct {
	Invitations []model.Invitation `json:"invitations"`
}

CreateInvitationResponse is the response for creating invitations.

type CreateParticipantGroupResponse added in v1.0.0

type CreateParticipantGroupResponse struct {
	model.ParticipantGroup
}

CreateParticipantGroupResponse is the response for creating a participant group.

type CreateProjectResponse

type CreateProjectResponse struct {
	model.Project
}

CreateProjectResponse is the response for creating a project.

type CreateSecretPayload added in v1.0.0

type CreateSecretPayload struct {
	WorkspaceID string `json:"workspace_id"`
}

CreateSecretPayload represents the JSON payload for creating a hook secret.

type CreateSurveyResponse added in v1.0.0

type CreateSurveyResponse struct {
	model.Survey
}

CreateSurveyResponse is the response for creating a survey.

type CreateSurveyResponseResponse added in v1.0.0

type CreateSurveyResponseResponse struct {
	model.SurveyResponse
}

CreateSurveyResponseResponse is the response for creating a survey response.

type CreateTestParticipantResponse added in v1.0.0

type CreateTestParticipantResponse struct {
	ParticipantID string `json:"participant_id"`
}

CreateTestParticipantResponse is the response for creating a test participant.

type CreateWorkspacesResponse

type CreateWorkspacesResponse struct {
	model.Workspace
}

CreateWorkspacesResponse is the response for creating a workspace.

type CredentialPoolPayload added in v0.0.57

type CredentialPoolPayload struct {
	Credentials string `json:"credentials"`
	WorkspaceID string `json:"workspace_id"`
}

CredentialPoolPayload represents the JSON payload for creating a credential pool

type CredentialPoolResponse added in v0.0.57

type CredentialPoolResponse struct {
	CredentialPoolID string `json:"credential_pool_id"`
}

CredentialPoolResponse is the response for creating or updating a credential pool.

type CredentialPoolSummary added in v0.0.57

type CredentialPoolSummary struct {
	CredentialPoolID     string `json:"credential_pool_id"`
	TotalCredentials     int    `json:"total_credentials"`
	AvailableCredentials int    `json:"available_credentials"`
}

CredentialPoolSummary represents a summary of a credential pool.

type DatasetReference added in v0.0.57

type DatasetReference struct {
	ID                  string `json:"id"`
	TotalDatapointCount int    `json:"total_datapoint_count"`
}

DatasetReference represents a dataset reference in the batch response

type GetAITaskBuilderBatchResponse

type GetAITaskBuilderBatchResponse struct {
	model.AITaskBuilderBatch
}

GetAITaskBuilderBatchResponse is the response for the get AI Task Builder get batch endpoint.

type GetAITaskBuilderBatchStatusResponse

type GetAITaskBuilderBatchStatusResponse struct {
	model.AITaskBuilderBatchStatus
}

GetAITaskBuilderBatchStatusResponse is the response for the get AI Task Builder get batch status endpoint.

type GetAITaskBuilderBatchesResponse

type GetAITaskBuilderBatchesResponse struct {
	Results []model.AITaskBuilderBatch `json:"results"`
}

GetAITaskBuilderBatchesResponse is the response for the get AI Task Builder get batches by workspace endpoint.

type GetAITaskBuilderDatasetStatusResponse

type GetAITaskBuilderDatasetStatusResponse struct {
	Status model.DatasetStatus `json:"status"`
}

GetAITaskBuilderDatasetStatusResponse is the response for the get AI Task Builder dataset status endpoint.

type GetAITaskBuilderDatasetUploadURLResponse added in v0.0.57

type GetAITaskBuilderDatasetUploadURLResponse struct {
	DatasetID  string `json:"dataset_id"`
	ExpiresAt  string `json:"expires_at"`
	HTTPMethod string `json:"http_method"`
	UploadURL  string `json:"upload_url"`
}

GetAITaskBuilderDatasetUploadURLResponse is the response for getting an upload URL for an AI Task Builder dataset.

type GetAITaskBuilderResponsesResponse

type GetAITaskBuilderResponsesResponse struct {
	Results []model.AITaskBuilderResponse `json:"results"`
	Meta    ResponseMeta                  `json:"meta"`
}

GetAITaskBuilderResponsesResponse is the response for the get AI Task Builder responses endpoint.

type GetAITaskBuilderTasksResponse added in v0.0.57

type GetAITaskBuilderTasksResponse []string

GetAITaskBuilderTasksResponse is the response for the get AI Task Builder tasks endpoint. The API returns a simple array of task ID strings.

type Instruction added in v0.0.57

type Instruction struct {
	Type                 InstructionType     `json:"type"`
	CreatedBy            string              `json:"created_by"`
	Description          string              `json:"description"`
	Options              []InstructionOption `json:"options,omitempty"`
	AnswerLimit          *int                `json:"answer_limit,omitempty"`
	UnitOptions          []UnitOption        `json:"unit_options,omitempty"`
	DefaultUnit          string              `json:"default_unit,omitempty"`
	UnitPosition         string              `json:"unit_position,omitempty"`
	HelperText           string              `json:"helper_text,omitempty"`
	PlaceholderTextInput string              `json:"placeholder_text_input,omitempty"`
	Validation           *ValidationRule     `json:"validation,omitempty"`
	AcceptedFileTypes    []string            `json:"accepted_file_types,omitempty"`
	MaxFileSizeMB        *float64            `json:"max_file_size_mb,omitempty"`
	MinFileCount         *int                `json:"min_file_count,omitempty"`
	MaxFileCount         *int                `json:"max_file_count,omitempty"`
}

Instruction represents a single instruction in the request payload

type InstructionOption added in v0.0.57

type InstructionOption struct {
	Label     string `json:"label"`
	Value     string `json:"value"`
	Heading   string `json:"heading,omitempty"`
	Exclusive bool   `json:"exclusive,omitempty"`
}

InstructionOption represents an option for multiple choice instructions

type InstructionType added in v0.0.57

type InstructionType string

InstructionType represents the type of instruction.

const (
	// InstructionTypeMultipleChoice represents a multiple choice instruction.
	InstructionTypeMultipleChoice InstructionType = "multiple_choice"
	// InstructionTypeFreeText represents a free text instruction.
	InstructionTypeFreeText InstructionType = "free_text"
	// InstructionTypeMultipleChoiceWithFreeText represents a multiple choice instruction with free text.
	InstructionTypeMultipleChoiceWithFreeText InstructionType = "multiple_choice_with_free_text"
	// InstructionTypeFreeTextWithUnit represents a free text instruction with unit selection.
	InstructionTypeFreeTextWithUnit InstructionType = "free_text_with_unit"
	// InstructionTypeFileUpload represents a file upload instruction.
	InstructionTypeFileUpload InstructionType = "file_upload"
)

type JSONAPIError

type JSONAPIError struct {
	Error struct {
		Status                int    `json:"status"`
		Title                 string `json:"title"`
		ErrorCode             int    `json:"error_code"`
		Detail                any    `json:"detail"`
		AdditionalInformation string `json:"additional_information"`
	} `json:"error"`
}
type JSONAPILinks struct {
	Links struct {
		Self struct {
			Href  string `json:"href"`
			Title string `json:"title"`
		} `json:"self"`
		Next struct {
			Href  any    `json:"href"`
			Title string `json:"title"`
		} `json:"next"`
		Previous struct {
			Href  any    `json:"href"`
			Title string `json:"title"`
		} `json:"previous"`
		Last struct {
			Href  string `json:"href"`
			Title string `json:"title"`
		} `json:"last"`
	} `json:"_links"`
}

JSONAPILinks is the standard pagination data structure.

type JSONAPIMeta

type JSONAPIMeta struct {
	Meta struct {
		Count int `json:"count"`
	} `json:"meta"`
}

JSONAPIMeta is the standard meta data structure.

type ListCampaignsResponse

type ListCampaignsResponse struct {
	Results []model.Campaign `json:"results"`
	*JSONAPILinks
	*JSONAPIMeta
}

ListCampaignsResponse is the response for the campaigns request.

type ListCollectionsResponse added in v0.0.58

type ListCollectionsResponse struct {
	Results []model.Collection `json:"results"`
	*JSONAPIMeta
}

ListCollectionsResponse is the response for the collections API.

type ListCredentialPoolsResponse added in v0.0.57

type ListCredentialPoolsResponse struct {
	CredentialPools []CredentialPoolSummary `json:"credential_pools"`
}

ListCredentialPoolsResponse is the response for listing credential pools.

type ListFilterSetsResponse

type ListFilterSetsResponse struct {
	Results []model.FilterSet `json:"results"`
	*JSONAPILinks
	*JSONAPIMeta
}

type ListFiltersResponse

type ListFiltersResponse struct {
	Results []model.Filter `json:"results"`
	*JSONAPILinks
	*JSONAPIMeta
}

type ListHookEventTypesResponse

type ListHookEventTypesResponse struct {
	Results []model.HookEventType `json:"results"`
}

ListHookEventTypesResponse is the response for the event types hook API.

type ListHookEventsResponse

type ListHookEventsResponse struct {
	Results []model.HookEvent `json:"results"`
	*JSONAPIMeta
}

ListHookEventsResponse is the response for the hook events API.

type ListHooksResponse

type ListHooksResponse struct {
	Results []model.Hook `json:"results"`
	*JSONAPIMeta
}

ListHooksResponse is the response for the hook subscriptions.

type ListMessagesResponse

type ListMessagesResponse struct {
	Results []model.Message `json:"results"`
	*JSONAPILinks
	*JSONAPIMeta
}

ListMessagesResponse is the response for the list messages endpoint.

type ListParticipantGroupsResponse

type ListParticipantGroupsResponse struct {
	Results []model.ParticipantGroup `json:"results"`
	*JSONAPILinks
	*JSONAPIMeta
}

ListParticipantGroupsResponse is the list of participant groups response.

type ListProjectsResponse

type ListProjectsResponse struct {
	Results []model.Project `json:"results"`
	*JSONAPIMeta
}

ListProjectsResponse is the response for the list projects endpoint.

type ListSecretsResponse

type ListSecretsResponse struct {
	Results []model.Secret `json:"results"`
}

ListSecretsResponse is the list secrets response.

type ListStudiesResponse

type ListStudiesResponse struct {
	Results []model.Study `json:"results"`
	*JSONAPILinks
	*JSONAPIMeta
}

ListStudiesResponse is the response for the /studies API response.

type ListSubmissionsResponse

type ListSubmissionsResponse struct {
	Results []model.Submission `json:"results"`
	*JSONAPILinks
	*JSONAPIMeta
}

ListSubmissionsResponse is the response for the submissions request.

type ListSurveyResponsesResponse added in v1.0.0

type ListSurveyResponsesResponse struct {
	Results []model.SurveyResponse `json:"results"`
}

ListSurveyResponsesResponse is the response for listing survey responses.

type ListSurveysResponse added in v1.0.0

type ListSurveysResponse struct {
	Results []model.Survey `json:"results"`
}

ListSurveysResponse is the response for the surveys API.

type ListUnreadMessagesResponse

type ListUnreadMessagesResponse struct {
	Results []model.Message `json:"results"`
	*JSONAPILinks
	*JSONAPIMeta
}

ListUnreadMessagesResponse is the response for the unread messages endpoint.

type ListWorkspacesResponse

type ListWorkspacesResponse struct {
	Results []model.Workspace `json:"results"`
	*JSONAPIMeta
}

ListWorkspacesResponse is the response for the list workspaces endpoint.

type MeResponse

type MeResponse struct {
	ID               string `json:"id"`
	Email            string `json:"email"`
	FirstName        string `json:"first_name"`
	LastName         string `json:"last_name"`
	Name             string `json:"name"`
	Username         string `json:"username"`
	UserType         string `json:"user_type"`
	CurrencyCode     string `json:"currency_code"`
	Balance          int    `json:"balance"`
	AvailableBalance int    `json:"available_balance"`
}

MeResponse is a struct that represents your account.

type RemoveParticipantGroupMembersPayload added in v1.0.0

type RemoveParticipantGroupMembersPayload struct {
	ParticipantIDs []string `json:"participant_ids"`
}

RemoveParticipantGroupMembersPayload represents the JSON payload for removing participants from a group.

type RequestSubmissionReturnPayload added in v0.0.62

type RequestSubmissionReturnPayload struct {
	Reasons []string `json:"request_return_reasons"`
}

RequestSubmissionReturnPayload represents the JSON payload for requesting a submission return.

type RequestSubmissionReturnResponse added in v0.0.62

type RequestSubmissionReturnResponse struct {
	ID              string  `json:"id"`
	Status          string  `json:"status"`
	Participant     string  `json:"participant"`
	ReturnRequested *string `json:"return_requested"`
}

RequestSubmissionReturnResponse is the response for requesting a submission return.

type ResponseMeta

type ResponseMeta struct {
	Count int `json:"count"`
}

ResponseMeta contains metadata about the response.

type SendGroupMessagePayload added in v0.0.58

type SendGroupMessagePayload struct {
	ParticipantGroupID string `json:"participant_group_id"`
	Body               string `json:"body"`
	StudyID            string `json:"study_id,omitempty"`
}

SendGroupMessagePayload represents the JSON payload for sending a message to a participant group.

type SendMessagePayload

type SendMessagePayload struct {
	RecipientID string `json:"recipient_id"`
	StudyID     string `json:"study_id"`
	Body        string `json:"body"`
}

SendMessagePayload represents the JSON payload for sending a message.

type SetupAITaskBuilderBatchPayload added in v0.0.57

type SetupAITaskBuilderBatchPayload struct {
	DatasetID     string `json:"dataset_id"`
	TasksPerGroup int    `json:"tasks_per_group"`
}

SetupAITaskBuilderBatchPayload represents the JSON payload for setting up an AI Task Builder batch

type SetupAITaskBuilderBatchResponse added in v0.0.57

type SetupAITaskBuilderBatchResponse struct {
}

SetupAITaskBuilderBatchResponse is the response for setting up an AI Task Builder batch. The API returns 202 Accepted with an empty response body.

type SimpleAPIError added in v0.0.57

type SimpleAPIError struct {
	Message string `json:"message"`
	Detail  string `json:"detail"`
}

SimpleAPIError represents a simpler error format used by some endpoints

type TaskDetails added in v0.0.57

type TaskDetails struct {
	TaskName         string `json:"task_name"`
	TaskIntroduction string `json:"task_introduction"`
	TaskSteps        string `json:"task_steps"`
}

TaskDetails represents the task configuration details for batch creation

type TaskDetailsResponse added in v0.0.57

type TaskDetailsResponse struct {
	TaskName         string `json:"task_name"`
	TaskIntroduction string `json:"task_introduction"`
	TaskSteps        string `json:"task_steps"`
}

TaskDetailsResponse represents the task details in the batch response

type TestStudyResponse added in v1.0.0

type TestStudyResponse struct {
	StudyID  string `json:"study_id"`
	StudyURL string `json:"study_url"`
}

TestStudyResponse is the response for creating a test run of a study.

type TransitionStudyResponse

type TransitionStudyResponse struct {
	ID                      string   `json:"id"`
	Name                    string   `json:"name"`
	InternalName            string   `json:"internal_name"`
	Description             string   `json:"description"`
	ExternalStudyURL        string   `json:"external_study_url"`
	ProlificIDOption        string   `json:"prolific_id_option"`
	CompletionCode          string   `json:"completion_code"`
	CompletionOption        string   `json:"completion_option"`
	TotalAvailablePlaces    int      `json:"total_available_places"`
	EstimatedCompletionTime int      `json:"estimated_completion_time"`
	MaximumAllowedTime      int      `json:"maximum_allowed_time"`
	Reward                  int      `json:"reward"`
	DeviceCompatibility     []string `json:"device_compatibility"`
	PeripheralRequirements  []any    `json:"peripheral_requirements"`
	EligibilityRequirements []any    `json:"eligibility_requirements"`
	Status                  string   `json:"status"`
}

TransitionStudyResponse is the response for transitioning a study to another status.

type TransitionSubmissionPayload added in v1.0.0

type TransitionSubmissionPayload struct {
	Action             string              `json:"action"`
	Message            string              `json:"message,omitempty"`
	RejectionCategory  string              `json:"rejection_category,omitempty"`
	CompletionCode     string              `json:"completion_code,omitempty"`
	CompletionCodeData *CompletionCodeData `json:"completion_code_data,omitempty"`
}

TransitionSubmissionPayload represents the JSON payload for transitioning a submission.

type TransitionSubmissionResponse added in v1.0.0

type TransitionSubmissionResponse struct {
	ID          string  `json:"id"`
	CompletedAt *string `json:"completed_at"`
	EnteredCode *string `json:"entered_code"`
	Participant string  `json:"participant"`
	StartedAt   string  `json:"started_at"`
	Status      string  `json:"status"`
	StudyID     string  `json:"study_id"`
}

TransitionSubmissionResponse is the response for transitioning a submission.

type UnitOption added in v0.0.58

type UnitOption struct {
	Label      string          `json:"label"`
	Value      string          `json:"value"`
	Validation *ValidationRule `json:"validation,omitempty"`
}

UnitOption represents a unit option for free_text_with_unit instructions

type UpdateAITaskBuilderBatchPayload added in v1.0.0

type UpdateAITaskBuilderBatchPayload struct {
	Name        string       `json:"name,omitempty"`
	DatasetID   string       `json:"dataset_id,omitempty"`
	TaskDetails *TaskDetails `json:"task_details,omitempty"`
}

UpdateAITaskBuilderBatchPayload represents the JSON payload for updating an AI Task Builder batch.

type UpdateAITaskBuilderBatchResponse added in v1.0.0

type UpdateAITaskBuilderBatchResponse struct {
	model.AITaskBuilderBatch
}

UpdateAITaskBuilderBatchResponse is the response for the update AI Task Builder batch endpoint.

type UpdateBatchParams added in v1.0.0

type UpdateBatchParams struct {
	BatchID     string
	Name        string
	DatasetID   string
	TaskDetails *TaskDetails // nil means task details will not be updated
}

UpdateBatchParams represents the parameters for updating an AI Task Builder batch.

type UpdateCredentialPoolPayload added in v0.0.57

type UpdateCredentialPoolPayload struct {
	Credentials string `json:"credentials"`
}

UpdateCredentialPoolPayload represents the JSON payload for updating a credential pool

type UpdateHookPayload added in v1.0.0

type UpdateHookPayload struct {
	EventType *string `json:"event_type,omitempty"`
	TargetURL *string `json:"target_url,omitempty"`
	IsEnabled *bool   `json:"is_enabled,omitempty"`
}

UpdateHookPayload represents the JSON payload for updating a hook subscription. All fields are optional; only non-nil fields are sent in the request.

type ValidationRule added in v0.0.62

type ValidationRule struct {
	Type string   `json:"type"`
	Min  *float64 `json:"min"`
	Max  *float64 `json:"max"`
}

ValidationRule represents min/max validation for free_text and free_text_with_unit instructions.

type ViewParticipantGroupResponse

type ViewParticipantGroupResponse struct {
	Results []model.ParticipantGroupMembership `json:"results"`
}

ViewParticipantGroupResponse is the list of members in a group.

type WorkspaceBalanceResponse added in v1.0.0

type WorkspaceBalanceResponse struct {
	CurrencyCode     string `json:"currency_code"`
	TotalBalance     int    `json:"total_balance"`
	BalanceBreakdown struct {
		Rewards int `json:"rewards"`
		Fees    int `json:"fees"`
		VAT     int `json:"vat"`
	} `json:"balance_breakdown"`
	AvailableBalance          int `json:"available_balance"`
	AvailableBalanceBreakdown struct {
		Rewards int `json:"rewards"`
		Fees    int `json:"fees"`
		VAT     int `json:"vat"`
	} `json:"available_balance_breakdown"`
}

WorkspaceBalanceResponse is the response for the workspace balance endpoint.

Jump to

Keyboard shortcuts

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