Update redirect URLs on an active setup link
package main
import ( "fmt" "strings" "net/http" "io")
func main() {
url := "https://api.kirimdev.com/v1/customers/example/setup_links/example"
payload := strings.NewReader("{ \"success_redirect_url\": \"https://example.com\", \"failure_redirect_url\": \"https://example.com\" }")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>") req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close() body, _ := io.ReadAll(res.Body)
fmt.Println(res) fmt.Println(string(body))
}const url = 'https://api.kirimdev.com/v1/customers/example/setup_links/example';const options = { method: 'PATCH', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"success_redirect_url":"https://example.com","failure_redirect_url":"https://example.com"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}use std::str::FromStr;use serde_json::json;use reqwest;
#[tokio::main]pub async fn main() { let url = "https://api.kirimdev.com/v1/customers/example/setup_links/example";
let payload = json!({ "success_redirect_url": "https://example.com", "failure_redirect_url": "https://example.com" });
let mut headers = reqwest::header::HeaderMap::new(); headers.insert("Authorization", "Bearer <token>".parse().unwrap()); headers.insert("Content-Type", "application/json".parse().unwrap());
let client = reqwest::Client::new(); let response = client.request(reqwest::Method::from_str("PATCH").unwrap(), url) .headers(headers) .json(&payload) .send() .await;
let results = response.unwrap() .json::<serde_json::Value>() .await .unwrap();
dbg!(results);}curl --request PATCH \ --url https://api.kirimdev.com/v1/customers/example/setup_links/example \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "success_redirect_url": "https://example.com", "failure_redirect_url": "https://example.com" }'Recover from a typo in success_redirect_url / failure_redirect_url without revoking and regenerating the link. Only works while status = active; pass null to clear a redirect.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”Request Body
Section titled “Request Body ”Responses
Section titled “ Responses ”Updated setup link
object
object
Where the tenant is redirected after successful Embedded Signup. We append ?customer_id=&account_id=&status=success on the redirect.
Where the tenant is redirected on failure (link error, Meta signup cancelled, etc.). We append ?customer_id=&status=failed&reason=<code>.
Example
{ "data": { "id": "csl_01HXYZABCDEFGHJKMNPQRSTVWX", "object": "customer_setup_link", "status": "active" }}Validation failure
object
object
Example
{ "error": { "type": "invalid_request_error", "code": "invalid_phone_number", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }}Authentication failure
object
object
Example
{ "error": { "type": "invalid_request_error", "code": "invalid_phone_number", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }}Billing / entitlement gate — subscription inactive, quota exceeded, or plan tier missing a feature (feature_not_entitled). Upgrade to continue.
object
object
Example
{ "error": { "type": "invalid_request_error", "code": "invalid_phone_number", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }}Resource not found
object
object
Example
{ "error": { "type": "invalid_request_error", "code": "invalid_phone_number", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }}Conflict (e.g. template already exists, webhook subscription disabled, setup link inactive)
object
object
Example
{ "error": { "type": "invalid_request_error", "code": "invalid_phone_number", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }}Rate limit exceeded
object
object
Example
{ "error": { "type": "invalid_request_error", "code": "invalid_phone_number", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }}Internal server error
object
object
Example
{ "error": { "type": "invalid_request_error", "code": "invalid_phone_number", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }}