# Generate generates

`POST /api/v1/applicationsets/generate`

Authentication (security requirement alternatives):

```json
[
  {
    "bearer": []
  }
]
```

- bearer: apiKey, header Authorization. A token sent as `Authorization: Bearer <token>`. [API Docs](https://sourcey-argocd.pages.dev/developer-guide/api-docs/index.md#authorization) shows how to get one.

Request body: application/json (required)

Type: object

Schema: [applicationsetApplicationSetGenerateRequest](https://sourcey-argocd.pages.dev/api/models/applicationsetapplicationsetgeneraterequest/index.md)

- `applicationSet` (optional)
  Reference: [v1alpha1ApplicationSet](https://sourcey-argocd.pages.dev/api/models/v1alpha1applicationset/index.md); Type: object

Responses:

- 200: A successful response.

Content type: application/json

Type: object

Schema: [applicationsetApplicationSetGenerateResponse](https://sourcey-argocd.pages.dev/api/models/applicationsetapplicationsetgenerateresponse/index.md)

- `applications` (optional)
  Type: array
  
  Items:
    Reference: [v1alpha1Application](https://sourcey-argocd.pages.dev/api/models/v1alpha1application/index.md); Type: object

- default: An unexpected error response.

Content type: application/json

Type: object

Schema: [runtimeError](https://sourcey-argocd.pages.dev/api/models/runtimeerror/index.md)

- `code` (optional)
  Type: integer, int32

- `details` (optional)
  Type: array
  
  Items:
    Reference: [protobufAny](https://sourcey-argocd.pages.dev/api/models/protobufany/index.md); Type: object

- `error` (optional)
  Type: string

- `message` (optional)
  Type: string

## Examples

### cURL

```bash
curl -X POST 'https://argocd.example.com/api/v1/applicationsets/generate' \
  -H 'Authorization: YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "applicationSet": {
    "metadata": {
      "annotations": {},
      "creationTimestamp": "2024-01-15T09:30:00Z",
      "deletionGracePeriodSeconds": 0,
      "deletionTimestamp": "2024-01-15T09:30:00Z",
      "finalizers": [
        "string"
      ],
      "generateName": "string",
      "generation": 0,
      "labels": {},
      "managedFields": [
        {
          "apiVersion": "string",
          "fieldsType": "string",
          "fieldsV1": {
            "Raw": "dGVzdA=="
          },
          "manager": "string",
          "operation": "string",
          "subresource": "string",
          "time": "2024-01-15T09:30:00Z"
        }
      ],
      "name": "string",
      "namespace": "string",
      "ownerReferences": [
        {
          "apiVersion": "string",
          "blockOwnerDeletion": true,
          "controller": true,
          "kind": "string",
          "name": "string",
          "uid": "string"
        }
      ],
      "resourceVersion": "string",
      "selfLink": "string",
      "uid": "string"
    },
    "spec": {
      "applyNestedSelectors": true,
      "generators": [
        {
          "clusterDecisionResource": {
            "configMapRef": "string",
            "name": "string",
            "requeueAfterSeconds": 0,
            "values": {}
          },
          "clusters": {
            "flatList": true,
            "values": {}
          },
          "git": {
            "directories": [
              {
                "exclude": true,
                "path": "string"
              }
            ],
            "files": [
              {
                "exclude": true,
                "path": "string"
              }
            ],
            "pathParamPrefix": "string",
            "repoURL": "string",
            "requeueAfterSeconds": 0,
            "revision": "string",
            "values": {}
          },
          "list": {
            "elements": [
              {
                "raw": "dGVzdA=="
              }
            ],
            "elementsYaml": "string"
          },
          "matrix": {
            "generators": [
              {}
            ]
          },
          "merge": {
            "mergeKeys": [
              "string"
            ]
          },
          "oci": {
            "directories": [
              {
                "exclude": true,
                "path": "string"
              }
            ],
            "files": [
              {
                "exclude": true,
                "path": "string"
              }
            ],
            "pathParamPrefix": "string",
            "repoURL": "string",
            "requeueAfterSeconds": 0,
            "revision": "string",
            "values": {}
          },
          "plugin": {
            "configMapRef": {
              "name": "string"
            },
            "input": {
              "parameters": {}
            },
            "requeueAfterSeconds": 0,
            "values": {}
          },
          "pullRequest": {
            "azuredevops": {
              "api": "string",
              "labels": [
                "string"
              ],
              "organization": "string",
              "project": "string",
              "repo": "string",
              "tokenRef": {
                "key": "string",
                "secretName": "string"
              }
            },
            "bitbucket": {
              "api": "string",
              "basicAuth": {
                "username": "string"
              },
              "bearerToken": {},
              "owner": "string",
              "repo": "string"
            },
            "bitbucketServer": {
              "api": "string",
              "bearerToken": {},
              "caRef": {
                "configMapName": "string",
                "key": "string"
              },
              "insecure": true,
              "project": "string",
              "repo": "string"
            },
            "continueOnRepoNotFoundError": true,
            "filters": [
              {
                "branchMatch": "string",
                "targetBranchMatch": "string",
                "titleMatch": "string"
              }
            ],
            "gitea": {
              "api": "string",
              "insecure": true,
              "labels": [
                "string"
              ],
              "owner": "string",
              "repo": "string"
            },
            "github": {
              "api": "string",
              "appSecretName": "string",
              "labels": [
                "string"
              ],
              "owner": "string",
              "repo": "string"
            },
            "gitlab": {
              "api": "string",
              "insecure": true,
              "labels": [
                "string"
              ],
              "project": "string",
              "pullRequestState": "string"
            },
            "requeueAfterSeconds": 0,
            "values": {}
          },
          "scmProvider": {
            "awsCodeCommit": {
              "allBranches": true,
              "region": "string",
              "role": "string",
              "tagFilters": [
                {
                  "key": "string",
                  "value": "string"
                }
              ]
            },
            "azureDevOps": {
              "allBranches": true,
              "api": "string",
              "organization": "string",
              "teamProject": "string"
            },
            "bitbucket": {
              "allBranches": true,
              "owner": "string",
              "user": "string"
            },
            "bitbucketServer": {
              "allBranches": true,
              "api": "string",
              "insecure": true,
              "project": "string"
            },
            "cloneProtocol": "string",
            "filters": [
              {
                "branchMatch": "string",
                "labelMatch": "string",
                "pathsDoNotExist": [
                  "string"
                ],
                "pathsExist": [
                  "string"
                ],
                "repositoryMatch": "string"
              }
            ],
            "gitea": {
              "allBranches": true,
              "api": "string",
              "excludeArchivedRepos": true,
              "insecure": true,
              "owner": "string"
            },
            "github": {
              "allBranches": true,
              "api": "string",
              "appSecretName": "string",
              "excludeArchivedRepos": true,
              "organization": "string"
            },
            "gitlab": {
              "allBranches": true,
              "api": "string",
              "group": "string",
              "includeArchivedRepos": true,
              "includeSharedProjects": true,
              "includeSubgroups": true,
              "insecure": true,
              "topic": "string"
            },
            "requeueAfterSeconds": 0,
            "values": {}
          },
          "selector": {
            "matchExpressions": [
              {
                "key": "string",
                "operator": "string",
                "values": [
                  "string"
                ]
              }
            ],
            "matchLabels": {}
          }
        }
      ],
      "goTemplate": true,
      "goTemplateOptions": [
        "string"
      ],
      "ignoreApplicationDifferences": [
        {
          "jqPathExpressions": [
            "string"
          ],
          "jsonPointers": [
            "string"
          ],
          "name": "string"
        }
      ],
      "preservedFields": {
        "annotations": [
          "string"
        ],
        "labels": [
          "string"
        ]
      },
      "strategy": {
        "deletionOrder": "string",
        "rollingSync": {
          "steps": [
            {
              "matchExpressions": [
                {
                  "key": "string",
                  "operator": "string",
                  "values": [
                    "string"
                  ]
                }
              ],
              "maxUpdate": {
                "intVal": 0,
                "strVal": "string",
                "type": 0
              }
            }
          ]
        },
        "type": "string"
      },
      "syncPolicy": {
        "applicationsSync": "string",
        "preserveResourcesOnDeletion": true
      },
      "template": {
        "metadata": {
          "annotations": {},
          "finalizers": [
            "string"
          ],
          "labels": {},
          "name": "string",
          "namespace": "string"
        },
        "spec": {
          "destination": {
            "name": "string",
            "namespace": "string",
            "server": "string"
          },
          "ignoreDifferences": [
            {
              "group": "string",
              "jqPathExpressions": [
                "string"
              ],
              "jsonPointers": [
                "string"
              ],
              "kind": "string",
              "managedFieldsManagers": [
                "string"
              ],
              "name": "string",
              "namespace": "string"
            }
          ],
          "info": [
            {
              "name": "string",
              "value": "string"
            }
          ],
          "project": "string",
          "revisionHistoryLimit": 0,
          "source": {
            "chart": "string",
            "directory": {
              "disableExtensionFilter": true,
              "exclude": "string",
              "include": "string",
              "jsonnet": {
                "extVars": [
                  {
                    "code": true,
                    "name": "string",
                    "value": "string"
                  }
                ],
                "libs": [
                  "string"
                ]
              },
              "recurse": true
            },
            "helm": {
              "apiVersions": [
                "string"
              ],
              "fileParameters": [
                {
                  "name": "string",
                  "path": "string"
                }
              ],
              "ignoreMissingValueFiles": true,
              "kubeVersion": "string",
              "namespace": "string",
              "parameters": [
                {
                  "forceString": true,
                  "name": "string",
                  "value": "string"
                }
              ],
              "passCredentials": true,
              "releaseName": "string",
              "skipCrds": true,
              "skipSchemaValidation": true,
              "skipTests": true,
              "valueFiles": [
                "string"
              ],
              "values": "string",
              "valuesObject": {
                "raw": "dGVzdA=="
              },
              "version": "string"
            },
            "kustomize": {
              "apiVersions": [
                "string"
              ],
              "commonAnnotations": {},
              "commonAnnotationsEnvsubst": true,
              "commonLabels": {},
              "components": [
                "string"
              ],
              "forceCommonAnnotations": true,
              "forceCommonLabels": true,
              "ignoreMissingComponents": true,
              "images": [
                "string"
              ],
              "kubeVersion": "string",
              "labelIncludeTemplates": true,
              "labelWithoutSelector": true,
              "namePrefix": "string",
              "nameSuffix": "string",
              "namespace": "string",
              "patches": [
                {
                  "options": {},
                  "patch": "string",
                  "path": "string",
                  "target": {
                    "annotationSelector": "string",
                    "labelSelector": "string",
                    "resId": {
                      "gvk": {
                        "group": "string",
                        "kind": "string",
                        "version": "string"
                      },
                      "name": "string",
                      "namespace": "string"
                    }
                  }
                }
              ],
              "replicas": [
                {
                  "name": "string"
                }
              ],
              "version": "string"
            },
            "name": "string",
            "path": "string",
            "plugin": {
              "env": [
                {
                  "name": "string",
                  "value": "string"
                }
              ],
              "name": "string",
              "parameters": [
                {
                  "array": [
                    "string"
                  ],
                  "map": {},
                  "name": "string",
                  "string": "string"
                }
              ]
            },
            "ref": "string",
            "repoURL": "string",
            "tagPrefix": "string",
            "targetRevision": "string"
          },
          "sourceHydrator": {
            "drySource": {
              "path": "string",
              "repoURL": "string",
              "targetRevision": "string"
            },
            "hydrateTo": {
              "targetBranch": "string"
            },
            "syncSource": {
              "path": "string",
              "repoURL": "string",
              "targetBranch": "string"
            }
          },
          "syncPolicy": {
            "automated": {
              "allowEmpty": true,
              "enabled": true,
              "prune": true,
              "selfHeal": true
            },
            "managedNamespaceMetadata": {
              "annotations": {},
              "labels": {}
            },
            "retry": {
              "backoff": {
                "duration": "string",
                "factor": 0,
                "maxDuration": "string"
              },
              "limit": 0,
              "refresh": true
            },
            "syncOptions": [
              "string"
            ]
          }
        }
      },
      "templatePatch": "string"
    },
    "status": {
      "applicationStatus": [
        {
          "application": "string",
          "lastTransitionTime": "2024-01-15T09:30:00Z",
          "message": "string",
          "status": "string",
          "step": "string",
          "targetrevisions": [
            "string"
          ]
        }
      ],
      "conditions": [
        {
          "lastTransitionTime": "2024-01-15T09:30:00Z",
          "message": "string",
          "reason": "string",
          "status": "string",
          "type": "string"
        }
      ],
      "health": {
        "lastTransitionTime": "2024-01-15T09:30:00Z",
        "message": "string",
        "status": "string"
      },
      "resources": [
        {
          "group": "string",
          "hook": true,
          "kind": "string",
          "name": "string",
          "namespace": "string",
          "requiresDeletionConfirmation": true,
          "requiresPruning": true,
          "status": "string",
          "syncWave": 0,
          "version": "string"
        }
      ],
      "resourcesCount": 0
    }
  }
}'
```

### JavaScript

```javascript
const body = `{
  "applicationSet": {
    "metadata": {
      "annotations": {},
      "creationTimestamp": "2024-01-15T09:30:00Z",
      "deletionGracePeriodSeconds": 0,
      "deletionTimestamp": "2024-01-15T09:30:00Z",
      "finalizers": [
        "string"
      ],
      "generateName": "string",
      "generation": 0,
      "labels": {},
      "managedFields": [
        {
          "apiVersion": "string",
          "fieldsType": "string",
          "fieldsV1": {
            "Raw": "dGVzdA=="
          },
          "manager": "string",
          "operation": "string",
          "subresource": "string",
          "time": "2024-01-15T09:30:00Z"
        }
      ],
      "name": "string",
      "namespace": "string",
      "ownerReferences": [
        {
          "apiVersion": "string",
          "blockOwnerDeletion": true,
          "controller": true,
          "kind": "string",
          "name": "string",
          "uid": "string"
        }
      ],
      "resourceVersion": "string",
      "selfLink": "string",
      "uid": "string"
    },
    "spec": {
      "applyNestedSelectors": true,
      "generators": [
        {
          "clusterDecisionResource": {
            "configMapRef": "string",
            "name": "string",
            "requeueAfterSeconds": 0,
            "values": {}
          },
          "clusters": {
            "flatList": true,
            "values": {}
          },
          "git": {
            "directories": [
              {
                "exclude": true,
                "path": "string"
              }
            ],
            "files": [
              {
                "exclude": true,
                "path": "string"
              }
            ],
            "pathParamPrefix": "string",
            "repoURL": "string",
            "requeueAfterSeconds": 0,
            "revision": "string",
            "values": {}
          },
          "list": {
            "elements": [
              {
                "raw": "dGVzdA=="
              }
            ],
            "elementsYaml": "string"
          },
          "matrix": {
            "generators": [
              {}
            ]
          },
          "merge": {
            "mergeKeys": [
              "string"
            ]
          },
          "oci": {
            "directories": [
              {
                "exclude": true,
                "path": "string"
              }
            ],
            "files": [
              {
                "exclude": true,
                "path": "string"
              }
            ],
            "pathParamPrefix": "string",
            "repoURL": "string",
            "requeueAfterSeconds": 0,
            "revision": "string",
            "values": {}
          },
          "plugin": {
            "configMapRef": {
              "name": "string"
            },
            "input": {
              "parameters": {}
            },
            "requeueAfterSeconds": 0,
            "values": {}
          },
          "pullRequest": {
            "azuredevops": {
              "api": "string",
              "labels": [
                "string"
              ],
              "organization": "string",
              "project": "string",
              "repo": "string",
              "tokenRef": {
                "key": "string",
                "secretName": "string"
              }
            },
            "bitbucket": {
              "api": "string",
              "basicAuth": {
                "username": "string"
              },
              "bearerToken": {},
              "owner": "string",
              "repo": "string"
            },
            "bitbucketServer": {
              "api": "string",
              "bearerToken": {},
              "caRef": {
                "configMapName": "string",
                "key": "string"
              },
              "insecure": true,
              "project": "string",
              "repo": "string"
            },
            "continueOnRepoNotFoundError": true,
            "filters": [
              {
                "branchMatch": "string",
                "targetBranchMatch": "string",
                "titleMatch": "string"
              }
            ],
            "gitea": {
              "api": "string",
              "insecure": true,
              "labels": [
                "string"
              ],
              "owner": "string",
              "repo": "string"
            },
            "github": {
              "api": "string",
              "appSecretName": "string",
              "labels": [
                "string"
              ],
              "owner": "string",
              "repo": "string"
            },
            "gitlab": {
              "api": "string",
              "insecure": true,
              "labels": [
                "string"
              ],
              "project": "string",
              "pullRequestState": "string"
            },
            "requeueAfterSeconds": 0,
            "values": {}
          },
          "scmProvider": {
            "awsCodeCommit": {
              "allBranches": true,
              "region": "string",
              "role": "string",
              "tagFilters": [
                {
                  "key": "string",
                  "value": "string"
                }
              ]
            },
            "azureDevOps": {
              "allBranches": true,
              "api": "string",
              "organization": "string",
              "teamProject": "string"
            },
            "bitbucket": {
              "allBranches": true,
              "owner": "string",
              "user": "string"
            },
            "bitbucketServer": {
              "allBranches": true,
              "api": "string",
              "insecure": true,
              "project": "string"
            },
            "cloneProtocol": "string",
            "filters": [
              {
                "branchMatch": "string",
                "labelMatch": "string",
                "pathsDoNotExist": [
                  "string"
                ],
                "pathsExist": [
                  "string"
                ],
                "repositoryMatch": "string"
              }
            ],
            "gitea": {
              "allBranches": true,
              "api": "string",
              "excludeArchivedRepos": true,
              "insecure": true,
              "owner": "string"
            },
            "github": {
              "allBranches": true,
              "api": "string",
              "appSecretName": "string",
              "excludeArchivedRepos": true,
              "organization": "string"
            },
            "gitlab": {
              "allBranches": true,
              "api": "string",
              "group": "string",
              "includeArchivedRepos": true,
              "includeSharedProjects": true,
              "includeSubgroups": true,
              "insecure": true,
              "topic": "string"
            },
            "requeueAfterSeconds": 0,
            "values": {}
          },
          "selector": {
            "matchExpressions": [
              {
                "key": "string",
                "operator": "string",
                "values": [
                  "string"
                ]
              }
            ],
            "matchLabels": {}
          }
        }
      ],
      "goTemplate": true,
      "goTemplateOptions": [
        "string"
      ],
      "ignoreApplicationDifferences": [
        {
          "jqPathExpressions": [
            "string"
          ],
          "jsonPointers": [
            "string"
          ],
          "name": "string"
        }
      ],
      "preservedFields": {
        "annotations": [
          "string"
        ],
        "labels": [
          "string"
        ]
      },
      "strategy": {
        "deletionOrder": "string",
        "rollingSync": {
          "steps": [
            {
              "matchExpressions": [
                {
                  "key": "string",
                  "operator": "string",
                  "values": [
                    "string"
                  ]
                }
              ],
              "maxUpdate": {
                "intVal": 0,
                "strVal": "string",
                "type": 0
              }
            }
          ]
        },
        "type": "string"
      },
      "syncPolicy": {
        "applicationsSync": "string",
        "preserveResourcesOnDeletion": true
      },
      "template": {
        "metadata": {
          "annotations": {},
          "finalizers": [
            "string"
          ],
          "labels": {},
          "name": "string",
          "namespace": "string"
        },
        "spec": {
          "destination": {
            "name": "string",
            "namespace": "string",
            "server": "string"
          },
          "ignoreDifferences": [
            {
              "group": "string",
              "jqPathExpressions": [
                "string"
              ],
              "jsonPointers": [
                "string"
              ],
              "kind": "string",
              "managedFieldsManagers": [
                "string"
              ],
              "name": "string",
              "namespace": "string"
            }
          ],
          "info": [
            {
              "name": "string",
              "value": "string"
            }
          ],
          "project": "string",
          "revisionHistoryLimit": 0,
          "source": {
            "chart": "string",
            "directory": {
              "disableExtensionFilter": true,
              "exclude": "string",
              "include": "string",
              "jsonnet": {
                "extVars": [
                  {
                    "code": true,
                    "name": "string",
                    "value": "string"
                  }
                ],
                "libs": [
                  "string"
                ]
              },
              "recurse": true
            },
            "helm": {
              "apiVersions": [
                "string"
              ],
              "fileParameters": [
                {
                  "name": "string",
                  "path": "string"
                }
              ],
              "ignoreMissingValueFiles": true,
              "kubeVersion": "string",
              "namespace": "string",
              "parameters": [
                {
                  "forceString": true,
                  "name": "string",
                  "value": "string"
                }
              ],
              "passCredentials": true,
              "releaseName": "string",
              "skipCrds": true,
              "skipSchemaValidation": true,
              "skipTests": true,
              "valueFiles": [
                "string"
              ],
              "values": "string",
              "valuesObject": {
                "raw": "dGVzdA=="
              },
              "version": "string"
            },
            "kustomize": {
              "apiVersions": [
                "string"
              ],
              "commonAnnotations": {},
              "commonAnnotationsEnvsubst": true,
              "commonLabels": {},
              "components": [
                "string"
              ],
              "forceCommonAnnotations": true,
              "forceCommonLabels": true,
              "ignoreMissingComponents": true,
              "images": [
                "string"
              ],
              "kubeVersion": "string",
              "labelIncludeTemplates": true,
              "labelWithoutSelector": true,
              "namePrefix": "string",
              "nameSuffix": "string",
              "namespace": "string",
              "patches": [
                {
                  "options": {},
                  "patch": "string",
                  "path": "string",
                  "target": {
                    "annotationSelector": "string",
                    "labelSelector": "string",
                    "resId": {
                      "gvk": {
                        "group": "string",
                        "kind": "string",
                        "version": "string"
                      },
                      "name": "string",
                      "namespace": "string"
                    }
                  }
                }
              ],
              "replicas": [
                {
                  "name": "string"
                }
              ],
              "version": "string"
            },
            "name": "string",
            "path": "string",
            "plugin": {
              "env": [
                {
                  "name": "string",
                  "value": "string"
                }
              ],
              "name": "string",
              "parameters": [
                {
                  "array": [
                    "string"
                  ],
                  "map": {},
                  "name": "string",
                  "string": "string"
                }
              ]
            },
            "ref": "string",
            "repoURL": "string",
            "tagPrefix": "string",
            "targetRevision": "string"
          },
          "sourceHydrator": {
            "drySource": {
              "path": "string",
              "repoURL": "string",
              "targetRevision": "string"
            },
            "hydrateTo": {
              "targetBranch": "string"
            },
            "syncSource": {
              "path": "string",
              "repoURL": "string",
              "targetBranch": "string"
            }
          },
          "syncPolicy": {
            "automated": {
              "allowEmpty": true,
              "enabled": true,
              "prune": true,
              "selfHeal": true
            },
            "managedNamespaceMetadata": {
              "annotations": {},
              "labels": {}
            },
            "retry": {
              "backoff": {
                "duration": "string",
                "factor": 0,
                "maxDuration": "string"
              },
              "limit": 0,
              "refresh": true
            },
            "syncOptions": [
              "string"
            ]
          }
        }
      },
      "templatePatch": "string"
    },
    "status": {
      "applicationStatus": [
        {
          "application": "string",
          "lastTransitionTime": "2024-01-15T09:30:00Z",
          "message": "string",
          "status": "string",
          "step": "string",
          "targetrevisions": [
            "string"
          ]
        }
      ],
      "conditions": [
        {
          "lastTransitionTime": "2024-01-15T09:30:00Z",
          "message": "string",
          "reason": "string",
          "status": "string",
          "type": "string"
        }
      ],
      "health": {
        "lastTransitionTime": "2024-01-15T09:30:00Z",
        "message": "string",
        "status": "string"
      },
      "resources": [
        {
          "group": "string",
          "hook": true,
          "kind": "string",
          "name": "string",
          "namespace": "string",
          "requiresDeletionConfirmation": true,
          "requiresPruning": true,
          "status": "string",
          "syncWave": 0,
          "version": "string"
        }
      ],
      "resourcesCount": 0
    }
  }
}`;

const response = await fetch('https://argocd.example.com/api/v1/applicationsets/generate', {
  method: 'POST',
  headers: {
    'Authorization': 'YOUR_TOKEN',
    'Content-Type': 'application/json',
  },
  body,
});

const data = await response.text();
```

### Python

```python
import requests

body = '''{
  "applicationSet": {
    "metadata": {
      "annotations": {},
      "creationTimestamp": "2024-01-15T09:30:00Z",
      "deletionGracePeriodSeconds": 0,
      "deletionTimestamp": "2024-01-15T09:30:00Z",
      "finalizers": [
        "string"
      ],
      "generateName": "string",
      "generation": 0,
      "labels": {},
      "managedFields": [
        {
          "apiVersion": "string",
          "fieldsType": "string",
          "fieldsV1": {
            "Raw": "dGVzdA=="
          },
          "manager": "string",
          "operation": "string",
          "subresource": "string",
          "time": "2024-01-15T09:30:00Z"
        }
      ],
      "name": "string",
      "namespace": "string",
      "ownerReferences": [
        {
          "apiVersion": "string",
          "blockOwnerDeletion": true,
          "controller": true,
          "kind": "string",
          "name": "string",
          "uid": "string"
        }
      ],
      "resourceVersion": "string",
      "selfLink": "string",
      "uid": "string"
    },
    "spec": {
      "applyNestedSelectors": true,
      "generators": [
        {
          "clusterDecisionResource": {
            "configMapRef": "string",
            "name": "string",
            "requeueAfterSeconds": 0,
            "values": {}
          },
          "clusters": {
            "flatList": true,
            "values": {}
          },
          "git": {
            "directories": [
              {
                "exclude": true,
                "path": "string"
              }
            ],
            "files": [
              {
                "exclude": true,
                "path": "string"
              }
            ],
            "pathParamPrefix": "string",
            "repoURL": "string",
            "requeueAfterSeconds": 0,
            "revision": "string",
            "values": {}
          },
          "list": {
            "elements": [
              {
                "raw": "dGVzdA=="
              }
            ],
            "elementsYaml": "string"
          },
          "matrix": {
            "generators": [
              {}
            ]
          },
          "merge": {
            "mergeKeys": [
              "string"
            ]
          },
          "oci": {
            "directories": [
              {
                "exclude": true,
                "path": "string"
              }
            ],
            "files": [
              {
                "exclude": true,
                "path": "string"
              }
            ],
            "pathParamPrefix": "string",
            "repoURL": "string",
            "requeueAfterSeconds": 0,
            "revision": "string",
            "values": {}
          },
          "plugin": {
            "configMapRef": {
              "name": "string"
            },
            "input": {
              "parameters": {}
            },
            "requeueAfterSeconds": 0,
            "values": {}
          },
          "pullRequest": {
            "azuredevops": {
              "api": "string",
              "labels": [
                "string"
              ],
              "organization": "string",
              "project": "string",
              "repo": "string",
              "tokenRef": {
                "key": "string",
                "secretName": "string"
              }
            },
            "bitbucket": {
              "api": "string",
              "basicAuth": {
                "username": "string"
              },
              "bearerToken": {},
              "owner": "string",
              "repo": "string"
            },
            "bitbucketServer": {
              "api": "string",
              "bearerToken": {},
              "caRef": {
                "configMapName": "string",
                "key": "string"
              },
              "insecure": true,
              "project": "string",
              "repo": "string"
            },
            "continueOnRepoNotFoundError": true,
            "filters": [
              {
                "branchMatch": "string",
                "targetBranchMatch": "string",
                "titleMatch": "string"
              }
            ],
            "gitea": {
              "api": "string",
              "insecure": true,
              "labels": [
                "string"
              ],
              "owner": "string",
              "repo": "string"
            },
            "github": {
              "api": "string",
              "appSecretName": "string",
              "labels": [
                "string"
              ],
              "owner": "string",
              "repo": "string"
            },
            "gitlab": {
              "api": "string",
              "insecure": true,
              "labels": [
                "string"
              ],
              "project": "string",
              "pullRequestState": "string"
            },
            "requeueAfterSeconds": 0,
            "values": {}
          },
          "scmProvider": {
            "awsCodeCommit": {
              "allBranches": true,
              "region": "string",
              "role": "string",
              "tagFilters": [
                {
                  "key": "string",
                  "value": "string"
                }
              ]
            },
            "azureDevOps": {
              "allBranches": true,
              "api": "string",
              "organization": "string",
              "teamProject": "string"
            },
            "bitbucket": {
              "allBranches": true,
              "owner": "string",
              "user": "string"
            },
            "bitbucketServer": {
              "allBranches": true,
              "api": "string",
              "insecure": true,
              "project": "string"
            },
            "cloneProtocol": "string",
            "filters": [
              {
                "branchMatch": "string",
                "labelMatch": "string",
                "pathsDoNotExist": [
                  "string"
                ],
                "pathsExist": [
                  "string"
                ],
                "repositoryMatch": "string"
              }
            ],
            "gitea": {
              "allBranches": true,
              "api": "string",
              "excludeArchivedRepos": true,
              "insecure": true,
              "owner": "string"
            },
            "github": {
              "allBranches": true,
              "api": "string",
              "appSecretName": "string",
              "excludeArchivedRepos": true,
              "organization": "string"
            },
            "gitlab": {
              "allBranches": true,
              "api": "string",
              "group": "string",
              "includeArchivedRepos": true,
              "includeSharedProjects": true,
              "includeSubgroups": true,
              "insecure": true,
              "topic": "string"
            },
            "requeueAfterSeconds": 0,
            "values": {}
          },
          "selector": {
            "matchExpressions": [
              {
                "key": "string",
                "operator": "string",
                "values": [
                  "string"
                ]
              }
            ],
            "matchLabels": {}
          }
        }
      ],
      "goTemplate": true,
      "goTemplateOptions": [
        "string"
      ],
      "ignoreApplicationDifferences": [
        {
          "jqPathExpressions": [
            "string"
          ],
          "jsonPointers": [
            "string"
          ],
          "name": "string"
        }
      ],
      "preservedFields": {
        "annotations": [
          "string"
        ],
        "labels": [
          "string"
        ]
      },
      "strategy": {
        "deletionOrder": "string",
        "rollingSync": {
          "steps": [
            {
              "matchExpressions": [
                {
                  "key": "string",
                  "operator": "string",
                  "values": [
                    "string"
                  ]
                }
              ],
              "maxUpdate": {
                "intVal": 0,
                "strVal": "string",
                "type": 0
              }
            }
          ]
        },
        "type": "string"
      },
      "syncPolicy": {
        "applicationsSync": "string",
        "preserveResourcesOnDeletion": true
      },
      "template": {
        "metadata": {
          "annotations": {},
          "finalizers": [
            "string"
          ],
          "labels": {},
          "name": "string",
          "namespace": "string"
        },
        "spec": {
          "destination": {
            "name": "string",
            "namespace": "string",
            "server": "string"
          },
          "ignoreDifferences": [
            {
              "group": "string",
              "jqPathExpressions": [
                "string"
              ],
              "jsonPointers": [
                "string"
              ],
              "kind": "string",
              "managedFieldsManagers": [
                "string"
              ],
              "name": "string",
              "namespace": "string"
            }
          ],
          "info": [
            {
              "name": "string",
              "value": "string"
            }
          ],
          "project": "string",
          "revisionHistoryLimit": 0,
          "source": {
            "chart": "string",
            "directory": {
              "disableExtensionFilter": true,
              "exclude": "string",
              "include": "string",
              "jsonnet": {
                "extVars": [
                  {
                    "code": true,
                    "name": "string",
                    "value": "string"
                  }
                ],
                "libs": [
                  "string"
                ]
              },
              "recurse": true
            },
            "helm": {
              "apiVersions": [
                "string"
              ],
              "fileParameters": [
                {
                  "name": "string",
                  "path": "string"
                }
              ],
              "ignoreMissingValueFiles": true,
              "kubeVersion": "string",
              "namespace": "string",
              "parameters": [
                {
                  "forceString": true,
                  "name": "string",
                  "value": "string"
                }
              ],
              "passCredentials": true,
              "releaseName": "string",
              "skipCrds": true,
              "skipSchemaValidation": true,
              "skipTests": true,
              "valueFiles": [
                "string"
              ],
              "values": "string",
              "valuesObject": {
                "raw": "dGVzdA=="
              },
              "version": "string"
            },
            "kustomize": {
              "apiVersions": [
                "string"
              ],
              "commonAnnotations": {},
              "commonAnnotationsEnvsubst": true,
              "commonLabels": {},
              "components": [
                "string"
              ],
              "forceCommonAnnotations": true,
              "forceCommonLabels": true,
              "ignoreMissingComponents": true,
              "images": [
                "string"
              ],
              "kubeVersion": "string",
              "labelIncludeTemplates": true,
              "labelWithoutSelector": true,
              "namePrefix": "string",
              "nameSuffix": "string",
              "namespace": "string",
              "patches": [
                {
                  "options": {},
                  "patch": "string",
                  "path": "string",
                  "target": {
                    "annotationSelector": "string",
                    "labelSelector": "string",
                    "resId": {
                      "gvk": {
                        "group": "string",
                        "kind": "string",
                        "version": "string"
                      },
                      "name": "string",
                      "namespace": "string"
                    }
                  }
                }
              ],
              "replicas": [
                {
                  "name": "string"
                }
              ],
              "version": "string"
            },
            "name": "string",
            "path": "string",
            "plugin": {
              "env": [
                {
                  "name": "string",
                  "value": "string"
                }
              ],
              "name": "string",
              "parameters": [
                {
                  "array": [
                    "string"
                  ],
                  "map": {},
                  "name": "string",
                  "string": "string"
                }
              ]
            },
            "ref": "string",
            "repoURL": "string",
            "tagPrefix": "string",
            "targetRevision": "string"
          },
          "sourceHydrator": {
            "drySource": {
              "path": "string",
              "repoURL": "string",
              "targetRevision": "string"
            },
            "hydrateTo": {
              "targetBranch": "string"
            },
            "syncSource": {
              "path": "string",
              "repoURL": "string",
              "targetBranch": "string"
            }
          },
          "syncPolicy": {
            "automated": {
              "allowEmpty": true,
              "enabled": true,
              "prune": true,
              "selfHeal": true
            },
            "managedNamespaceMetadata": {
              "annotations": {},
              "labels": {}
            },
            "retry": {
              "backoff": {
                "duration": "string",
                "factor": 0,
                "maxDuration": "string"
              },
              "limit": 0,
              "refresh": true
            },
            "syncOptions": [
              "string"
            ]
          }
        }
      },
      "templatePatch": "string"
    },
    "status": {
      "applicationStatus": [
        {
          "application": "string",
          "lastTransitionTime": "2024-01-15T09:30:00Z",
          "message": "string",
          "status": "string",
          "step": "string",
          "targetrevisions": [
            "string"
          ]
        }
      ],
      "conditions": [
        {
          "lastTransitionTime": "2024-01-15T09:30:00Z",
          "message": "string",
          "reason": "string",
          "status": "string",
          "type": "string"
        }
      ],
      "health": {
        "lastTransitionTime": "2024-01-15T09:30:00Z",
        "message": "string",
        "status": "string"
      },
      "resources": [
        {
          "group": "string",
          "hook": true,
          "kind": "string",
          "name": "string",
          "namespace": "string",
          "requiresDeletionConfirmation": true,
          "requiresPruning": true,
          "status": "string",
          "syncWave": 0,
          "version": "string"
        }
      ],
      "resourcesCount": 0
    }
  }
}'''

response = requests.post(
    'https://argocd.example.com/api/v1/applicationsets/generate',
    data=body.encode('utf-8'),
    headers={
        'Authorization': 'YOUR_TOKEN',
        'Content-Type': 'application/json',
    },
)
print(response.text)
```
