curl --request GET \
--url https://api.goyappr.com/agents/{id}/workflow/versions \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.goyappr.com/agents/{id}/workflow/versions"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.goyappr.com/agents/{id}/workflow/versions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.goyappr.com/agents/{id}/workflow/versions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.goyappr.com/agents/{id}/workflow/versions"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.goyappr.com/agents/{id}/workflow/versions")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.goyappr.com/agents/{id}/workflow/versions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"next_cursor": 123,
"data": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"version": 2,
"content_hash": "<string>",
"published_at": "2023-11-07T05:31:56Z",
"environment": "local",
"draft_version": 2,
"compiler_version": "<string>",
"source": "teach",
"source_run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"restored_from_version": 2
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}List workflow versions
Page through immutable publication summaries.
curl --request GET \
--url https://api.goyappr.com/agents/{id}/workflow/versions \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.goyappr.com/agents/{id}/workflow/versions"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.goyappr.com/agents/{id}/workflow/versions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.goyappr.com/agents/{id}/workflow/versions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.goyappr.com/agents/{id}/workflow/versions"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.goyappr.com/agents/{id}/workflow/versions")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.goyappr.com/agents/{id}/workflow/versions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"next_cursor": 123,
"data": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"version": 2,
"content_hash": "<string>",
"published_at": "2023-11-07T05:31:56Z",
"environment": "local",
"draft_version": 2,
"compiler_version": "<string>",
"source": "teach",
"source_run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"restored_from_version": 2
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}agents:read. This is publication history, not call execution history.
curl 'https://api.goyappr.com/agents/AGENT_ID/workflow/versions?limit=20' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'x-company-id: COMPANY_ID'
limit outside 1–100 is refused, not clamped, and so is a cursor that is
not a version number: 400 WORKFLOW_REQUEST_INVALID, with the parameter in
issues[0].path and what it takes in error.
The response has data and nullable next_cursor. Summaries are newest first
and contain id, version, draft_version, content_hash, compiler_version,
environment, published_at and three fields that say how the version came to
be: source, source_run_id and restored_from_version. This read does not
restore a draft, republish a version or grant access to a run journal.
Where a version came from
What environment says, and what it does not
environment is the deployment plane that compiled and stored the revision:
production, testing or local. It is not a rehearsal flag, not a sandbox
switch and not something you send — there is no field for it on
Publish workflow, and no query parameter
selects one.
It is decided by the deployment you are talking to. Every Yappr deployment is
configured with exactly one plane, and everything published through it is stored
on that plane. The hosted API you are reading about publishes as testing.
That is the deployment’s own configuration, not a property of your agent and not
something gone wrong: testing here names the plane, not a lesser copy of your
workflow. A self-hosted or on-premise deployment configured as production
stores its versions as production, and nothing else about publishing differs.
What the dashboard calls it
The dashboard labels a plane by what it means for your callers, and keeps the API value off the screen:environment | Dashboard label |
|---|---|
testing | Live |
production | Live |
local | Local |
"version": 3, "environment": "testing"
here describe the same published version. In the dashboard’s version list only
the version callers reach now is marked live now; an older row shows its number
and when it was published.
How a call finds the version to run
A call runs on the plane of the deployment that admitted it, and it loads the agent’s published version only if that version was stored on the same plane. That is why you do not have to think about this. Publish through this API and place the call through this API —POST /calls,
POST /call-requests, a phone number, a
shared link — and both are the same
deployment, so both are the same plane. The version you publish is the version
your next call runs.
The two can only come apart if a version was published through a different
deployment than the one placing the call — moving a workspace between
deployments, or an on-premise stack pointed at a hosted one. Publishing is not
plane-scoped, so such a version still becomes the agent’s published version, and
a call then finds nothing to run however active the agent is: the request ends
failed with error_code: "artifact_unavailable" (see
Read a call request). The fix is one call —
publish the draft again through the deployment that will place the call, and the
new version is stored on its plane.
The same code also answers a call whose channel the published version does not
list in its channels — see Which ways in the agent allows.
The other conditions on being callable are unchanged: the agent must be active
and have a published version. See
Place a call.
Reading it
Publish workflow returnsenvironment on
the revision it creates, so you can record the plane at publish time without a
second request. It is also on every row here.
Every version of the agent is listed whatever plane published it, so this is
also the only field on which two of one agent’s versions can differ without the
document differing. Tell versions apart by version, content_hash and
published_at.Authorizations
Your Yappr API key (e.g. ypr_live_...). Generate one in the dashboard under Settings → API Keys. No key is 401 MISSING_KEY; a key that is not one of ours, or is revoked, is 401 INVALID_KEY; an expired one is 401 EXPIRED_KEY. A valid key without the scope an operation needs is 403 INSUFFICIENT_SCOPE on every operation, and the message names the scope. Every response, a 401 included, carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset: the budget is 60 requests a minute per API key. Every 429, whatever its code, carries Retry-After (whole seconds, never zero): the per-key budget's RATE_LIMIT asks for what is left of the minute, a route's daily cap (RATE_LIMITED) for the time until that cap resets. All four headers are listed in Access-Control-Expose-Headers, so a browser can read them. A path the API does not serve (an unknown sub-path, an id left empty) is 404 ROUTE_NOT_FOUND, and a method a served path does not take is 405 METHOD_NOT_ALLOWED with an Allow header; both are answered before any scope check, and nothing is read or changed. A trailing slash is ignored where it cannot be an id left empty (POST /calls/ is POST /calls) and refused where it can (GET /calls/). A doubled slash inside a path is merged into one before the request reaches the API (GET //calls is GET /calls).