Documentation
¶
Index ¶
- type Account
- type AccountAISettings
- type AccountAISettingsResponse
- type AccountCreateRequestBody
- type AccountExecutionCountIncreaseResponse
- type AccountExecutionCountResponse
- type AccountFeature
- type AccountJobExecutionsCount
- type AccountResponse
- type AccountTokensAddRequest
- type AccountTokensAddResponse
- type AccountTokensResponse
- type AsyncTask
- type AsyncTaskResponse
- type BackupRestoreResponse
- type BatchJobResponse
- type CleanupOldLogsRequestBody
- type CleanupOldLogsResponse
- type Client
- func NewAPIClient(baseURL, version, apiKey, apiSecret string) (*Client, error)
- func NewAPIClientWithAccount(baseURL, version, apiKey, apiSecret, accountID string) (*Client, error)
- func NewBasicAuthClient(baseURL, version, username, password string) (*Client, error)
- func NewClient(baseURL, version string, options ...ClientOption) (*Client, error)
- func (c *Client) AddAccountTokens(accountID string, amount int64) (*AccountTokensAddResponse, error)
- func (c *Client) AddAllFeaturesToAccount(accountID string) error
- func (c *Client) AddFeatureToAccount(accountID string, body *FeatureRequest) (*FeatureRequestResponse, error)
- func (c *Client) ArchiveCredential(id string, archivedBy string, accountIDOverride ...string) error
- func (c *Client) BackupDatabase() (*BackupRestoreResponse, error)
- func (c *Client) BatchCreateJobs(jobs []JobRequestBody, accountIDOverride ...string) (*BatchJobResponse, error)
- func (c *Client) CleanupOldExecutionLogs(accountID string, retentionMonths int, accountIDOverride ...string) (*CleanupOldLogsResponse, error)
- func (c *Client) CreateAccount(body *AccountCreateRequestBody) (*AccountResponse, error)
- func (c *Client) CreateCredential(body *CredentialCreateRequestBody) (*CredentialResponse, error)
- func (c *Client) CreateExecutor(body *ExecutorRequestBody) (*ExecutorResponse, error)
- func (c *Client) CreateJob(body *JobRequestBody, accountIDOverride ...string) (*BatchJobResponse, error)
- func (c *Client) CreateJobFromPrompt(body *PromptJobRequest, accountIDOverride ...string) ([]PromptJobResponse, error)
- func (c *Client) CreateProject(body *ProjectRequestBody) (*ProjectResponse, error)
- func (c *Client) DeleteCredential(id string, body *CredentialDeleteRequestBody) error
- func (c *Client) DeleteExecutor(id string, body *ExecutorDeleteRequestBody) error
- func (c *Client) DeleteJob(id string, body *JobDeleteRequestBody, accountIDOverride ...string) error
- func (c *Client) DeleteProject(id int64, body *ProjectDeleteRequestBody) error
- func (c *Client) GetAccount(id string) (*AccountResponse, error)
- func (c *Client) GetAccountAISettings(accountID string) (*AccountAISettingsResponse, error)
- func (c *Client) GetAccountExecutionCount(accountID string) (*AccountExecutionCountResponse, error)
- func (c *Client) GetAccountTokens(accountID string) (*AccountTokensResponse, error)
- func (c *Client) GetAsyncTask(requestID string) (*AsyncTaskResponse, error)
- func (c *Client) GetCredential(id string) (*CredentialResponse, error)
- func (c *Client) GetDateRangeAnalytics(params GetDateRangeAnalyticsParams) (*DateRangeAnalyticsAPIResponse, error)
- func (c *Client) GetExecutionTotals(accountID int64) (*ExecutionTotalsAPIResponse, error)
- func (c *Client) GetExecutor(id string) (*ExecutorResponse, error)
- func (c *Client) GetJob(id string, accountIDOverride ...string) (*JobResponse, error)
- func (c *Client) GetProject(id int64) (*ProjectResponse, error)
- func (c *Client) Healthcheck() (*HealthcheckResponse, error)
- func (c *Client) IncreaseAccountExecutionCount(accountID string, count uint64) (*AccountExecutionCountIncreaseResponse, error)
- func (c *Client) ListCredentials(params ListCredentialsParams) (*PaginatedCredentialsResponse, error)
- func (c *Client) ListExecutions(params ListExecutionsParams) (*PaginatedExecutionsResponse, error)
- func (c *Client) ListExecutors(params ListExecutorsParams) (*PaginatedExecutorsResponse, error)
- func (c *Client) ListFeatures() (*FeaturesResponse, error)
- func (c *Client) ListJobs(params ListJobsParams) (*PaginatedJobsResponse, error)
- func (c *Client) ListProjects(params ListProjectsParams) (*PaginatedProjectsResponse, error)
- func (c *Client) PullLocalExecutorJobs(executorID int64) (*LocalExecutorJobsResponse, error)
- func (c *Client) RegisterLocalExecutor(body *LocalExecutorRegisterRequest) (*LocalExecutorRegisterResponse, error)
- func (c *Client) RemoveAllFeaturesFromAccount(accountID string) error
- func (c *Client) RemoveFeatureFromAccount(accountID string, body *FeatureRequest) error
- func (c *Client) ReportLocalExecutions(executorID int64, reports []LocalExecutionReport) (*ReportLocalExecutionsResponse, error)
- func (c *Client) RestoreDatabase(fileName string) (*BackupRestoreResponse, error)
- func (c *Client) RotateCredentialSecret() (*RotateSecretResponse, error)
- func (c *Client) UpdateCredential(id string, body *CredentialUpdateRequestBody) (*CredentialResponse, error)
- func (c *Client) UpdateExecutor(id string, body *ExecutorUpdateRequestBody) (*ExecutorResponse, error)
- func (c *Client) UpdateJob(id string, body *JobUpdateRequestBody, accountIDOverride ...string) (*JobResponse, error)
- func (c *Client) UpdateProject(id int64, body *ProjectUpdateRequestBody) (*ProjectResponse, error)
- func (c *Client) UpsertAccountAISettings(accountID string, settings *AccountAISettings) (*AccountAISettingsResponse, error)
- type ClientOption
- type Credential
- type CredentialArchiveRequestBody
- type CredentialCreateRequestBody
- type CredentialDeleteRequestBody
- type CredentialResponse
- type CredentialUpdateRequestBody
- type DateRangeAnalyticsAPIResponse
- type DateRangeAnalyticsPoint
- type DateRangeAnalyticsResponse
- type Execution
- type ExecutionResponse
- type ExecutionTotalsAPIResponse
- type ExecutionTotalsResponse
- type Executor
- type ExecutorDeleteRequestBody
- type ExecutorRequestBody
- type ExecutorResponse
- type ExecutorUpdateRequestBody
- type Feature
- type FeatureRequest
- type FeatureRequestResponse
- type FeaturesResponse
- type GetDateRangeAnalyticsParams
- type HealthcheckData
- type HealthcheckResponse
- type Job
- type JobDeleteRequestBody
- type JobRequestBody
- type JobResponse
- type JobUpdateRequestBody
- type ListCredentialsParams
- type ListExecutionsParams
- type ListExecutorsParams
- type ListJobsParams
- type ListProjectsParams
- type LocalExecutionReport
- type LocalExecutorJobsResponse
- type LocalExecutorRegisterRequest
- type LocalExecutorRegisterResponse
- type PaginatedCredentialsResponse
- type PaginatedExecutionsResponse
- type PaginatedExecutorsResponse
- type PaginatedJobsResponse
- type PaginatedProjectsResponse
- type Project
- type ProjectDeleteRequestBody
- type ProjectRequestBody
- type ProjectResponse
- type ProjectUpdateRequestBody
- type PromptJobRequest
- type PromptJobResponse
- type PromptProviderResult
- type RaftStats
- type ReportLocalExecutionsResponse
- type RestoreRequest
- type RotateSecretResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct {
ID int64 `json:"id"`
Name string `json:"name"`
Features []AccountFeature `json:"features"`
DateCreated string `json:"dateCreated"`
DateModified *string `json:"dateModified"`
}
Account represents an account
type AccountAISettings ¶ added in v1.5.0
type AccountAISettings struct {
AccountID uint64 `json:"account_id,omitempty"`
Provider string `json:"provider,omitempty"`
Model string `json:"model,omitempty"`
OpenAIAPIKey string `json:"openai_api_key,omitempty"`
AnthropicAPIKey string `json:"anthropic_api_key,omitempty"`
BedrockAccessKeyID string `json:"bedrock_access_key_id,omitempty"`
BedrockSecretKey string `json:"bedrock_secret_key,omitempty"`
BedrockRegion string `json:"bedrock_region,omitempty"`
}
AccountAISettings holds per-account AI provider credentials.
type AccountAISettingsResponse ¶ added in v1.5.0
type AccountAISettingsResponse struct {
Success bool `json:"success"`
Data AccountAISettings `json:"data"`
}
AccountAISettingsResponse wraps the standard API envelope for a single settings object.
type AccountCreateRequestBody ¶
type AccountCreateRequestBody struct {
Name string `json:"name"`
}
AccountCreateRequestBody represents the request body for creating an account
type AccountExecutionCountIncreaseResponse ¶ added in v1.3.2
type AccountExecutionCountIncreaseResponse struct {
Success bool `json:"success"`
Data struct {
NewExecutionCount uint64 `json:"newExecutionCount"`
} `json:"data"`
}
AccountExecutionCountIncreaseResponse represents the response for increasing account execution count
type AccountExecutionCountResponse ¶ added in v1.3.1
type AccountExecutionCountResponse struct {
Success bool `json:"success"`
Data AccountJobExecutionsCount `json:"data"`
}
AccountExecutionCountResponse represents the response for account execution count
type AccountFeature ¶
type AccountFeature struct {
AccountID int64 `json:"accountId"`
FeatureID int64 `json:"featureId"`
Feature string `json:"feature"`
}
AccountFeature represents a feature associated with an account
type AccountJobExecutionsCount ¶ added in v1.3.1
type AccountJobExecutionsCount struct {
ID int64 `json:"id"`
AccountID int64 `json:"accountId"`
ExecutionCount int64 `json:"executionCount"`
Tokens int64 `json:"tokens"`
DateCreated string `json:"dateCreated"`
DateModified string `json:"dateModified"`
NextResetDate string `json:"nextResetDate"`
}
AccountJobExecutionsCount represents the execution count for an account
type AccountResponse ¶
AccountResponse represents the response for a single account
type AccountTokensAddRequest ¶ added in v1.5.0
type AccountTokensAddRequest struct {
Amount int64 `json:"amount"`
}
AccountTokensAddRequest represents the request body for adding tokens
type AccountTokensAddResponse ¶ added in v1.5.0
type AccountTokensAddResponse struct {
Success bool `json:"success"`
Data struct {
NewBalance int64 `json:"newBalance"`
} `json:"data"`
}
AccountTokensAddResponse represents the response for adding tokens to an account
type AccountTokensResponse ¶ added in v1.5.0
type AccountTokensResponse struct {
Success bool `json:"success"`
Data struct {
Tokens int64 `json:"tokens"`
} `json:"data"`
}
AccountTokensResponse represents the response for getting account token balance
type AsyncTask ¶
type AsyncTask struct {
ID int64 `json:"id"`
RequestID string `json:"requestId"`
Input string `json:"input"`
Output string `json:"output"`
Service string `json:"service"`
State int `json:"state"`
DateCreated string `json:"dateCreated"`
}
AsyncTask represents an async task
type AsyncTaskResponse ¶
AsyncTaskResponse represents the response for a single async task
type BackupRestoreResponse ¶ added in v1.4.0
type BackupRestoreResponse struct {
Data map[string]string `json:"data"`
Success bool `json:"success"`
}
BackupRestoreResponse is the response from backup/restore initiation
type BatchJobResponse ¶ added in v1.2.0
BatchJobResponse represents the response for batch job creation
type CleanupOldLogsRequestBody ¶ added in v1.3.1
type CleanupOldLogsResponse ¶ added in v1.3.1
type Client ¶
type Client struct {
BaseURL *url.URL
HTTPClient *http.Client
APIKey string
APISecret string
Version string
// Basic Auth for peer communication
Username string
Password string
// Account ID for most endpoints
AccountID string
}
func NewAPIClient ¶
NewAPIClient creates a client with API key authentication
func NewAPIClientWithAccount ¶
func NewAPIClientWithAccount(baseURL, version, apiKey, apiSecret, accountID string) (*Client, error)
NewAPIClientWithAccount creates a client with API key authentication and account ID
func NewBasicAuthClient ¶
NewBasicAuthClient creates a client with basic authentication for peer communication
func (*Client) AddAccountTokens ¶ added in v1.5.0
func (c *Client) AddAccountTokens(accountID string, amount int64) (*AccountTokensAddResponse, error)
AddAccountTokens adds the given number of tokens to an account's balance.
func (*Client) AddAllFeaturesToAccount ¶ added in v1.2.0
AddAllFeaturesToAccount adds all features to an account
func (*Client) AddFeatureToAccount ¶
func (c *Client) AddFeatureToAccount(accountID string, body *FeatureRequest) (*FeatureRequestResponse, error)
AddFeatureToAccount adds a feature to an account
func (*Client) ArchiveCredential ¶ added in v1.2.0
ArchiveCredential archives a credential by ID accountIDOverride is optional - if provided, overrides the client's default account ID
func (*Client) BackupDatabase ¶ added in v1.4.0
func (c *Client) BackupDatabase() (*BackupRestoreResponse, error)
BackupDatabase initiates an automatic timestamped backup
func (*Client) BatchCreateJobs ¶ added in v1.2.0
func (c *Client) BatchCreateJobs(jobs []JobRequestBody, accountIDOverride ...string) (*BatchJobResponse, error)
BatchCreateJobs creates multiple jobs in a single request accountIDOverride is optional - if provided, overrides the client's default account ID
func (*Client) CleanupOldExecutionLogs ¶ added in v1.3.1
func (c *Client) CleanupOldExecutionLogs(accountID string, retentionMonths int, accountIDOverride ...string) (*CleanupOldLogsResponse, error)
CleanupOldExecutionLogs cleans up old execution logs for an account based on retention period accountIDOverride is optional - if provided, overrides the client's default account ID
func (*Client) CreateAccount ¶
func (c *Client) CreateAccount(body *AccountCreateRequestBody) (*AccountResponse, error)
CreateAccount creates a new account
func (*Client) CreateCredential ¶
func (c *Client) CreateCredential(body *CredentialCreateRequestBody) (*CredentialResponse, error)
CreateCredential creates a new credential
func (*Client) CreateExecutor ¶
func (c *Client) CreateExecutor(body *ExecutorRequestBody) (*ExecutorResponse, error)
CreateExecutor creates a new executor
func (*Client) CreateJob ¶
func (c *Client) CreateJob(body *JobRequestBody, accountIDOverride ...string) (*BatchJobResponse, error)
CreateJob creates a new job Note: This is a convenience method that wraps a single job in an array. The API always expects an array and returns 202 Accepted with a request ID for async tracking. For better control, use BatchCreateJobs directly. accountIDOverride is optional - if provided, overrides the client's default account ID
func (*Client) CreateJobFromPrompt ¶ added in v1.2.0
func (c *Client) CreateJobFromPrompt(body *PromptJobRequest, accountIDOverride ...string) ([]PromptJobResponse, error)
CreateJobFromPrompt creates job configurations from an AI prompt. It returns the flattened list of jobs across all providers. An optional accountIDOverride can be supplied to set the X-Account-ID header.
func (*Client) CreateProject ¶
func (c *Client) CreateProject(body *ProjectRequestBody) (*ProjectResponse, error)
CreateProject creates a new project
func (*Client) DeleteCredential ¶
func (c *Client) DeleteCredential(id string, body *CredentialDeleteRequestBody) error
DeleteCredential deletes a credential by ID
func (*Client) DeleteExecutor ¶
func (c *Client) DeleteExecutor(id string, body *ExecutorDeleteRequestBody) error
DeleteExecutor deletes an executor by ID
func (*Client) DeleteJob ¶
func (c *Client) DeleteJob(id string, body *JobDeleteRequestBody, accountIDOverride ...string) error
DeleteJob deletes a job by ID accountIDOverride is optional - if provided, overrides the client's default account ID
func (*Client) DeleteProject ¶
func (c *Client) DeleteProject(id int64, body *ProjectDeleteRequestBody) error
DeleteProject deletes a project by ID
func (*Client) GetAccount ¶
func (c *Client) GetAccount(id string) (*AccountResponse, error)
GetAccount retrieves a single account by ID
func (*Client) GetAccountAISettings ¶ added in v1.5.0
func (c *Client) GetAccountAISettings(accountID string) (*AccountAISettingsResponse, error)
GetAccountAISettings retrieves the AI provider settings for a given account. accountID is passed as an override so the proxy can route to the right account.
func (*Client) GetAccountExecutionCount ¶ added in v1.3.1
func (c *Client) GetAccountExecutionCount(accountID string) (*AccountExecutionCountResponse, error)
GetAccountExecutionCount retrieves the execution count for an account accountID is used both in the URL path and as the X-Account-ID header for authentication
func (*Client) GetAccountTokens ¶ added in v1.5.0
func (c *Client) GetAccountTokens(accountID string) (*AccountTokensResponse, error)
GetAccountTokens retrieves the current token balance for an account.
func (*Client) GetAsyncTask ¶
func (c *Client) GetAsyncTask(requestID string) (*AsyncTaskResponse, error)
GetAsyncTask retrieves an async task by request ID
func (*Client) GetCredential ¶
func (c *Client) GetCredential(id string) (*CredentialResponse, error)
GetCredential retrieves a single credential by ID
func (*Client) GetDateRangeAnalytics ¶ added in v1.3.1
func (c *Client) GetDateRangeAnalytics(params GetDateRangeAnalyticsParams) (*DateRangeAnalyticsAPIResponse, error)
GetDateRangeAnalytics retrieves execution counts grouped by minute buckets for a date range All dates and times should be in UTC (timezone conversion should be done on frontend)
func (*Client) GetExecutionTotals ¶ added in v1.3.1
func (c *Client) GetExecutionTotals(accountID int64) (*ExecutionTotalsAPIResponse, error)
GetExecutionTotals retrieves total counts of scheduled, success, and failed executions for an account
func (*Client) GetExecutor ¶
func (c *Client) GetExecutor(id string) (*ExecutorResponse, error)
GetExecutor retrieves a single executor by ID
func (*Client) GetJob ¶
func (c *Client) GetJob(id string, accountIDOverride ...string) (*JobResponse, error)
GetJob retrieves a single job by ID accountIDOverride is optional - if provided, overrides the client's default account ID
func (*Client) GetProject ¶
func (c *Client) GetProject(id int64) (*ProjectResponse, error)
GetProject retrieves a single project by ID
func (*Client) Healthcheck ¶
func (c *Client) Healthcheck() (*HealthcheckResponse, error)
Healthcheck retrieves the current leader and raft stats (no authentication required)
func (*Client) IncreaseAccountExecutionCount ¶ added in v1.3.2
func (c *Client) IncreaseAccountExecutionCount(accountID string, count uint64) (*AccountExecutionCountIncreaseResponse, error)
IncreaseAccountExecutionCount increases the execution count for an account accountID is used both in the URL path and as the X-Account-ID header for authentication
func (*Client) ListCredentials ¶
func (c *Client) ListCredentials(params ListCredentialsParams) (*PaginatedCredentialsResponse, error)
ListCredentials retrieves all credentials with optional query parameters
func (*Client) ListExecutions ¶
func (c *Client) ListExecutions(params ListExecutionsParams) (*PaginatedExecutionsResponse, error)
ListExecutions retrieves job executions with query parameters
func (*Client) ListExecutors ¶
func (c *Client) ListExecutors(params ListExecutorsParams) (*PaginatedExecutorsResponse, error)
ListExecutors retrieves all executors with optional query parameters
func (*Client) ListFeatures ¶
func (c *Client) ListFeatures() (*FeaturesResponse, error)
ListFeatures retrieves all available features
func (*Client) ListJobs ¶
func (c *Client) ListJobs(params ListJobsParams) (*PaginatedJobsResponse, error)
ListJobs retrieves all jobs with optional query parameters
func (*Client) ListProjects ¶
func (c *Client) ListProjects(params ListProjectsParams) (*PaginatedProjectsResponse, error)
ListProjects retrieves all projects with optional query parameters
func (*Client) PullLocalExecutorJobs ¶ added in v1.6.0
func (c *Client) PullLocalExecutorJobs(executorID int64) (*LocalExecutorJobsResponse, error)
PullLocalExecutorJobs returns all active jobs assigned to the given local executor.
GET /api/v1/local-executors/{id}/jobs
func (*Client) RegisterLocalExecutor ¶ added in v1.6.0
func (c *Client) RegisterLocalExecutor(body *LocalExecutorRegisterRequest) (*LocalExecutorRegisterResponse, error)
RegisterLocalExecutor creates a new local-type executor on the server and returns its ID.
POST /api/v1/local-executors
func (*Client) RemoveAllFeaturesFromAccount ¶ added in v1.2.0
RemoveAllFeaturesFromAccount removes all features from an account
func (*Client) RemoveFeatureFromAccount ¶
func (c *Client) RemoveFeatureFromAccount(accountID string, body *FeatureRequest) error
RemoveFeatureFromAccount removes a feature from an account
func (*Client) ReportLocalExecutions ¶ added in v1.6.0
func (c *Client) ReportLocalExecutions(executorID int64, reports []LocalExecutionReport) (*ReportLocalExecutionsResponse, error)
ReportLocalExecutions sends a batch of execution events to the server to be committed.
POST /api/v1/local-executors/{id}/executions
func (*Client) RestoreDatabase ¶ added in v1.4.0
func (c *Client) RestoreDatabase(fileName string) (*BackupRestoreResponse, error)
RestoreDatabase initiates a restore from a backup file. fileName is the backup file name (S3 object key when S3 is configured, or local file path otherwise).
func (*Client) RotateCredentialSecret ¶ added in v1.6.0
func (c *Client) RotateCredentialSecret() (*RotateSecretResponse, error)
RotateCredentialSecret triggers a server-side re-encryption of all active, non-expired credentials from the old SecretKey to the new one.
This endpoint is self-hosting only and requires a BasicAuth client (NewBasicAuthClient). The operator must update SecretKey in the secrets source before calling this method. The operation is resumable — if it is interrupted, re-calling RotateCredentialSecret will pick up from where it left off.
func (*Client) UpdateCredential ¶
func (c *Client) UpdateCredential(id string, body *CredentialUpdateRequestBody) (*CredentialResponse, error)
UpdateCredential updates an existing credential
func (*Client) UpdateExecutor ¶
func (c *Client) UpdateExecutor(id string, body *ExecutorUpdateRequestBody) (*ExecutorResponse, error)
UpdateExecutor updates an existing executor
func (*Client) UpdateJob ¶
func (c *Client) UpdateJob(id string, body *JobUpdateRequestBody, accountIDOverride ...string) (*JobResponse, error)
UpdateJob updates an existing job accountIDOverride is optional - if provided, overrides the client's default account ID
func (*Client) UpdateProject ¶
func (c *Client) UpdateProject(id int64, body *ProjectUpdateRequestBody) (*ProjectResponse, error)
UpdateProject updates an existing project
func (*Client) UpsertAccountAISettings ¶ added in v1.5.0
func (c *Client) UpsertAccountAISettings(accountID string, settings *AccountAISettings) (*AccountAISettingsResponse, error)
UpsertAccountAISettings creates or updates the AI provider settings for a given account.
type ClientOption ¶
type ClientOption func(*Client)
ClientOption is a function that configures a Client
func WithAPIKey ¶
func WithAPIKey(apiKey, apiSecret string) ClientOption
WithAPIKey sets the API key and secret for authentication
func WithAccountID ¶
func WithAccountID(accountID string) ClientOption
WithAccountID sets the account ID for requests
func WithBasicAuth ¶
func WithBasicAuth(username, password string) ClientOption
WithBasicAuth sets the username and password for basic authentication
type Credential ¶
type Credential struct {
ID int64 `json:"id"`
AccountID int64 `json:"accountId"`
Archived bool `json:"archived"`
APIKey string `json:"apiKey"`
PlaintextSecret string `json:"plaintextSecret,omitempty"` // Returned once on creation only
DateCreated string `json:"dateCreated"`
DateModified *string `json:"dateModified"`
DateDeleted *string `json:"dateDeleted"`
CreatedBy string `json:"createdBy"`
ModifiedBy *string `json:"modifiedBy"`
DeletedBy *string `json:"deletedBy"`
ArchivedBy *string `json:"archivedBy"`
ExpiresAt *string `json:"expiresAt,omitempty"`
Scopes []string `json:"scopes,omitempty"`
}
Credential represents a credential returned by the Scheduler0 API.
API key / secret model:
- APIKey is a stable plaintext identifier stored as-is in the DB. It is always present in API responses.
- APISecret (the AES-GCM encrypted form) is never included in API responses. Clients must send the original plaintext secret they received at creation.
- PlaintextSecret is returned exactly once, in the 201 create response. It is never stored server-side and cannot be retrieved afterwards.
type CredentialArchiveRequestBody ¶ added in v1.2.0
type CredentialArchiveRequestBody struct {
AccountID int64 `json:"-"`
ArchivedBy string `json:"archivedBy"`
}
CredentialArchiveRequestBody represents the request body for archiving a credential
type CredentialCreateRequestBody ¶ added in v1.2.0
type CredentialCreateRequestBody struct {
AccountID int64 `json:"-"`
Archived bool `json:"archived,omitempty"`
CreatedBy string `json:"createdBy"`
Scopes []string `json:"scopes"`
}
CredentialCreateRequestBody represents the request body for creating a credential. Scopes must be a subset of {"read","write","execute"} and is required by the API.
type CredentialDeleteRequestBody ¶ added in v1.2.0
type CredentialDeleteRequestBody struct {
AccountID int64 `json:"-"`
DeletedBy string `json:"deletedBy"`
}
CredentialDeleteRequestBody represents the request body for deleting a credential
type CredentialResponse ¶
type CredentialResponse struct {
Success bool `json:"success"`
Data Credential `json:"data"`
}
CredentialResponse represents the response for a single credential
type CredentialUpdateRequestBody ¶ added in v1.2.0
type CredentialUpdateRequestBody struct {
AccountID int64 `json:"-"`
Archived bool `json:"archived,omitempty"`
ModifiedBy string `json:"modifiedBy"`
}
CredentialUpdateRequestBody represents the request body for updating a credential
type DateRangeAnalyticsAPIResponse ¶ added in v1.3.1
type DateRangeAnalyticsAPIResponse struct {
Success bool `json:"success"`
Data DateRangeAnalyticsResponse `json:"data"`
}
type DateRangeAnalyticsPoint ¶ added in v1.3.1
type DateRangeAnalyticsResponse ¶ added in v1.3.1
type Execution ¶
type Execution struct {
ID int64 `json:"id"`
AccountID int64 `json:"accountId"`
UniqueID string `json:"uniqueId"`
State int64 `json:"state"`
NodeID int64 `json:"nodeId"`
JobID int64 `json:"jobId"`
LastExecutionDatetime string `json:"lastExecutionDatetime"`
NextExecutionDatetime string `json:"nextExecutionDatetime"`
JobQueueVersion int64 `json:"jobQueueVersion"`
ExecutionVersion int64 `json:"executionVersion"`
DateCreated string `json:"dateCreated"`
DateModified *string `json:"dateModified"`
}
type ExecutionResponse ¶
type ExecutionTotalsAPIResponse ¶ added in v1.3.1
type ExecutionTotalsAPIResponse struct {
Success bool `json:"success"`
Data ExecutionTotalsResponse `json:"data"`
}
type ExecutionTotalsResponse ¶ added in v1.3.1
type Executor ¶
type Executor struct {
ID int64 `json:"id"`
AccountID int64 `json:"accountId"`
Name string `json:"name"`
Type string `json:"type"`
Region string `json:"region"`
CloudProvider string `json:"cloudProvider"`
CloudResourceURL string `json:"cloudResourceUrl"`
CloudAPIKey string `json:"cloudApiKey"`
CloudAPISecret string `json:"cloudApiSecret"`
WebhookURL string `json:"webhookUrl"`
WebhookSecret string `json:"webhookSecret"`
WebhookMethod string `json:"webhookMethod"`
Command string `json:"command,omitempty"`
WorkingDir string `json:"workingDir,omitempty"`
DateCreated string `json:"dateCreated"`
DateModified *string `json:"dateModified"`
DateDeleted *string `json:"dateDeleted"`
CreatedBy string `json:"createdBy"`
ModifiedBy *string `json:"modifiedBy"`
DeletedBy *string `json:"deletedBy"`
}
Executor represents a job executor
type ExecutorDeleteRequestBody ¶ added in v1.2.0
type ExecutorDeleteRequestBody struct {
AccountID int64 `json:"-"`
DeletedBy string `json:"deletedBy"`
}
ExecutorDeleteRequestBody represents the request body for deleting an executor
type ExecutorRequestBody ¶
type ExecutorRequestBody struct {
AccountID int64 `json:"-"`
Name string `json:"name"`
Type string `json:"type"`
Region string `json:"region"`
CloudProvider string `json:"cloudProvider"`
CloudResourceURL string `json:"cloudResourceUrl"`
CloudAPIKey string `json:"cloudApiKey,omitempty"`
CloudAPISecret string `json:"cloudApiSecret,omitempty"`
WebhookURL string `json:"webhookUrl,omitempty"`
WebhookSecret string `json:"webhookSecret,omitempty"`
WebhookMethod string `json:"webhookMethod,omitempty"`
Command string `json:"command,omitempty"`
WorkingDir string `json:"workingDir,omitempty"`
CreatedBy string `json:"createdBy"`
}
ExecutorRequestBody represents the request body for creating an executor
type ExecutorResponse ¶
ExecutorResponse represents the response for a single executor
type ExecutorUpdateRequestBody ¶ added in v1.2.0
type ExecutorUpdateRequestBody struct {
AccountID int64 `json:"-"`
Name string `json:"name"`
Type string `json:"type"`
Region string `json:"region"`
CloudProvider string `json:"cloudProvider"`
CloudResourceURL string `json:"cloudResourceUrl"`
CloudAPIKey string `json:"cloudApiKey,omitempty"`
CloudAPISecret string `json:"cloudApiSecret,omitempty"`
WebhookURL string `json:"webhookUrl,omitempty"`
WebhookSecret string `json:"webhookSecret,omitempty"`
WebhookMethod string `json:"webhookMethod,omitempty"`
Command string `json:"command,omitempty"`
WorkingDir string `json:"workingDir,omitempty"`
ModifiedBy string `json:"modifiedBy"`
}
ExecutorUpdateRequestBody represents the request body for updating an executor
type Feature ¶
type Feature struct {
ID int64 `json:"id"`
Name string `json:"name"`
DateCreated string `json:"dateCreated"`
DateModified *string `json:"dateModified"`
}
Feature represents a feature
type FeatureRequest ¶
FeatureRequest represents a request to add/remove a feature
type FeatureRequestResponse ¶
type FeatureRequestResponse struct {
Success bool `json:"success"`
Data FeatureRequest `json:"data"`
}
FeatureRequestResponse represents the response for feature operations
type FeaturesResponse ¶
FeaturesResponse represents the response for listing features
type GetDateRangeAnalyticsParams ¶ added in v1.3.1
type HealthcheckData ¶
type HealthcheckData struct {
LeaderAddress string `json:"leaderAddress"`
LeaderID string `json:"leaderId"`
RaftStats RaftStats `json:"raftStats"`
}
HealthcheckData represents the healthcheck response data
type HealthcheckResponse ¶
type HealthcheckResponse struct {
Success bool `json:"success"`
Data HealthcheckData `json:"data"`
}
HealthcheckResponse represents the healthcheck response
type Job ¶
type Job struct {
ID int64 `json:"id,omitempty"`
AccountID int64 `json:"accountId,omitempty"`
ProjectID int64 `json:"projectId,omitempty"`
ExecutorID *int64 `json:"executorId,omitempty"`
Data string `json:"data,omitempty"`
Spec string `json:"spec,omitempty"`
StartDate string `json:"startDate,omitempty"`
EndDate string `json:"endDate,omitempty"`
LastExecutionDate string `json:"lastExecutionDate,omitempty"`
Timezone string `json:"timezone,omitempty"`
TimezoneOffset int64 `json:"timezoneOffset,omitempty"`
RetryMax int `json:"retryMax,omitempty"`
ExecutionID string `json:"executionId,omitempty"`
Status string `json:"status,omitempty"`
DateCreated string `json:"dateCreated,omitempty"`
DateModified *string `json:"dateModified,omitempty"`
CreatedBy string `json:"createdBy,omitempty"`
ModifiedBy *string `json:"modifiedBy,omitempty"`
DeletedBy *string `json:"deletedBy,omitempty"`
}
Job represents a scheduled job
type JobDeleteRequestBody ¶ added in v1.2.0
JobDeleteRequestBody represents the request body for deleting a job
type JobRequestBody ¶
type JobRequestBody struct {
AccountID int64 `json:"-"`
ProjectID int64 `json:"projectId"`
Timezone string `json:"timezone"`
ExecutorID *int64 `json:"executorId,omitempty"`
Data string `json:"data,omitempty"`
Spec string `json:"spec,omitempty"`
StartDate string `json:"startDate,omitempty"`
EndDate string `json:"endDate,omitempty"`
TimezoneOffset int64 `json:"timezoneOffset,omitempty"`
RetryMax int `json:"retryMax,omitempty"`
Status string `json:"status,omitempty"`
CreatedBy string `json:"createdBy"`
}
JobRequestBody represents the request body for creating a job
type JobResponse ¶
JobResponse represents the response for a single job
type JobUpdateRequestBody ¶
type JobUpdateRequestBody struct {
AccountID int64 `json:"-"`
ProjectID int64 `json:"projectId,omitempty"`
ExecutorID *int64 `json:"executorId,omitempty"`
Data string `json:"data,omitempty"`
Spec string `json:"spec,omitempty"`
StartDate string `json:"startDate,omitempty"`
EndDate string `json:"endDate,omitempty"`
Timezone string `json:"timezone,omitempty"`
TimezoneOffset int64 `json:"timezoneOffset,omitempty"`
RetryMax int `json:"retryMax,omitempty"`
Status string `json:"status,omitempty"`
ModifiedBy string `json:"modifiedBy"`
}
JobUpdateRequestBody represents the request body for updating a job
type ListCredentialsParams ¶ added in v1.2.2
type ListCredentialsParams struct {
AccountID int64 // Optional: Account ID override (0 uses client default)
Limit int // Maximum number of items to return
Offset int // Number of items to skip
OrderBy string // Field to order by (e.g., "date_created", "date_modified")
OrderByDirection string // Direction to order ("asc" or "desc")
}
ListCredentialsParams represents parameters for listing credentials
type ListExecutionsParams ¶ added in v1.2.2
type ListExecutorsParams ¶ added in v1.2.2
type ListExecutorsParams struct {
AccountID int64 // Account ID override (0 to use client default)
Limit int // Maximum number of items to return
Offset int // Number of items to skip
OrderBy string // Field to order by (e.g., "date_created", "date_modified")
OrderByDirection string // Direction to order ("asc" or "desc")
}
ListExecutorsParams represents parameters for listing executors
type ListJobsParams ¶ added in v1.2.2
type ListJobsParams struct {
ProjectID string // Project ID to filter by (empty string for all projects)
AccountID int64 // Account ID override (0 to use client default)
Limit int // Maximum number of items to return
Offset int // Number of items to skip
OrderBy string // Field to order by (e.g., "date_created", "date_modified")
OrderByDirection string // Direction to order ("asc" or "desc")
}
ListJobsParams represents parameters for listing jobs
type ListProjectsParams ¶ added in v1.2.2
type ListProjectsParams struct {
AccountID int64 // Account ID override (0 to use client default)
Limit int // Maximum number of items to return
Offset int // Number of items to skip
OrderBy string // Field to order by (e.g., "date_created", "date_modified")
OrderByDirection string // Direction to order ("asc" or "desc")
}
ListProjectsParams represents parameters for listing projects
type LocalExecutionReport ¶ added in v1.6.0
type LocalExecutionReport struct {
JobID int64 `json:"jobId"`
UniqueID string `json:"uniqueId"`
State int `json:"state"` // 0=scheduled, 1=success, 2=failed
LastExecutionTime string `json:"lastExecutionTime"` // RFC3339
NextExecutionTime string `json:"nextExecutionTime"` // RFC3339
ExecutionVersion uint64 `json:"executionVersion"`
JobQueueVersion uint64 `json:"jobQueueVersion"`
}
LocalExecutionReport is a single execution event sent to the server.
type LocalExecutorJobsResponse ¶ added in v1.6.0
LocalExecutorJobsResponse is the server response for pulling assigned jobs.
type LocalExecutorRegisterRequest ¶ added in v1.6.0
type LocalExecutorRegisterRequest struct {
Name string `json:"name"`
Command string `json:"command"`
WorkingDir string `json:"workingDir,omitempty"`
CreatedBy string `json:"createdBy,omitempty"`
}
LocalExecutorRegisterRequest is the body for POST /local-executors.
type LocalExecutorRegisterResponse ¶ added in v1.6.0
type LocalExecutorRegisterResponse struct {
Success bool `json:"success"`
Data struct {
ID int64 `json:"id"`
} `json:"data"`
}
LocalExecutorRegisterResponse is the server response for executor registration.
type PaginatedCredentialsResponse ¶
type PaginatedCredentialsResponse struct {
Success bool `json:"success"`
Data struct {
Total int `json:"total"`
Offset int `json:"offset"`
Limit int `json:"limit"`
Credentials []Credential `json:"credentials"`
} `json:"data"`
}
PaginatedCredentialsResponse represents a paginated list of credentials
type PaginatedExecutorsResponse ¶
type PaginatedExecutorsResponse struct {
Success bool `json:"success"`
Data struct {
Total int `json:"total"`
Offset int `json:"offset"`
Limit int `json:"limit"`
Executors []Executor `json:"executors"`
} `json:"data"`
}
PaginatedExecutorsResponse represents a paginated list of executors
type PaginatedJobsResponse ¶
type PaginatedJobsResponse struct {
Success bool `json:"success"`
Data struct {
Total int `json:"total"`
Offset int `json:"offset"`
Limit int `json:"limit"`
Jobs []Job `json:"jobs"`
} `json:"data"`
}
PaginatedJobsResponse represents a paginated list of jobs
type PaginatedProjectsResponse ¶
type PaginatedProjectsResponse struct {
Success bool `json:"success"`
Data struct {
Total int `json:"total"`
Offset int `json:"offset"`
Limit int `json:"limit"`
Projects []Project `json:"projects"`
} `json:"data"`
}
PaginatedProjectsResponse represents a paginated list of projects
type Project ¶
type Project struct {
ID int64 `json:"id"`
AccountID int64 `json:"accountId"`
Name string `json:"name"`
Description string `json:"description"`
DateCreated string `json:"dateCreated"`
DateModified *string `json:"dateModified"`
CreatedBy string `json:"createdBy"`
ModifiedBy *string `json:"modifiedBy"`
DeletedBy *string `json:"deletedBy"`
}
Project represents a project
type ProjectDeleteRequestBody ¶ added in v1.2.0
type ProjectDeleteRequestBody struct {
AccountID int64 `json:"-"`
DeletedBy string `json:"deletedBy"`
}
ProjectDeleteRequestBody represents the request body for deleting a project
type ProjectRequestBody ¶
type ProjectRequestBody struct {
AccountID int64 `json:"-"`
Name string `json:"name"`
Description string `json:"description"`
CreatedBy string `json:"createdBy"`
}
ProjectRequestBody represents the request body for creating a project
type ProjectResponse ¶
ProjectResponse represents the response for a single project
type ProjectUpdateRequestBody ¶
type ProjectUpdateRequestBody struct {
AccountID int64 `json:"-"`
Description string `json:"description"`
ModifiedBy string `json:"modifiedBy"`
}
ProjectUpdateRequestBody represents the request body for updating a project
type PromptJobRequest ¶ added in v1.2.0
type PromptJobRequest struct {
Prompt string `json:"prompt"`
Purposes []string `json:"purposes,omitempty"`
Events []string `json:"events,omitempty"`
Recipients []string `json:"recipients,omitempty"`
Channels []string `json:"channels,omitempty"`
Timezone string `json:"timezone,omitempty"`
}
PromptJobRequest represents the request body for creating jobs from AI prompt
type PromptJobResponse ¶ added in v1.2.0
type PromptJobResponse struct {
Kind string `json:"kind,omitempty"`
Purpose string `json:"purpose,omitempty"`
Subject string `json:"subject,omitempty"`
NextRunAt *string `json:"nextRunAt,omitempty"`
Recurrence string `json:"recurrence,omitempty"`
Event string `json:"event,omitempty"`
Delivery string `json:"delivery,omitempty"`
CronExpression string `json:"cronExpression,omitempty"`
Channel string `json:"channel,omitempty"`
Recipients []string `json:"recipients,omitempty"`
StartDate *string `json:"startDate,omitempty"`
EndDate *string `json:"endDate,omitempty"`
Timezone string `json:"timezone,omitempty"`
Metadata map[string]interface{} `json:"metadata,omitempty"`
}
PromptJobResponse represents a single job configuration generated from AI prompt. It maps to the objects inside each provider result's "jobs" array.
type PromptProviderResult ¶ added in v1.5.0
type PromptProviderResult struct {
Provider string `json:"provider"`
Model string `json:"model"`
Jobs []PromptJobResponse `json:"jobs"`
InputTokens int `json:"inputTokens"`
OutputTokens int `json:"outputTokens"`
TotalTokens int `json:"totalTokens"`
DurationMs int64 `json:"durationMs"`
}
PromptProviderResult wraps the per-provider metadata together with the jobs it produced. The API returns one entry per AI provider that was consulted.
type RaftStats ¶
type RaftStats struct {
AppliedIndex string `json:"applied_index"`
CommitIndex string `json:"commit_index"`
FSMPending string `json:"fsm_pending"`
LastContact string `json:"last_contact"`
LastLogIndex string `json:"last_log_index"`
LastLogTerm string `json:"last_log_term"`
LastSnapshotIndex string `json:"last_snapshot_index"`
LastSnapshotTerm string `json:"last_snapshot_term"`
LatestConfiguration string `json:"latest_configuration"`
LatestConfigIndex string `json:"latest_configuration_index"`
NumPeers string `json:"num_peers"`
ProtocolVersion string `json:"protocol_version"`
ProtocolVersionMax string `json:"protocol_version_max"`
ProtocolVersionMin string `json:"protocol_version_min"`
SnapshotVersionMax string `json:"snapshot_version_max"`
SnapshotVersionMin string `json:"snapshot_version_min"`
State string `json:"state"`
Term string `json:"term"`
}
RaftStats represents the Raft cluster statistics
type ReportLocalExecutionsResponse ¶ added in v1.6.0
type ReportLocalExecutionsResponse struct {
Success bool `json:"success"`
Data struct {
Committed int `json:"committed"`
} `json:"data"`
}
ReportLocalExecutionsResponse is the server response for reporting executions.
type RestoreRequest ¶ added in v1.4.0
type RestoreRequest struct {
FilePath string `json:"filePath"` // Backup file name (S3 object key when S3 configured, or local path)
}
RestoreRequest is the request body for restore endpoint
type RotateSecretResponse ¶ added in v1.6.0
type RotateSecretResponse struct {
Success bool `json:"success"`
Data struct {
Rotated uint64 `json:"rotated"`
} `json:"data"`
}
RotateSecretResponse is the response body returned by POST /credentials/rotate-secret. Rotated is the number of credentials that were re-encrypted with the new secret key.
Source Files
¶
- account_ai_settings.go
- account_ai_settings_types.go
- account_create.go
- account_execution_count_get.go
- account_execution_count_increase.go
- account_features.go
- account_get.go
- account_tokens.go
- account_types.go
- async_task_get.go
- async_task_types.go
- backup_start.go
- backup_types.go
- client.go
- credential_archive.go
- credential_create.go
- credential_delete.go
- credential_get.go
- credential_list.go
- credential_rotate_secret.go
- credential_types.go
- credential_update.go
- execution_list.go
- execution_types.go
- executor_create.go
- executor_delete.go
- executor_get.go
- executor_list.go
- executor_types.go
- executor_update.go
- feature_list.go
- feature_types.go
- healthcheck_get.go
- healthcheck_types.go
- job_create.go
- job_delete.go
- job_get.go
- job_list.go
- job_types.go
- job_update.go
- local_executor.go
- local_executor_types.go
- project_create.go
- project_delete.go
- project_get.go
- project_list.go
- project_types.go
- project_update.go
- prompt_create.go
- prompt_types.go
- request_builder.go
- request_executor.go
- restore_database.go