github.com/argoproj/argo-cd@v1.8.7/docs/developer-guide/api-docs.md (about)

     1  # API Docs
     2  
     3  You can find the Swagger docs by setting the path to `/swagger-ui` in your Argo CD UI's. E.g. [http://localhost:8080/swagger-ui](http://localhost:8080/swagger-ui).
     4  
     5  ## Authorization
     6  
     7  You'll need to authorize your API using a bearer token. To get a token:
     8  
     9  ```bash
    10  $ curl $ARGOCD_SERVER/api/v1/session -d $'{"username":"admin","password":"password"}'
    11  {"token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE1Njc4MTIzODcsImlzcyI6ImFyZ29jZCIsIm5iZiI6MTU2NzgxMjM4Nywic3ViIjoiYWRtaW4ifQ.ejyTgFxLhuY9mOBtKhcnvobg3QZXJ4_RusN_KIdVwao"} 
    12  ```
    13  
    14  > <=v1.2
    15  
    16  Then pass using the HTTP `SetCookie` header, prefixing with `argocd.token`:
    17  
    18  ```bash
    19  $ curl $ARGOCD_SERVER/api/v1/applications --cookie "argocd.token=$ARGOCD_TOKEN" 
    20  {"metadata":{"selfLink":"/apis/argoproj.io/v1alpha1/namespaces/argocd/applications","resourceVersion":"37755"},"items":...}
    21  ```
    22  
    23  > v1.3
    24  
    25  Then pass using the HTTP `Authorization` header, prefixing with `Bearer `:
    26  
    27  ```bash
    28  $ curl $ARGOCD_SERVER/api/v1/applications -H "Authorization: Bearer $ARGOCD_TOKEN" 
    29  {"metadata":{"selfLink":"/apis/argoproj.io/v1alpha1/namespaces/argocd/applications","resourceVersion":"37755"},"items":...}
    30  ```
    31