# Add pipeline from YAML

`POST /workspaces/:workspace/projects/:project_name/pipelines/yaml`

Creates a new pipeline in the project from YAML definition

**Required Scopes:** `PIPELINE_WRITE`

## URL Parameters

```typescript
interface URLParameters {
  /** The human-readable ID of the workspace */
  workspace: string; // Example: "my-company"
  /** The human-readable ID of the project */
  project_name: string; // Example: "my-project"
}
```

## Body Parameters

```typescript
interface BodyParameters {
  /** Base64 encoded string containing pipelines exported to YAML format */
  yaml?: string;
}
```

## Response Body

```typescript
interface ResponseBody {
  /** API endpoint to GET this object */
  url?: string;
  /** Web URL to view this object in Buddy.works */
  html_url?: string;
  /** The unique ID of the pipeline */
  id?: number;
  /** A human-readable ID of pipeline */
  identifier?: string;
  /** The name of the pipeline */
  name?: string;
  /** The source of the pipeline definition */
  definition_source?: "LOCAL" | "REMOTE";
  /** The git configuration reference type */
  git_config_ref?: "NONE" | "DYNAMIC" | "FIXED";
  /** Pipeline git context refs. If unset and events is empty, the pipeline counts as codeless */
  refs?: string[];
  /** The list of events that trigger the pipeline run */
  events?: PipelineEventView[];
  /** The loop configuration for the pipeline */
  loop?: string[];
  /** The priority of the pipeline */
  priority?: "LOW" | "NORMAL" | "HIGH";
  /** Indicates if the pipeline is disabled */
  disabled?: boolean;
  /** The reason why the pipeline is disabled */
  disabled_reason?: string;
  /** The status of the last run */
  last_execution_status?: "INPROGRESS" | "ENQUEUED" | "TERMINATED" | "SUCCESSFUL" | "FAILED" | "INITIAL" | "NOT_EXECUTED" | "SKIPPED" | "TERMINATING" | "WAITING_FOR_APPLY" | "WAITING_FOR_VARIABLES" | "WAITING_FOR_SETTABLE_VARIABLES" | "WAITING_FOR_VT_SESSION";
  /** The git revision of the last run */
  last_execution_revision?: string;
  /** The URL to the target site after deployment */
  target_site_url?: string;
  /** The template for commit status messages */
  execution_message_template?: string;
  /** The creation date of the pipeline */
  create_date?: string;
  /** Defines whether to upload everything from scratch on every run */
  always_from_scratch?: boolean;
  /** If set to true, the status of a given pipeline will not impact the project status on the dashboard */
  ignore_fail_on_project_status?: boolean;
  /** Which queued runs to skip when a new run starts: NEVER, ALWAYS, SAME_REF, SAME_ENVIRONMENT or SAME_ARTIFACT */
  skip_queued_runs?: "NEVER" | "ALWAYS" | "SAME_REF" | "SAME_ENVIRONMENT" | "SAME_ARTIFACT";
  /** Which in-progress runs to cancel when a new run starts: NEVER, ALWAYS, SAME_REF, SAME_ENVIRONMENT or SAME_ARTIFACT */
  cancel_inprogress_runs?: "NEVER" | "ALWAYS" | "SAME_REF" | "SAME_ENVIRONMENT" | "SAME_ARTIFACT";
  /** Defines whether to automatically clear cache before running the pipeline */
  auto_clear_cache?: boolean;
  /** Indicates if the pipeline is paused */
  paused?: boolean;
  /** Defines how many repeated failures are required to pause the pipeline */
  pause_on_repeated_failures?: number;
  /** If set to true, all refs will be fetched from the repository */
  fetch_all_refs?: boolean;
  /** If set to true, LFS files will be fetched from the external repository during pipeline runs */
  fetch_lfs?: boolean;
  /** If set to true, the pipeline will fail on environment preparation warnings */
  fail_on_prepare_env_warning?: boolean;
  /** Defines whether the pipeline can be run concurrently */
  concurrent_pipeline_runs?: boolean;
  /** Defines the depth of the git clone operation for shallow clones */
  clone_depth?: number;
  /** If set to true, commit statuses will not be created in the repository */
  do_not_create_commit_status?: boolean;
  /** Indicates that pipeline definition was probably removed on particular Git ref and pipeline won't be run on events */
  stale?: boolean;
  /** Indicates if the pipeline is waiting for the first push to the repository */
  waiting_for_push?: boolean;
  /** The resource configuration for the pipeline run */
  resources?: "DEFAULT" | "NANO" | "SMALL" | "MEDIUM" | "LARGE" | "XLARGE" | "CUSTOM" | "X2LARGE";
  /** The path to the remote pipeline definition file */
  remote_path?: string;
  /** The ref of the remote pipeline definition */
  remote_ref?: string;
  /** The project name of the remote pipeline definition */
  remote_project_name?: string;
  /** The parameters passed to the remote pipeline definition */
  remote_parameters?: PipelinePropertyView[];
  /** YAML pipeline definition configuration */
  git_config?: YamlDefinitionView;
  /** The list of tags associated with the pipeline for organization */
  tags?: string[];
  /** The base for git changeset calculation. Determines which changes trigger the pipeline */
  git_changeset_base?: "LATEST_RUN" | "LATEST_RUN_MATCHING_REF" | "PULL_REQUEST";
  /** The base for filesystem changeset calculation. Determines which file changes trigger the pipeline */
  filesystem_changeset_base?: "DATE_MODIFIED" | "CONTENTS";
  /** The CPU architecture for the pipeline run */
  cpu?: "X64" | "ARM" | "X86";
  /** If set to true, a description is required when executing the pipeline manually */
  description_required?: boolean;
  /** The folder name where the pipeline is organized */
  folder?: string;
  /** Note for this resource */
  note?: string;
  /** YAML note for AI agents operating on this resource */
  agent_note?: string;
  /** Short representation of a project */
  project?: ShortProjectView;
  /** User/member reference */
  creator?: MemberView;
  /** Defines the cache scope */
  cache_scope?: "PIPELINE" | "PROJECT" | "WORKSPACE";
  /** The list of trigger conditions to meet so that the pipeline can be triggered */
  trigger_conditions?: TriggerConditionView[];
  /** The list of environment variables defined for the pipeline */
  variables?: EnvironmentVariableView[];
  /** The list of environments attached to the pipeline */
  environments?: PipelineEnvironmentContextView[];
  /** The list of artifact contexts configured for the pipeline */
  artifacts?: PipelineArtifactContextView[];
  /** Access permissions configuration */
  permissions?: PermissionsView;
  /** If set to true, variables are managed by YAML configuration */
  manage_variables_by_yaml?: boolean;
  /** If set to true, permissions are managed by YAML configuration */
  manage_permissions_by_yaml?: boolean;
  /** The list of actions configured in the pipeline */
  actions?: ShortActionResponse[];
}
```

