primeflow

Create or update retry policy

API endpoint: Create or update retry policy

POST
/v1/policies/retry

Authorization

X-Reevit-Key<token>

API key for server-to-server authentication

In: header

Request Body

application/jsonRequired
plan_idstring

Plan ID (empty for org-wide default)

delaysRequiredarray<string>

Array of delay durations (e.g., ["15m", "1h", "24h"])

max_retriesinteger

Maximum number of retries (defaults to len(delays))

Header Parameters

X-Org-IdRequiredstring

Organization identifier for multi-tenancy

Idempotency-Keystring

Idempotency key for safe retries

Response Body

OK

TypeScript Definitions

Use the response body type in TypeScript.

org_idstring
plan_idstring
delaysarray<string>

Array of delay durations (e.g., ["15m", "1h", "24h"])

max_retriesinteger
created_atstring
Format: "date-time"
updated_atstring
Format: "date-time"

Bad Request

TypeScript Definitions

Use the response body type in TypeScript.

errorRequiredstring

Error type/category

codeRequiredstring

Machine-readable error code

messageRequiredstring

Human-readable error message

detailsobject

Optional field-level error details

Internal Server Error

TypeScript Definitions

Use the response body type in TypeScript.

errorRequiredstring

Error type/category

codeRequiredstring

Machine-readable error code

messageRequiredstring

Human-readable error message

detailsobject

Optional field-level error details

curl -X POST "http://localhost:8081/v1/policies/retry" \
  -H "X-Org-Id: string" \
  -H "Idempotency-Key: string" \
  -H "X-Reevit-Key: <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "plan_id": "string",
    "delays": [
      "string"
    ],
    "max_retries": 0
  }'
const body = JSON.stringify({
  "plan_id": "string",
  "delays": [
    "string"
  ],
  "max_retries": 0
})

fetch("http://localhost:8081/v1/policies/retry", {
  headers: {
    "X-Org-Id": "string",
    "Idempotency-Key": "string",
    "X-Reevit-Key": "<token>"
  },
  body
})
package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
  "strings"
)

func main() {
  url := "http://localhost:8081/v1/policies/retry"
  body := strings.NewReader(`{
    "plan_id": "string",
    "delays": [
      "string"
    ],
    "max_retries": 0
  }`)
  req, _ := http.NewRequest("POST", url, body)
  req.Header.Add("X-Org-Id", "string")
  req.Header.Add("Idempotency-Key", "string")
  req.Header.Add("X-Reevit-Key", "<token>")
  req.Header.Add("Content-Type", "application/json")
  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))
}
import requests

url = "http://localhost:8081/v1/policies/retry"
body = {
  "plan_id": "string",
  "delays": [
    "string"
  ],
  "max_retries": 0
}
response = requests.request("POST", url, json = body, headers = {
  "X-Org-Id": "string",
  "Idempotency-Key": "string",
  "X-Reevit-Key": "<token>",
  "Content-Type": "application/json"
})

print(response.text)
{
  "org_id": "string",
  "plan_id": "string",
  "delays": [
    "string"
  ],
  "max_retries": 0,
  "created_at": "2019-08-24T14:15:22Z",
  "updated_at": "2019-08-24T14:15:22Z"
}
{
  "error": "invalid_request",
  "code": "email_required",
  "message": "email is required",
  "details": {
    "metric": "workflow_executions",
    "used": "2000",
    "limit": "2000",
    "reset": "2025-01-01T00:00:00Z"
  }
}
{
  "error": "invalid_request",
  "code": "email_required",
  "message": "email is required",
  "details": {
    "metric": "workflow_executions",
    "used": "2000",
    "limit": "2000",
    "reset": "2025-01-01T00:00:00Z"
  }
}