import requests
url = "https://{FUSION HOST}/api/spark/configurations"
payload = {
"id": "my-python-job",
"script": "/compare_fusion_apis.py",
"type": "custom_python_job"
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"type": "custom_python_job",
"id": "my-python-job",
"script": "/compare_fusion_apis.py",
"verboseReporting": true,
"updates": [
{
"userId": "demo-user",
"timestamp": "2025-12-03T22:06:22.179510861Z"
}
]
}Create a new job
Create a new job configuration. Use the /spark/schema endpoint to get the configuration schema.
import requests
url = "https://{FUSION HOST}/api/spark/configurations"
payload = {
"id": "my-python-job",
"script": "/compare_fusion_apis.py",
"type": "custom_python_job"
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"type": "custom_python_job",
"id": "my-python-job",
"script": "/compare_fusion_apis.py",
"verboseReporting": true,
"updates": [
{
"userId": "demo-user",
"timestamp": "2025-12-03T22:06:22.179510861Z"
}
]
}Authorizations
Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Query Parameters
The app to which this job belongs.
Body
The job's configuration details.
The name of the job configuration.
"scripted_job_example"
The job's configuration details. The configuration keys depend on the type of job. Use /spark/schema to see the configuration schemas for all job types.
{
"spark.cores.max": 2,
"spark.executor.memory": "1g"
}The job type.
Response
OK
The job's configuration details.
The name of the job configuration.
"scripted_job_example"
The job's configuration details. The configuration keys depend on the type of job. Use /spark/schema to see the configuration schemas for all job types.
{
"spark.cores.max": 2,
"spark.executor.memory": "1g"
}The job type.
Was this page helpful?