POST
/
v2
/
push
curl --request POST \
  --url https://mango.sievedata.com/v2/push \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '{
  "function": "sieve/retalker",
  "id": "43d7add5-61cf-44ad-aac8-c5d14c642bb4",
  "inputs": {
    "input1": "a",
    "input2": "b"
  },
  "webhooks": [
    {
      "type": "job.start",
      "url": "<string>"
    }
  ],
  "env": {
    "OPENAI_API_KEY": "..."
  }
}'
{
  "id": "<string>",
  "run_id": "<string>",
  "stream_output": true,
  "status": "<string>",
  "organization_id": "<string>",
  "model_id": "<string>",
  "workflow_id": "<string>"
}

This endpoint triggers either a function or a model with a given set of inputs. The structure of the inputs should match the inputs types specified in the function or model definition.

Example

A function that takes in a sieve.Video named video and a sieve.Image named image would be triggered with the following request:

{
  "function": "sieve/sample_function",
  "inputs": {
    "video": {
      "url": "{SOME_VIDEO_URL}"
    },
    "image": {
      "url": "{SOME_IMAGE_URL}"
    }
  }
}

A function that takes in a string named prompt would be triggered with the following request:

{
  "function": "sieve/some_function",
  "inputs": {
    "prompt": "some string"
  }
}

Webhooks

Webhooks provide a way for notifications to be delivered to an external web server when various events related Sieve jobs occur.

The following is a full list of all webhook event types.

EventDescription
job.startOccurs when a job starts.
job.completeOccurs when a job completes.
job.complete.no_outputOccurs when a job completes — excludes the output payload from the response.
job.new_outputOccurs when a job produces a new output.

Authorizations

X-API-Key
string
headerrequired

The Sieve API key to authenticate with.

Body

application/json
function
string | null

The name of the function, in the format of author/name[:version]. Either function or id may be specified, but not both.

id
string | null

The ID of the function to be called.

inputs
required

The inputs to the job — read more about inputs here.

webhooks
object[] | null

Webhooks — see more info here.

env
object | null

Environment variables for the given job.

Response

200 - application/json
id
string
required

The ID of the job.

run_id
string
required

Internal metadata.

stream_output
boolean
required

Whether the output will be streamed.

status
string
required

The status of the job. Possible values: 'queued', 'processing', 'error', 'finished', 'cancelled'

organization_id
string
required

The ID of the organization.

model_id
string
required

The ID of the model.

workflow_id
string | null
required

The ID of the workflow.