## Type Definitions

```typescript
interface PipelineEventView {
  /** The type of event that triggers the pipeline */
  type?: "PUSH" | "CREATE_REF" | "DELETE_REF" | "PULL_REQUEST" | "SCHEDULE" | "PUBLISH_ARTIFACT_VERSION" | "DELETE_ARTIFACT_VERSION" | "WEBHOOK" | "EMAIL" | "CREATE_ARTIFACT_VERSION" | "ENVIRONMENT_CREATE" | "ENVIRONMENT_DELETE" | "SANDBOX_CREATED" | "SANDBOX_DELETED" | "SANDBOX_TIMED_OUT" | "SENTRY" | "CLICKUP";
  /** The list of refs (branches/tags) that trigger the pipeline for push/ref events */
  refs?: string[];
  /** The list of pull request events that trigger the pipeline. Examples: `opened`, `reopened`, `synchronize` */
  events?: string[];
  /** The list of branches for pull request events */
  branches?: string[];
  /** The list of artifacts that trigger the pipeline */
  artifacts?: PipelineArtifactContextView[];
  /** The list of environments that trigger the pipeline */
  environments?: PipelineEnvironmentContextView[];
  /** The start date for scheduled events (type `SCHEDULE`) */
  start_date?: string;
  /** The delay in minutes between scheduled runs (type `SCHEDULE`) */
  delay?: number;
  /** The cron expression for scheduled (type `SCHEDULE`) events e.g., '0 9 * * 1-5' for weekdays at 9 AM */
  cron?: string;
  /** The timezone for scheduled events (type `SCHEDULE`) e.g., 'UTC', 'Europe/Warsaw' */
  timezone?: string;
  /** Whether TOTP (Time-based One-Time Password) is enabled for webhook events (type `WEBHOOK`) */
  totp?: boolean;
  /** The email subject prefix for email trigger events (type `EMAIL`) */
  prefix?: string;
  /** The list of allowed email addresses that can trigger the pipeline via email (type `EMAIL`) */
  whitelist?: string[];
  /** The list of sandbox targets that trigger the pipeline for sandbox events (type `SANDBOX_CREATED`, `SANDBOX_DELETED`, `SANDBOX_TIMED_OUT`) */
  targets?: TargetView[];
  /** The identifier of the Sentry integration whose webhooks trigger the pipeline (type `SENTRY`) */
  integration?: string;
  /** The list of Sentry project slugs that trigger the pipeline; empty means all projects (type `SENTRY`) */
  projects?: string[];
  /** The list of Sentry issue levels that trigger the pipeline e.g., `error`, `fatal`; empty means all levels (type `SENTRY`) */
  levels?: string[];
  /** The list of Sentry issue statuses that trigger the pipeline e.g., `unresolved`; empty means all statuses (type `SENTRY`) */
  statuses?: string[];
  /** The list of Sentry issue substatuses that trigger the pipeline e.g., `new`, `regressed`; empty means all substatuses (type `SENTRY`) */
  substatuses?: string[];
  /** The minimum number of events in the Sentry issue required to trigger the pipeline (type `SENTRY`) */
  count?: number;
  /** The minimum number of users affected by the Sentry issue required to trigger the pipeline (type `SENTRY`) */
  user_count?: number;
  /** The number of minutes to skip subsequent runs for the same Sentry issue after a triggered run (type `SENTRY`) */
  snooze_minutes?: number;
  /** The list of ClickUp folder names that trigger the pipeline; empty means all folders (type `CLICKUP`) */
  folders?: string[];
  /** The list of ClickUp list names that trigger the pipeline; empty means all lists (type `CLICKUP`) */
  lists?: string[];
  /** The list of ClickUp task priorities that trigger the pipeline e.g., `urgent`, `high`; empty means all priorities (type `CLICKUP`) */
  priorities?: string[];
  /** The list of ClickUp task tags that trigger the pipeline; matches when at least one tag is present; empty means all tags (type `CLICKUP`) */
  tags?: string[];
  /** The list of assignee email addresses that trigger the pipeline; matches when at least one assignee has a listed email; empty means all assignees (type `CLICKUP`) */
  assignees?: string[];
  /** The list of creator email addresses that trigger the pipeline; matches when the task creator has a listed email; empty means all creators (type `CLICKUP`) */
  creators?: string[];
  /** The list of custom field filters; each entry has a `name` and a list of `values` (matches when a value matches); entries are combined with AND (type `CLICKUP`) */
  custom_fields?: ClickUpCustomFieldFilter[];
  /** Whether to include subtasks; `true` (default) matches parent tasks and subtasks, `false` matches only top-level tasks (type `CLICKUP`) */
  include_subtasks?: boolean;
}

interface PipelineArtifactContextView {
  /** A human-readable ID of artifact */
  identifier?: string;
  /** The scope of the artifact */
  scope?: "WORKSPACE" | "PROJECT" | "ENVIRONMENT" | "ANY";
}

interface PipelineEnvironmentContextView {
  /** A human-readable ID of the environment. Alphanumeric characters, underscores, and hyphens (hyphens cannot appear at the start or end). */
  identifier?: string;
  /** The list of tags associated with the environment */
  tags?: string[];
  /** The scope of the environment */
  scope?: "PROJECT" | "WORKSPACE" | "ANY";
}

interface TargetView {
  /** API endpoint to GET this object */
  url?: string;
  /** Web URL to view this object in Buddy.works */
  html_url?: string;
  /** The ID of the target */
  id?: string;
  /** A human-readable ID.  Alphanumeric characters, underscores, and hyphens (hyphens cannot appear at the start or end). */
  identifier: string;
  /** The name of the target */
  name?: string;
  /** Short representation of a project */
  project?: ShortProjectView;
  /** Short representation of a pipeline */
  pipeline?: ShortPipelineView;
  environment?: ShortEnvironmentView;
  /** Access permissions configuration */
  permissions?: PermissionsView;
  /** Pipelines access level for this target */
  pipelines_access_level?: "DENIED" | "READ_ONLY" | "USE_ONLY" | "BLIND" | "RUN_ONLY" | "READ_WRITE" | "MANAGE" | "DEFAULT" | "ALLOWED" | "STAGE" | "COMMIT";
  /** List of specific pipelines allowed to use this target */
  allowed_pipelines?: AllowedPipelineView[];
  /** Sandboxes access level for this target */
  sandboxes_access_level?: "DENIED" | "READ_ONLY" | "USE_ONLY" | "BLIND" | "RUN_ONLY" | "READ_WRITE" | "MANAGE" | "DEFAULT" | "ALLOWED" | "STAGE" | "COMMIT";
  /** List of specific sandboxes allowed to use this target */
  allowed_sandboxes?: AllowedSandboxView[];
  /** Indicates if this target is disabled (default: `false`) */
  disabled?: boolean;
  /** The list of tags associated with the target */
  tags?: string[];
  /** Defines how the target can be used (as deployment target, proxy, or both) */
  use_as?: UseAsView;
  /** Note for this resource */
  note?: string;
  /** YAML note for AI agents operating on this resource */
  agent_note?: string;
  /** The type of the target */
  type?: "SSH" | "FTP" | "GIT" | "MATCH" | "EC2" | "DIGITAL_OCEAN" | "VULTR" | "UPCLOUD" | "GKE" | "EKS" | "AKS" | "DOKS" | "K8S_CLUSTER" | "MYSQL" | "POSTGRESQL" | "PROJECT_REPO" | "MONGO" | "MSSQL" | "RDS_MSSQL" | "CLICKHOUSE";
}

interface ShortProjectView {
  /** API endpoint to GET this object */
  url?: string;
  /** Web URL to view this object in Buddy.works */
  html_url?: string;
  /** The human-readable ID of the project */
  name?: string;
  /** The Name of the project */
  display_name: string;
  /** The status of the project */
  status?: string;
  /** Indicates if this is a public project */
  access?: "PRIVATE" | "PUBLIC";
  /** The creation date of the project */
  create_date?: string;
}

interface ShortPipelineView {
  /** API endpoint to GET this object */
  url?: string;
  /** Web URL to view this object in Buddy.works */
  html_url?: string;
  /** The unique ID of the pipeline */
  id?: number;
  /** A human-readable ID of pipeline */
  identifier?: string;
  /** The name of the pipeline */
  name?: string;
  /** The source of the pipeline definition */
  definition_source?: "LOCAL" | "REMOTE";
  /** The git configuration reference type */
  git_config_ref?: "NONE" | "DYNAMIC" | "FIXED";
  /** Pipeline git context refs. If unset and events is empty, the pipeline counts as codeless */
  refs?: string[];
  /** The list of events that trigger the pipeline run */
  events?: PipelineEventView[];
  /** The loop configuration for the pipeline */
  loop?: string[];
  /** The priority of the pipeline */
  priority?: "LOW" | "NORMAL" | "HIGH";
  /** Indicates if the pipeline is disabled */
  disabled?: boolean;
  /** The reason why the pipeline is disabled */
  disabled_reason?: string;
  /** The status of the last run */
  last_execution_status?: "INPROGRESS" | "ENQUEUED" | "TERMINATED" | "SUCCESSFUL" | "FAILED" | "INITIAL" | "NOT_EXECUTED" | "SKIPPED" | "TERMINATING" | "WAITING_FOR_APPLY" | "WAITING_FOR_VARIABLES" | "WAITING_FOR_SETTABLE_VARIABLES" | "WAITING_FOR_VT_SESSION";
  /** The git revision of the last run */
  last_execution_revision?: string;
  /** The URL to the target site after deployment */
  target_site_url?: string;
  /** The template for commit status messages */
  execution_message_template?: string;
  /** The creation date of the pipeline */
  create_date?: string;
  /** Defines whether to upload everything from scratch on every run */
  always_from_scratch?: boolean;
  /** If set to true, the status of a given pipeline will not impact the project status on the dashboard */
  ignore_fail_on_project_status?: boolean;
  /** Which queued runs to skip when a new run starts: NEVER, ALWAYS, SAME_REF, SAME_ENVIRONMENT or SAME_ARTIFACT */
  skip_queued_runs?: "NEVER" | "ALWAYS" | "SAME_REF" | "SAME_ENVIRONMENT" | "SAME_ARTIFACT";
  /** Which in-progress runs to cancel when a new run starts: NEVER, ALWAYS, SAME_REF, SAME_ENVIRONMENT or SAME_ARTIFACT */
  cancel_inprogress_runs?: "NEVER" | "ALWAYS" | "SAME_REF" | "SAME_ENVIRONMENT" | "SAME_ARTIFACT";
  /** Defines whether to automatically clear cache before running the pipeline */
  auto_clear_cache?: boolean;
  /** Indicates if the pipeline is paused */
  paused?: boolean;
  /** Defines how many repeated failures are required to pause the pipeline */
  pause_on_repeated_failures?: number;
  /** If set to true, all refs will be fetched from the repository */
  fetch_all_refs?: boolean;
  /** If set to true, LFS files will be fetched from the external repository during pipeline runs */
  fetch_lfs?: boolean;
  /** If set to true, the pipeline will fail on environment preparation warnings */
  fail_on_prepare_env_warning?: boolean;
  /** Defines whether the pipeline can be run concurrently */
  concurrent_pipeline_runs?: boolean;
  /** Defines the depth of the git clone operation for shallow clones */
  clone_depth?: number;
  /** If set to true, commit statuses will not be created in the repository */
  do_not_create_commit_status?: boolean;
  /** Indicates that pipeline definition was probably removed on particular Git ref and pipeline won't be run on events */
  stale?: boolean;
  /** Indicates if the pipeline is waiting for the first push to the repository */
  waiting_for_push?: boolean;
  /** The resource configuration for the pipeline run */
  resources?: "DEFAULT" | "NANO" | "SMALL" | "MEDIUM" | "LARGE" | "XLARGE" | "CUSTOM" | "X2LARGE";
  /** The path to the remote pipeline definition file */
  remote_path?: string;
  /** The ref of the remote pipeline definition */
  remote_ref?: string;
  /** The project name of the remote pipeline definition */
  remote_project_name?: string;
  /** The parameters passed to the remote pipeline definition */
  remote_parameters?: PipelinePropertyView[];
  /** YAML pipeline definition configuration */
  git_config?: YamlDefinitionView;
  /** The list of tags associated with the pipeline for organization */
  tags?: string[];
  /** The base for git changeset calculation. Determines which changes trigger the pipeline */
  git_changeset_base?: "LATEST_RUN" | "LATEST_RUN_MATCHING_REF" | "PULL_REQUEST";
  /** The base for filesystem changeset calculation. Determines which file changes trigger the pipeline */
  filesystem_changeset_base?: "DATE_MODIFIED" | "CONTENTS";
  /** The CPU architecture for the pipeline run */
  cpu?: "X64" | "ARM" | "X86";
  /** If set to true, a description is required when executing the pipeline manually */
  description_required?: boolean;
  /** The folder name where the pipeline is organized */
  folder?: string;
  /** Note for this resource */
  note?: string;
  /** YAML note for AI agents operating on this resource */
  agent_note?: string;
}

interface PipelinePropertyView {
  /** The key of the pipeline property */
  key?: string;
  /** The value of the pipeline property */
  value?: string;
}

interface YamlDefinitionView {
  /** The file path to the YAML definition */
  path?: string;
  /** The git ref (branch/tag) where the YAML definition is located */
  branch?: string;
  /** The project name where the YAML definition is located */
  project?: string;
}

interface ShortEnvironmentView {
  /** API endpoint to GET this object */
  url?: string;
  /** Web URL to view this object in Buddy.works */
  html_url?: string;
  /** The ID of the environment */
  id?: string;
  /** The name of the environment */
  name?: string;
  /** A human-readable ID of the environment. Alphanumeric characters, underscores, and hyphens (hyphens cannot appear at the start or end). */
  identifier?: string;
  /** The list of tags associated with the environment */
  tags?: string[];
  /** The scope of the environment */
  scope?: "PROJECT" | "WORKSPACE";
}

interface PermissionsView {
  /** Access level for other workspace members */
  others?: "DENIED" | "READ_ONLY" | "USE_ONLY" | "BLIND" | "RUN_ONLY" | "READ_WRITE" | "MANAGE" | "DEFAULT" | "ALLOWED" | "STAGE" | "COMMIT";
  /** List of specific users with their access levels */
  users?: UserPermissionView[];
  /** List of user groups with their access levels */
  groups?: GroupPermissionView[];
}

interface UserPermissionView {
  /** The ID of the user */
  id?: number;
  /** The access level for the user */
  access_level?: "DENIED" | "READ_ONLY" | "USE_ONLY" | "BLIND" | "RUN_ONLY" | "READ_WRITE" | "MANAGE" | "DEFAULT" | "ALLOWED" | "STAGE" | "COMMIT";
}

interface GroupPermissionView {
  /** The ID of the group */
  id?: number;
  /** The access level for the group */
  access_level?: "DENIED" | "READ_ONLY" | "USE_ONLY" | "BLIND" | "RUN_ONLY" | "READ_WRITE" | "MANAGE" | "DEFAULT" | "ALLOWED" | "STAGE" | "COMMIT";
}

interface AllowedPipelineView {
  /** Project name */
  project: string;
  /** Pipeline identifier */
  pipeline: string;
  /** Access level for the allowed pipeline. Project repository targets: `DENIED`, `READ_ONLY`, `READ_WRITE`. Other targets: `DENIED`, `USE_ONLY` */
  access_level?: "DENIED" | "READ_ONLY" | "USE_ONLY" | "BLIND" | "RUN_ONLY" | "READ_WRITE" | "MANAGE" | "DEFAULT" | "ALLOWED" | "STAGE" | "COMMIT";
}

interface AllowedSandboxView {
  /** Project name */
  project: string;
  /** Sandbox identifier */
  sandbox: string;
  /** Access level for the allowed sandbox: `DENIED`, `READ_ONLY`, `READ_WRITE` */
  access_level?: "DENIED" | "READ_ONLY" | "USE_ONLY" | "BLIND" | "RUN_ONLY" | "READ_WRITE" | "MANAGE" | "DEFAULT" | "ALLOWED" | "STAGE" | "COMMIT";
}

interface UseAsView {
  /** Whether the target can be used as a deployment target (default: `true`) */
  target?: boolean;
  /** Whether the target can be used as a proxy (default: `true`) */
  proxy?: boolean;
}

interface ClickUpCustomFieldFilter {
  /** The name of the ClickUp custom field to match */
  name?: string;
  /** The list of accepted values of the custom field; matches when at least one value matches; empty means any value */
  values?: string[];
}

interface MemberView {
  /** API endpoint to GET this object */
  url?: string;
  /** Web URL to view this object in Buddy.works */
  html_url?: string;
  /** The ID of the user */
  id?: number;
  /** The name of the user */
  name?: string;
  /** The avatar URL of the user */
  avatar_url?: string;
  /** The email address of the user */
  email?: string;
  /** Whether the user has admin privileges */
  admin?: boolean;
  /** Whether the user is workspace owner */
  workspace_owner?: boolean;
}

interface TriggerConditionView {
  /** The type of trigger condition */
  trigger_condition?: "ALWAYS" | "ON_CHANGE" | "ON_CHANGE_AT_PATH" | "VAR_IS" | "VAR_IS_NOT" | "VAR_CONTAINS" | "VAR_NOT_CONTAINS" | "DATETIME" | "SUCCESS_PIPELINE" | "DAY" | "HOUR" | "OR" | "VAR_LESS_THAN" | "VAR_LESS_THAN_OR_EQUAL" | "VAR_GREATER_THAN" | "VAR_GREATER_THAN_OR_EQUAL" | "ACTION_STATUS_IS" | "ACTION_STATUS_IS_NOT" | "TRIGGERING_USER_IS" | "TRIGGERING_USER_IS_NOT" | "TRIGGERING_USER_IS_IN_GROUP" | "TRIGGERING_USER_IS_NOT_IN_GROUP";
  /** The value to compare the trigger variable against */
  trigger_variable_value?: string;
  /** The name of the variable to check in the trigger condition */
  trigger_variable_key?: string;
  /** The timezone for datetime trigger conditions (e.g., 'UTC', 'Europe/Warsaw') */
  timezone?: string;
  /** The hours when the datetime trigger should activate (0-23) */
  trigger_hours?: number[];
  /** The days when the datetime trigger should activate (1-7, where 1 is Monday) */
  trigger_days?: number[];
  /** The project name for cross-project pipeline triggers */
  trigger_project_name?: string;
  /** The pipeline name for cross-pipeline triggers */
  trigger_pipeline_name?: string;
  /** The email of the user who can trigger the pipeline */
  trigger_user?: string;
  /** The name of the group that can trigger the pipeline */
  trigger_group?: string;
  /** The file paths that must change to trigger the pipeline */
  trigger_condition_paths?: string[];
  /** The action status to check for action status triggers */
  trigger_status?: "SUCCESSFUL" | "FAILED" | "SKIPPED" | "SUPPRESSED";
  /** The name of the action to check status for */
  trigger_action_name?: string;
  /** The list of nested trigger conditions for OR/AND operators */
  trigger_operands?: TriggerConditionOperandView[];
}

interface TriggerConditionOperandView {
  /** The type of trigger condition */
  trigger_condition?: "ALWAYS" | "ON_CHANGE" | "ON_CHANGE_AT_PATH" | "VAR_IS" | "VAR_IS_NOT" | "VAR_CONTAINS" | "VAR_NOT_CONTAINS" | "DATETIME" | "SUCCESS_PIPELINE" | "DAY" | "HOUR" | "OR" | "VAR_LESS_THAN" | "VAR_LESS_THAN_OR_EQUAL" | "VAR_GREATER_THAN" | "VAR_GREATER_THAN_OR_EQUAL" | "ACTION_STATUS_IS" | "ACTION_STATUS_IS_NOT" | "TRIGGERING_USER_IS" | "TRIGGERING_USER_IS_NOT" | "TRIGGERING_USER_IS_IN_GROUP" | "TRIGGERING_USER_IS_NOT_IN_GROUP";
  /** The value to compare the trigger variable against */
  trigger_variable_value?: string;
  /** The name of the variable to check in the trigger condition */
  trigger_variable_key?: string;
  /** The timezone for datetime trigger conditions (e.g., 'UTC', 'Europe/Warsaw') */
  timezone?: string;
  /** The hours when the datetime trigger should activate (0-23) */
  trigger_hours?: number[];
  /** The days when the datetime trigger should activate (1-7, where 1 is Monday) */
  trigger_days?: number[];
  /** The project name for cross-project pipeline triggers */
  trigger_project_name?: string;
  /** The pipeline name for cross-pipeline triggers */
  trigger_pipeline_name?: string;
  /** The email of the user who can trigger the pipeline */
  trigger_user?: string;
  /** The name of the group that can trigger the pipeline */
  trigger_group?: string;
  /** The file paths that must change to trigger the pipeline */
  trigger_condition_paths?: string[];
  /** The action status to check for action status triggers */
  trigger_status?: "SUCCESSFUL" | "FAILED" | "SKIPPED" | "SUPPRESSED";
  /** The name of the action to check status for */
  trigger_action_name?: string;
}

interface EnvironmentVariableView {
  /** The ID of the variable */
  id?: number;
  /** The name of the variable */
  key?: string;
  /** The value of the variable */
  value?: string;
  /** The type of the added variable */
  type?: "VAR" | "FILE" | "SSH_KEY" | "IOS_KEYCHAIN" | "IOS_PROVISION_PROFILES" | "SSH_PUBLIC_KEY" | "GPG_KEY";
  /** If set to `true` the variable value will be encrypted and hidden */
  encrypted?: boolean;
  /** If set to `true` the variable value can be set by Buddy actions */
  settable?: boolean;
  /** Available only if `type=VAR`. If set to `true` the variable value can be set by Buddy actions only for execution time */
  run_only_settable?: boolean;
  /** Initial path for the variable */
  init_path?: string;
  /** Default value for the variable */
  defaults?: string;
  /** Specifies where to copy the file on each run. Set if `type` is `FILE`, `SSH_KEY`, `SSH_PUBLIC_KEY`, `IOS_KEYCHAIN`, or `IOS_PROVISION_PROFILES` */
  file_path?: string;
  /** File permission set on copy to a container on each run. Set if `type` is `FILE`, `SSH_KEY`, `SSH_PUBLIC_KEY`, `IOS_KEYCHAIN`, or `IOS_PROVISION_PROFILES` */
  file_chmod?: string;
  /** Set if `type` is `FILE`, `SSH_KEY`, `SSH_PUBLIC_KEY`, `IOS_KEYCHAIN`, or `IOS_PROVISION_PROFILES`. If it's `NONE`, the variable can be used as a parameter in an action. For `CONTAINER`, the given key is additionally copied to an action container on each run */
  file_place?: "NONE" | "CONTAINER";
  /** Whether the file is binary */
  binary?: boolean;
  /** Public value for SSH key type variables */
  public_value?: string;
  /** Fingerprint of SSH key */
  key_fingerprint?: string;
  /** Checksum of the variable value */
  checksum?: string;
  /** Password for certificates */
  password?: string;
  /** Passphrase for encrypted SSH keys */
  passphrase?: string;
  /** Key identifier for iOS certificates, provisioning profiles, or GPG keys */
  key_identifier?: string;
  /** Set to `true` to disable the variable. Disabled variables are not injected anywhere */
  disabled?: boolean;
  /** Note for this resource */
  note?: string;
  /** YAML note for AI agents operating on this resource */
  agent_note?: string;
}

interface ShortActionResponse {
  /** API endpoint to GET this object */
  url?: string;
  /** Web URL to view this object in Buddy.works */
  html_url?: string;
  /** The ID of the action */
  id?: number;
  /** The name of the action */
  name?: string;
  /** The type of the action */
  type?: "TRANSFER" | "AMAZON_S3" | "WEB_DAV" | "SSH_COMMAND" | "HTTP" | "SLACK" | "EMAIL" | "SMS" | "PUSH" | "HEROKU" | "BUILD" | "PING" | "WEB" | "TCP" | "RUN_NEXT_PIPELINE" | "ELASTIC_BEANSTALK" | "GCS" | "SHOPIFY" | "PUSHOVER" | "PUSHBULLET" | "CODE_DEPLOY" | "AZURE" | "DOCKERFILE" | "GOOGLE_APP_ENGINE" | "LAMBDA" | "HEROKU_CLI" | "RACKSPACE" | "CLOUDFLARE" | "CLOUD_FRONT" | "MONITOR" | "SLEEP" | "AWS_CLI" | "GOOGLE_CDN" | "AWS_LAMBDA_DEPLOY" | "KUBERNETES_APPLY" | "KUBERNETES_SET_IMAGE" | "KUBERNETES_RUN_POD" | "WAIT_FOR_APPLY" | "APPROVE_VT" | "NEW_RELIC" | "KUBERNETES_RUN_JOB" | "ZIP" | "ROLLBAR" | "SENTRY" | "DATADOG" | "DO_SPACES" | "HONEYBADGER" | "SENTRY_ENTERPRISE" | "LOGGLY" | "KUBERNETES_CLI" | "RUN_DOCKER_CONTAINER" | "ESLINT" | "DOCKER_PUSH" | "ANDROID_SIGN" | "ANDROID_PLAY" | "WAIT_FOR_VARIABLES" | "GCLOUD_CLI" | "AWS_ECS" | "IMPORT_FILES" | "FIREBASE" | "TELEGRAM" | "REPLACE" | "GOOGLE_FUNCTIONS_DEPLOY" | "GOOGLE_FUNCTIONS" | "BUGSNAG" | "SPLIT_TESTS" | "RAYGUN" | "DATADOG_STATUS_CHECK" | "GHOST_INSPECTOR" | "AWS_CLOUD_FORMATION" | "DIGITAL_OCEAN_CDN" | "DISCORD2" | "IMAGE_COMPRESSION" | "NETLIFY" | "GIT_CRYPT_UNLOCK" | "GIT_CRYPT_LOCK" | "HELM" | "DOCKERFILE_LINTER" | "DOWNLOAD" | "DOWNLOAD_S3" | "LIGHTHOUSE" | "ANDROID_SIGN_BUNDLE" | "ANDROID_PLAY_BUNDLE" | "VISUAL_TESTS" | "VISUAL_TEST_2" | "LINK_VALIDATOR" | "AZURE_CLI" | "SHOPIFY_THEMEKIT_CLI" | "SSL_VERIFY" | "AZURE_STORAGE" | "DEPLOY_TO_SANDBOX" | "SANDBOX_START" | "SANDBOX_STOP" | "SANDBOX_EXEC" | "GIT_HUB_RELEASE" | "GCLOUD_RUN_DEPLOY" | "SANDBOX_SNAPSHOT" | "AWS_CLI_2" | "MICROSOFT_TEAMS" | "NATIVE_BUILD_WINDOWS" | "NATIVE_BUILD_MAC" | "DOCTL" | "NATIVE_BUILD_MAC_REACT" | "NATIVE_BUILD_MAC_CORDOVA" | "NATIVE_BUILD_MAC_FASTLANE" | "NATIVE_BUILD_MAC_FLUTTER" | "GOOGLE_CLOUD_STORAGE" | "GOOGLE_FUNCTION_DEPLOY" | "GOOGLE_FUNCTION_INVOKE" | "GOOGLE_CDN_INVALIDATE" | "GOOGLE_CLOUD_CLI" | "GOOGLE_CLOUD_RUN_DEPLOY" | "GOOGLE_APP_DEPLOY" | "ANDROID_PUBLISH_APK" | "ANDROID_PUBLISH_APP_BUNDLE" | "SANDBOX_CREATE_NEW" | "SANDBOX_CREATE_FROM_SANDBOX" | "SANDBOX_CREATE_FROM_SNAPSHOT" | "SANDBOX_DELETE" | "NATIVE_BUILD_MAC_SIGN" | "NATIVE_BUILD_MAC_DEPLOY" | "NATIVE_BUILD_DOCKER_CLI" | "CLEAR_CACHE" | "FASTLANE_ANDROID" | "NATIVE_BUILD_LINUX" | "GIT_HUB_CLI" | "INTEGRATION_VARIABLES" | "DOCKER_BUILD_MULTI_ARCH" | "CODE_PIPELINE" | "GIT_LAB_CLI" | "AWS_APP_RUNNER_DEPLOY" | "AWS_APP_RUNNER_MONITOR" | "NATIVE_BUILD_MAC_VM" | "AWS_CDK_CLI" | "GHOST_INSPECTOR_CLI" | "TERRAFORM" | "ATOP" | "SNYK_CLI" | "STACK_HAWK_CLI" | "JMETER_CLI" | "CUSTOM" | "BLACKFIRE_PHP" | "BLACKFIRE_PYTHON" | "BLACKFIRE_GO" | "LINK_CHECKER" | "SHOPIFY_CLI" | "DOCKER" | "SET_VARIABLES" | "DOWNLOAD_FROM_SANDBOX" | "PIPELINE_SETTINGS" | "BACKBLAZE_B2" | "NEW_RELIC_CLI" | "DOWNLOAD_GCS" | "DOWNLOAD_BACKBLAZE_B2" | "WP_CLI" | "GOOGLE_CHAT" | "SANDBOX_APPLICATION_START" | "SANDBOX_APPLICATION_STOP" | "POWERSHELL" | "SANDBOX_MANAGE" | "SANDBOX_CREATE" | "CONTENTFUL_CLI" | "JIRA_BUILD" | "JIRA_DEPLOYMENT" | "MYSQL_CLI" | "POSTGRESQL_CLI" | "MONGOSH_CLI" | "MSSQL_CLI" | "CLICKHOUSE_CLI" | "CRAWL" | "FTP" | "FTPS" | "SFTP" | "GCE" | "VULTR" | "UPCLOUD" | "DIGITAL_OCEAN" | "DOWNLOAD_FTP" | "DOWNLOAD_FTPS" | "DOWNLOAD_SSH" | "RSYNC" | "PROMOTE_IMAGE" | "PUBLISH_ARTIFACT_VERSION" | "COMPOSER_PUBLISH" | "DOWNLOAD_ARTIFACT_VERSION" | "STORYBOOK" | "PLAYWRIGHT" | "CYPRESS" | "NPM_PUBLISH" | "NPM_STAGE" | "GIT_MERGE" | "TRIVY_CLI" | "CLAUDE_CODE" | "SECURITY_AUDIT" | "BUDDY_CDN" | "DOCKER_IMAGE_OPS" | "ANTIGRAVITY" | "ARTIFACT_CLEANUP" | "CODEX_CLI" | "CURSOR" | "OPENCODE" | "GROK" | "EXTRACT";
  /** The git revision of the last successful run of the action */
  current_revision?: string;
  /** Specifies when the action should be executed */
  trigger_time?: "ON_EVERY_EXECUTION" | "ON_FAILURE" | "ON_BACK_TO_SUCCESS" | "ON_WARNING" | "ON_WAIT_FOR_APPROVE" | "ON_TERMINATE";
  /** The list of trigger conditions to meet so that the action can be triggered */
  trigger_conditions?: TriggerConditionView[];
  /** Defines whether the action should run in parallel with the next one */
  run_next?: "WAIT_ON_SUCCESS" | "IN_SOFT_PARALLEL" | "IN_HARD_PARALLEL";
  /** Defines whether the action should be executed on each failure. Restricted to and required if the `trigger_time` is `ON_FAILURE` */
  run_only_on_first_failure?: boolean;
  /** The list of variables you can use the action */
  variables?: EnvironmentVariableView[];
  /** When set to `true` the action is disabled. By default it is set to `false` */
  disabled?: boolean;
  /** The timeout in seconds */
  timeout?: number;
  /** If set to `true` the execution will proceed, mark action as a warning and jump to the next action. Doesn't apply to deployment actions */
  ignore_errors?: boolean;
  /** Number of retries if the action fails */
  retry_count?: number;
  /** Delay time between auto retries in seconds */
  retry_interval?: number;
  /** The status of the last run of the action */
  last_execution_status?: "INPROGRESS" | "ENQUEUED" | "TERMINATED" | "SUCCESSFUL" | "FAILED" | "INITIAL" | "NOT_EXECUTED" | "SKIPPED" | "TERMINATING" | "WAITING_FOR_APPLY" | "WAITING_FOR_VARIABLES" | "WAITING_FOR_SETTABLE_VARIABLES" | "WAITING_FOR_VT_SESSION";
  /** The integration used by the action */
  integration?: IntegrationIdentifierView;
  /** The integration used by the action */
  helm_repository_integration?: IntegrationIdentifierView;
}

interface IntegrationIdentifierView {
  /** A human-readable ID of the integration */
  identifier?: string;
}

```

