Create a Job
POST/api/workspaces/:workspace_id/entities/:id/jobs/
Creates a Job. For the simplest computation flow, set poll_result=false
or do not include it in the payload.
This will ensure that the end-point always responds with:
- 201: job is still running, start polling on the
/jobs/UID/
end-point, provided under "url" key. (see Jobs end-points)
Setting poll_result=true
is only useful for very quick jobs, since the BE polls checks internally for job
completion for a short period before responding with either:
- 200: job returned with full response.
- 201: job is still running, start polling on the
/jobs/UID/
end-point, provided under "url" key. (see Jobs end-points)
Request
Path Parameters
A unique integer value identifying this entity.
- application/json
Body
required
Let the endpoint temporarily poll for the result.
Possible values: non-empty
Name to the method to run the App Job.
Possible values: non-empty
Type to the method to run the App Job.
UUID of the current editor session. This field is required when called under public endpoints.
Default value: [object Object]
(Optional) params as input for App Job.
Default value: ``
(Optional) events as input for App Job.
Possible values: >= 1
and <= 86400
Default value: 86400
(Optional) max job duration as input for App Job.
Default value: [object Object]
(deprecated) replaced with params
.
Possible values: non-empty
(deprecated) replaced with method_name
.
Responses
- 200
- 201
- 400
- 401
- 403
- application/json
- Schema
- Example (from schema)
Schema
The uid of the AppJob.
Possible values: non-empty
Progress message when app runner is still processing the job.
Possible values: non-empty
The result payload kind.
Possible values: non-empty
Status of the AppJob. 'success' | 'error' | 'error_user' | 'stopped' | 'message'.
Possible values: non-empty
If error is raised, the error message returned.
If error is raised, the stack trace is returned.
Any invalid fields that were found during the Job.
The actual result content.
{
"uid": 0,
"message": "string",
"kind": "string",
"status": "string",
"error_message": "string",
"error_stack_trace": {},
"invalid_fields": {},
"content": {}
}
- application/json
- Schema
- Example (from schema)
Schema
The uid of the AppJob.
Possible values: non-empty
The URL to the location of the AppJob.
{
"uid": 0,
"url": "string"
}
Validation error response.
It produces a validation error schema like below.
{
"field1": ["Validation error"],
"non_field_errors": ["Sample non field validation error"]
}
No authentication found or authentication is not correct.
Specified path is not allowed
Permission evaluation:
((Is Authenticated Organization Admin OR Workspace Context Permission) OR Public Permission) AND Is Not App
Descriptions:
Is Authenticated Organization Admin
: User must be an Organization Admin.
Public Permission
: Checks corresponding workspace is public.
Workspace Context Permission
: Workspace must be available to the User.
Is Not App
: Client must not be a VIKTOR app.