Restore a phase
curl --request DELETE \
--url https://app.pepline.ai/api/v1/agents/{agent_slug}/flow/states/{id}/archive \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.pepline.ai/api/v1/agents/{agent_slug}/flow/states/{id}/archive"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.pepline.ai/api/v1/agents/{agent_slug}/flow/states/{id}/archive', 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://app.pepline.ai/api/v1/agents/{agent_slug}/flow/states/{id}/archive",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
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://app.pepline.ai/api/v1/agents/{agent_slug}/flow/states/{id}/archive"
req, _ := http.NewRequest("DELETE", 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.delete("https://app.pepline.ai/api/v1/agents/{agent_slug}/flow/states/{id}/archive")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.pepline.ai/api/v1/agents/{agent_slug}/flow/states/{id}/archive")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"object": "<string>",
"id": 123,
"key": "<string>",
"title": "<string>",
"position": 123,
"objective": "<string>",
"exit_criteria": "<string>",
"max_turns": 123,
"archived": true,
"slots": [
{
"object": "<string>",
"id": 123,
"key": "<string>",
"title": "<string>",
"archived": true,
"required": true,
"enum_values": [
"<string>"
],
"enum_labels": {},
"translations": {},
"description": "<string>"
}
],
"tools": [
"<string>"
]
}{
"error": {
"message": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"param": "<string>"
}
}Flow
Restore a phase
DELETE
/
agents
/
{agent_slug}
/
flow
/
states
/
{id}
/
archive
Restore a phase
curl --request DELETE \
--url https://app.pepline.ai/api/v1/agents/{agent_slug}/flow/states/{id}/archive \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.pepline.ai/api/v1/agents/{agent_slug}/flow/states/{id}/archive"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.pepline.ai/api/v1/agents/{agent_slug}/flow/states/{id}/archive', 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://app.pepline.ai/api/v1/agents/{agent_slug}/flow/states/{id}/archive",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
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://app.pepline.ai/api/v1/agents/{agent_slug}/flow/states/{id}/archive"
req, _ := http.NewRequest("DELETE", 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.delete("https://app.pepline.ai/api/v1/agents/{agent_slug}/flow/states/{id}/archive")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.pepline.ai/api/v1/agents/{agent_slug}/flow/states/{id}/archive")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"object": "<string>",
"id": 123,
"key": "<string>",
"title": "<string>",
"position": 123,
"objective": "<string>",
"exit_criteria": "<string>",
"max_turns": 123,
"archived": true,
"slots": [
{
"object": "<string>",
"id": 123,
"key": "<string>",
"title": "<string>",
"archived": true,
"required": true,
"enum_values": [
"<string>"
],
"enum_labels": {},
"translations": {},
"description": "<string>"
}
],
"tools": [
"<string>"
]
}{
"error": {
"message": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"param": "<string>"
}
}Authorizations
Your secret key (pep_sk_…) from Settings → API. Keys are org-scoped; treat them like passwords.
Response
The restored phase.
Allowed value:
"flow_state"Available options:
step, loop, terminal Show child attributes
Show child attributes
⌘I

