Skip to content
Customers

Update redirect URLs on an active setup link

PATCH
/customers/{id}/setup_links/{link_id}
const url = 'https://api.kirimdev.com/v1/customers/cus_01HXYZABCDEFGHJKMNPQRSTVWX/setup_links/csl_01HXYZABCDEFGHJKMNPQRSTVWX';
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);
}

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.

id
required

Public Kirimdev end-customer ID.

string
/^cus_[0-9A-HJKMNP-TV-Z]{26}$/
Example
cus_01HXYZABCDEFGHJKMNPQRSTVWX

Public Kirimdev end-customer ID.

link_id
required

Public setup-link ID belonging to this customer.

string
/^csl_[0-9A-HJKMNP-TV-Z]{26}$/
Example
csl_01HXYZABCDEFGHJKMNPQRSTVWX

Public setup-link ID belonging to this customer.

Media type application/json
object
success_redirect_url
Any of:
string format: uri
<= 2048 characters
failure_redirect_url
Any of:
string format: uri
<= 2048 characters
Example generated
{
"success_redirect_url": "https://example.com",
"failure_redirect_url": "https://example.com"
}

Updated setup link

Media type application/json
object
data
required
object
id
required
string
object
required
string
Allowed values: customer_setup_link
customer_id
required
string
status
required
string
Allowed values: active consumed expired revoked
token_last4
required
string
expires_at
required
string format: date-time
consumed_at
required
string | null format: date-time
success_redirect_url
required

Where the tenant is redirected after successful Embedded Signup. We append ?customer_id=&account_id=&status=success on the redirect.

string | null format: uri
failure_redirect_url
required

Where the tenant is redirected on failure (link error, Meta signup cancelled, etc.). We append ?customer_id=&status=failed&reason=<code>.

string | null format: uri
created_at
required
string format: date-time
request_id
required

Unique request identifier to include when contacting support.

string
Example
{
"data": {
"id": "csl_01HXYZABCDEFGHJKMNPQRSTVWX",
"object": "customer_setup_link",
"status": "active"
},
"request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX"
}

Validation failure

Media type application/json
object
error
required
object
type
required
string
Allowed values: invalid_request_error authentication_error permission_error not_found conflict rate_limit_error api_error
code
required
string
message
required

Human-readable explanation of the error.

string
param

Request field associated with the error, when applicable.

string
request_id
required

Unique request identifier to include when contacting support.

string
Examples
Example default

A field value is invalid.

{
"error": {
"type": "invalid_request_error",
"code": "invalid_field_value",
"message": "A field value is invalid.",
"request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX"
}
}

Authentication failure

Media type application/json
object
error
required
object
type
required
string
Allowed values: invalid_request_error authentication_error permission_error not_found conflict rate_limit_error api_error
code
required
string
message
required

Human-readable explanation of the error.

string
param

Request field associated with the error, when applicable.

string
request_id
required

Unique request identifier to include when contacting support.

string
Examples
Example default

The provided API key is invalid.

{
"error": {
"type": "authentication_error",
"code": "invalid_api_key",
"message": "The provided API key is invalid.",
"request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX"
}
}

Billing / entitlement gate — subscription inactive, quota exceeded, or plan tier missing a feature (feature_not_entitled). Upgrade to continue.

Media type application/json
object
error
required
object
type
required
string
Allowed values: invalid_request_error authentication_error permission_error not_found conflict rate_limit_error api_error
code
required
string
message
required

Human-readable explanation of the error.

string
param

Request field associated with the error, when applicable.

string
request_id
required

Unique request identifier to include when contacting support.

string
Examples
Example default

Your trial has ended or subscription is inactive. Upgrade to continue.

{
"error": {
"type": "permission_error",
"code": "subscription_inactive",
"message": "Your trial has ended or subscription is inactive. Upgrade to continue.",
"request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX"
}
}

Resource not found

Media type application/json
object
error
required
object
type
required
string
Allowed values: invalid_request_error authentication_error permission_error not_found conflict rate_limit_error api_error
code
required
string
message
required

Human-readable explanation of the error.

string
param

Request field associated with the error, when applicable.

string
request_id
required

Unique request identifier to include when contacting support.

string
Examples
Example default

Resource not found.

{
"error": {
"type": "not_found",
"code": "resource_not_found",
"message": "Resource not found.",
"request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX"
}
}

Conflict (e.g. template already exists, webhook subscription disabled, setup link inactive)

Media type application/json
object
error
required
object
type
required
string
Allowed values: invalid_request_error authentication_error permission_error not_found conflict rate_limit_error api_error
code
required
string
message
required

Human-readable explanation of the error.

string
param

Request field associated with the error, when applicable.

string
request_id
required

Unique request identifier to include when contacting support.

string
Examples
Example default

Setup link is no longer active and cannot be modified.

{
"error": {
"type": "conflict",
"code": "setup_link_inactive",
"message": "Setup link is no longer active and cannot be modified.",
"request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX"
}
}

Rate limit exceeded

Media type application/json
object
error
required
object
type
required
string
Allowed values: invalid_request_error authentication_error permission_error not_found conflict rate_limit_error api_error
code
required
string
message
required

Human-readable explanation of the error.

string
param

Request field associated with the error, when applicable.

string
request_id
required

Unique request identifier to include when contacting support.

string
Examples
Example default

Rate limit exceeded.

{
"error": {
"type": "rate_limit_error",
"code": "rate_limit_exceeded",
"message": "Rate limit exceeded.",
"request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX"
}
}

Internal server error

Media type application/json
object
error
required
object
type
required
string
Allowed values: invalid_request_error authentication_error permission_error not_found conflict rate_limit_error api_error
code
required
string
message
required

Human-readable explanation of the error.

string
param

Request field associated with the error, when applicable.

string
request_id
required

Unique request identifier to include when contacting support.

string
Examples
Example default

An unexpected error occurred.

{
"error": {
"type": "api_error",
"code": "internal_error",
"message": "An unexpected error occurred.",
"request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX"
}
}