## Request Example

```bash
curl -X POST "https://api.buddy.works/workspaces/:workspace/projects/:project_name/pipelines/yaml" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{
  "yaml": "LSBwaXBlbGluZTogdmFyeQogIHJlZnM6CiAgLSByZWZzL2hlYWRzL21hc3RlcgogIGV2ZW50czoKICAtIHR5cGU6IFdFQkhPT0sKICBmYWlsX29uX3ByZXBhcmVfZW52X3dhcm5pbmc6IHRydWUKICBhY3Rpb25zOgogIC0gYWN0aW9uOiBQYXNzIGFyZ3VtZW50cwogICAgdHlwZTogV0FJVF9GT1JfVkFSSUFCTEVTCiAgICB2YXJpYWJsZXM6CiAgICAtIGtleTogYWxhCiAgICAgIGVuY3J5cHRlZDogdHJ1ZQogIC0gYWN0aW9uOiAiZWNobyBcImFsYTogJGFsYVwiIgogICAgdHlwZTogQlVJTEQKICAgIGRvY2tlcl9pbWFnZV9uYW1lOiBidWRkeS9sb2NhbHNoZWxsCiAgICBkb2NrZXJfaW1hZ2VfdGFnOiB1YnVudHVfMjQuMDQKICAgIGV4ZWN1dGVfY29tbWFuZHM6CiAgICAtICJlY2hvIFwiYWxhOiAkYWxhXCIiCiAgICBzaGVsbDogQkFTSAo="
}'
```

