Skip to main content

Overview

The Application Service API provides comprehensive CRUD operations for Application resources. Applications represent the desired state of a Kubernetes application managed by Argo CD. Base Path: /api/v1/applications gRPC Service: application.ApplicationService

Application Resource

An Application defines the source repository, destination cluster, and sync policies.

Application Spec

source
ApplicationSource
Reference to the location of manifests or chart (single-source)
sources
ApplicationSource[]
Multiple sources for multi-source applications
destination
ApplicationDestination
required
Target Kubernetes cluster and namespace
project
string
required
Project name (use “default” if not specified)
syncPolicy
SyncPolicy
Sync policy configuration

Example Application

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: guestbook
  namespace: argocd
spec:
  project: default
  source:
    repoURL: https://github.com/argoproj/argocd-example-apps
    targetRevision: HEAD
    path: guestbook
  destination:
    server: https://kubernetes.default.svc
    namespace: guestbook
  syncPolicy:
    automated:
      prune: true
      selfHeal: true
    syncOptions:
    - CreateNamespace=true

API Operations

List Applications

Retrieve a list of applications.
GET /api/v1/applications
projects
string[]
Filter by project names
selector
string
Label selector (e.g., app=myapp,env=prod)
repo
string
Filter by repository URL
appNamespace
string
Filter by application namespace
curl https://argocd-server/api/v1/applications?projects=default \
  -H "Authorization: Bearer $TOKEN"

Get Application

Retrieve a specific application by name.
GET /api/v1/applications/{name}
name
string
required
Application name
refresh
string
Force refresh from Git (“normal” or “hard”)
project
string
Project filter for validation
appNamespace
string
Application namespace
curl https://argocd-server/api/v1/applications/guestbook \
  -H "Authorization: Bearer $TOKEN"

Create Application

Create a new application.
POST /api/v1/applications
application
Application
required
Complete Application resource definition
upsert
boolean
Update if already exists (default: false)
validate
boolean
Validate before creating (default: true)
curl -X POST https://argocd-server/api/v1/applications \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "metadata": {
      "name": "guestbook"
    },
    "spec": {
      "project": "default",
      "source": {
        "repoURL": "https://github.com/argoproj/argocd-example-apps",
        "path": "guestbook",
        "targetRevision": "HEAD"
      },
      "destination": {
        "server": "https://kubernetes.default.svc",
        "namespace": "guestbook"
      }
    }
  }'

Update Application

Update an existing application.
PUT /api/v1/applications/{application.metadata.name}
application
Application
required
Updated Application resource
validate
boolean
Validate before updating

Update Application Spec

Update only the application spec.
PUT /api/v1/applications/{name}/spec
name
string
required
Application name
spec
ApplicationSpec
required
Updated specification

Patch Application

Partially update an application.
PATCH /api/v1/applications/{name}
name
string
required
Application name
patch
string
required
JSON patch or merge patch content
patchType
string
required
Patch type: “json”, “merge”, or “strategic”
Example:
curl -X PATCH https://argocd-server/api/v1/applications/guestbook \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "patch": "{\"spec\":{\"syncPolicy\":{\"automated\":{\"prune\":true}}}}",
    "patchType": "merge"
  }'

Delete Application

Delete an application.
DELETE /api/v1/applications/{name}
name
string
required
Application name
cascade
boolean
Delete application resources (default: true)
propagationPolicy
string
Kubernetes propagation policy: “foreground”, “background”, or “orphan”
appNamespace
string
Application namespace
curl -X DELETE "https://argocd-server/api/v1/applications/guestbook?cascade=true" \
  -H "Authorization: Bearer $TOKEN"

Sync Operations

Sync Application

Trigger a sync operation to deploy the application.
POST /api/v1/applications/{name}/sync
name
string
required
Application name
revision
string
Target revision to sync (default: spec.targetRevision)
prune
boolean
Delete resources not in Git
dryRun
boolean
Preview sync without applying changes
strategy
SyncStrategy
Sync strategy (hook, apply)
resources
SyncOperationResource[]
Specific resources to sync
syncOptions
string[]
Sync options (e.g., “PruneLast=true”)
curl -X POST https://argocd-server/api/v1/applications/guestbook/sync \
  -H "Authorization: Bearer $TOKEN" \
  -d '{
    "prune": true,
    "dryRun": false
  }'

Terminate Operation

Cancel a running sync operation.
DELETE /api/v1/applications/{name}/operation

Rollback Application

Rollback to a previous revision.
POST /api/v1/applications/{name}/rollback
name
string
required
Application name
id
int64
required
History ID to rollback to
prune
boolean
Prune resources during rollback
dryRun
boolean
Preview rollback

Resource Operations

Get Resource

Get a specific resource managed by the application.
GET /api/v1/applications/{name}/resource
namespace
string
Resource namespace
resourceName
string
required
Resource name
version
string
required
API version (e.g., “v1”)
group
string
API group (empty for core)
kind
string
required
Resource kind (e.g., “Deployment”)

Delete Resource

Delete a specific resource.
DELETE /api/v1/applications/{name}/resource

Patch Resource

Patch a specific resource.
POST /api/v1/applications/{name}/resource

Monitoring & Observability

Get Resource Tree

Get the application’s resource hierarchy.
GET /api/v1/applications/{applicationName}/resource-tree

Watch Resource Tree

Stream resource tree updates.
GET /api/v1/stream/applications/{applicationName}/resource-tree

Get Pod Logs

Stream logs from application pods.
GET /api/v1/applications/{name}/pods/{podName}/logs
container
string
Container name
follow
boolean
Stream logs
tailLines
int64
Number of lines to tail
sinceSeconds
int64
Logs from last N seconds

Watch Applications

Stream application change events.
GET /api/v1/stream/applications

Next Steps

ApplicationSet API

Manage ApplicationSets

Project API

Configure projects for applications