## Response Example

**Status:** `201 Created`

```json
{
  "url": "https://api.buddy.works/workspaces/my-workspace/projects/my-project/pipelines/620",
  "html_url": "https://app.buddy.works/my-workspace/my-project/pipelines/pipeline/620",
  "id": 620,
  "identifier": "test",
  "name": "Tests",
  "definition_source": "LOCAL",
  "git_config_ref": "NONE",
  "refs": [
    "refs/heads/main"
  ],
  "events": [
    {
      "type": "PUSH",
      "refs": [
        ":context",
        "refs/heads/dev-*"
      ]
    },
    {
      "type": "CREATE_REF",
      "refs": [
        "refs/heads/feature-*"
      ]
    },
    {
      "type": "DELETE_REF",
      "refs": [
        "refs/heads/temp-*"
      ]
    },
    {
      "type": "PULL_REQUEST",
      "events": [
        "assigned",
        "unassigned"
      ],
      "branches": [
        "main",
        "releases/*"
      ]
    },
    {
      "type": "SCHEDULE",
      "refs": [
        "refs/heads/development"
      ],
      "start_date": "2025-01-01T08:00:00Z",
      "delay": 60
    },
    {
      "type": "WEBHOOK",
      "totp": true
    },
    {
      "type": "PUBLISH_ARTIFACT_VERSION",
      "artifacts": [
        {
          "identifier": "my-artifact",
          "scope": "PROJECT"
        },
        {
          "identifier": "shared-artifact",
          "scope": "WORKSPACE"
        }
      ]
    },
    {
      "type": "CREATE_ARTIFACT_VERSION",
      "artifacts": [
        {
          "identifier": "new-artifact:*",
          "scope": "PROJECT"
        }
      ]
    },
    {
      "type": "DELETE_ARTIFACT_VERSION",
      "artifacts": [
        {
          "identifier": "deprecated-artifact",
          "scope": "ANY"
        }
      ]
    },
    {
      "type": "EMAIL",
      "prefix": "deploy",
      "whitelist": [
        "admin@company.com",
        "deploy@company.com"
      ]
    },
    {
      "type": "SANDBOX_CREATED",
      "targets": [
        {
          "type": "MATCH",
          "filter": {
            "identifier": "my-sandbox-*",
            "scope": "ANY"
          }
        }
      ]
    },
    {
      "type": "SANDBOX_DELETED",
      "targets": [
        {
          "type": "MATCH",
          "filter": {
            "identifier": "*",
            "scope": "ANY"
          }
        }
      ]
    },
    {
      "type": "SANDBOX_TIMED_OUT",
      "targets": [
        {
          "type": "MATCH",
          "filter": {
            "identifier": "staging-*",
            "scope": "ANY",
            "tags": [
              "production"
            ]
          }
        }
      ]
    }
  ],
  "folder": "CI/CD",
  "priority": "HIGH",
  "disabled": false,
  "disabled_reason": null,
  "last_execution_status": "INITIAL",
  "target_site_url": "https://example.com",
  "execution_message_template": "test",
  "create_date": "2025-10-02T07:20:53Z",
  "always_from_scratch": true,
  "ignore_fail_on_project_status": true,
  "strict_context": false,
  "skip_queued_runs": "NEVER",
  "cancel_inprogress_runs": "NEVER",
  "auto_clear_cache": true,
  "paused": false,
  "pause_on_repeated_failures": 3,
  "fetch_all_refs": false,
  "fetch_lfs": false,
  "fail_on_prepare_env_warning": true,
  "concurrent_pipeline_runs": true,
  "clone_depth": 5,
  "do_not_create_commit_status": true,
  "stale": false,
  "waiting_for_push": false,
  "trigger_conditions": [
    {
      "trigger_condition": "ON_CHANGE_AT_PATH",
      "trigger_condition_paths": [
        "src/**/*",
        "tests/**/*"
      ]
    },
    {
      "trigger_condition": "VAR_IS",
      "trigger_variable_key": "ENV",
      "trigger_variable_value": "production"
    },
    {
      "trigger_condition": "VAR_GREATER_THAN",
      "trigger_variable_key": "BUILD_NUMBER",
      "trigger_variable_value": "100"
    },
    {
      "trigger_condition": "DATETIME",
      "trigger_days": [
        1,
        2,
        3,
        4,
        5
      ],
      "trigger_hours": [
        9,
        10,
        11,
        14,
        15,
        16
      ],
      "timezone": "Europe/Warsaw"
    },
    {
      "trigger_condition": "SUCCESS_PIPELINE",
      "trigger_project_name": "my-project",
      "trigger_pipeline_name": "build"
    },
    {
      "trigger_condition": "TRIGGERING_USER_IS",
      "trigger_user": "admin@company.com"
    },
    {
      "trigger_condition": "TRIGGERING_USER_IS_IN_GROUP",
      "trigger_group": "DevOps Team"
    },
    {
      "trigger_condition": "OR",
      "trigger_operands": [
        {
          "trigger_condition": "VAR_IS",
          "trigger_variable_key": "DEPLOY",
          "trigger_variable_value": "true"
        },
        {
          "trigger_condition": "TRIGGERING_USER_IS",
          "trigger_user": "release-manager@company.com"
        }
      ]
    }
  ],
  "resources": "LARGE",
  "git_changeset_base": "LATEST_RUN_MATCHING_REF",
  "filesystem_changeset_base": "CONTENTS",
  "tags": [
    "backend",
    "testing"
  ],
  "cpu": "ARM",
  "description_required": false,
  "project": {
    "url": "https://api.buddy.works/workspaces/my-workspace/projects/my-project",
    "html_url": "https://app.buddy.works/my-workspace/my-project",
    "name": "my-project",
    "display_name": "My Project",
    "status": "ACTIVE"
  },
  "creator": {
    "url": "https://api.buddy.works/workspaces/my-workspace/members/123",
    "html_url": "https://app.buddy.works/my-workspace/-/profile/123",
    "id": 123,
    "name": "John Doe",
    "avatar_url": "https://app.buddy.works/image-server/user/0/0/0/0/0/0/123/a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6/w/32/32/AVATAR.png?ts=1674644200000",
    "email": "john.doe@company.com",
    "admin": true,
    "workspace_owner": true
  },
  "cache_scope": "PIPELINE",
  "variables": [
    {
      "id": 1514,
      "key": "my_var",
      "value": "some_value",
      "type": "VAR",
      "description": ""
    }
  ],
  "environments": [
    {
      "identifier": "my_stage_env",
      "tags": [
        "myTag"
      ],
      "scope": "ANY"
    }
  ],
  "artifacts": [
    {
      "identifier": "my-artifact",
      "scope": "PROJECT"
    },
    {
      "identifier": "shared-lib",
      "scope": "WORKSPACE"
    }
  ],
  "permissions": {
    "others": "DENIED",
    "users": [
      {
        "id": 1,
        "access_level": "READ_WRITE"
      }
    ],
    "groups": [
      {
        "id": 320,
        "access_level": "READ_ONLY"
      }
    ]
  },
  "manage_variables_by_yaml": false,
  "manage_permissions_by_yaml": false,
  "actions": []
}
```

---
Original source: https://buddy.works/docs/api/pipelines/create-from-yaml