Describe the current host
GET
https://referalli.com /v1/hosts/current What the request's host is: a merchant's verified portal domain (with the org's name, branding and public programs), a merchant link domain, or Referalli's own app. Used by the web app before anyone signs in.
Auth: none.
Parameters
themePreviewstring
query
Code samples
cURL
curl -X GET "https://referalli.com/v1/hosts/current"TypeScript
Python
Go
PHP
Ruby
Java
Responses
200 OK
Example
{
"kind": "string",
"orgId": "string",
"orgName": "string",
"branding": {
"logoUrl": "string",
"theme": {}
},
"programs": [
{
"handle": "string",
"name": "string"
}
],
"portalTheme": {},
"consent": {
"mode": "cookiemunch",
"provider": "string",
"tags": [
{
"tag": "string",
"attrs": {},
"inline": "string"
}
],
"settingsLink": {
"call": "string",
"attrs": {}
},
"builtin": {
"policyUrl": "string",
"text": {}
}
},
"chat": {
"provider": "string",
"tags": [
{
"tag": "string",
"attrs": {},
"inline": "string"
}
]
},
"csp": "string"
}Option 1
kindstring
required
A merchant's verified partner-portal domain.
orgIdstring
required
orgNamestring
required
brandingobject
required
Show child parameters
logoUrlstring
required
themeobject
required
programsobject[]
required
The org's active programs with a public signup page (/join/:handle).
Show child parameters
handlestring
required
namestring
required
portalThemeobject
required
Portal design: colour scheme, brand lockup, font stylesheet, announcement, header and footer, home and navigation layout, string overrides, embed switches (the look itself is /v1/hosts/current/theme.css).
consentobject
required
Show child parameters
modestring
required
providerstring
required
tagsobject[]
required
Show child parameters
tagstring
required
attrsobject
required
inlinestring
settingsLinkobject
required
Show child parameters
callstring
attrsobject
builtinobject
Show child parameters
policyUrlstring
required
textobject
chatobject
required
Show child parameters
providerstring
required
tagsobject[]
required
Show child parameters
tagstring
required
attrsobject
required
inlinestring
cspstring
required
The Content-Security-Policy for this host's pages, built from the enabled adapters.
{
"kind": "string",
"orgId": "string",
"orgName": "string",
"branding": {
"logoUrl": "string",
"theme": {}
},
"programs": [
{
"handle": "string",
"name": "string"
}
],
"portalTheme": {},
"consent": {
"mode": "cookiemunch",
"provider": "string",
"tags": [
{
"tag": "string",
"attrs": {},
"inline": "string"
}
],
"settingsLink": {
"call": "string",
"attrs": {}
},
"builtin": {
"policyUrl": "string",
"text": {}
}
},
"chat": {
"provider": "string",
"tags": [
{
"tag": "string",
"attrs": {},
"inline": "string"
}
]
},
"csp": "string"
}Option 2
kindstring
required
A merchant's verified link domain.
cspstring
required
{
"kind": "string",
"csp": "string"
}Option 3
kindstring
required
Referalli's own app.
{
"kind": "string"
}400 The request is invalid.
error.code is one of:Example
{
"error": {
"code": "validation_error",
"message": "the body or query failed validation, an unknown field was sent, the body is not valid json, or a session call has no `x-org-id`",
"details": [
{
"code": "invalid_format",
"path": [
"destinationUrl"
],
"message": "Invalid URL"
}
],
"docs_url": "https://referalli.com/docs/errors-and-limits#validation_error"
}
}{
"error": {
"code": "mode_mismatch",
"message": "the `referalli-mode` header disagrees with the api key's mode",
"docs_url": "https://referalli.com/docs/errors-and-limits#mode_mismatch"
}
}{
"error": {
"code": "bad_request",
"message": "rejected by the http layer before the handler",
"docs_url": "https://referalli.com/docs/errors-and-limits#bad_request"
}
}{
"error": {
"code": "invalid_handoff_token",
"message": "`handofftoken` on `associate` is malformed, expired (24 hours), signed for another org, or its signature does not verify",
"docs_url": "https://referalli.com/docs/errors-and-limits#invalid_handoff_token"
}
}Schema
errorobject
required
Show child parameters
codestring
required
messagestring
required
detailsrequestIdstring
docs_urlstring
required
The docs entry for this error code: what it means and how to fix it.
Headers
x-request-idstring
This request's id (
req_…), matching the server logs. On every response.404 No such resource.
error.code is one of:Example
{
"error": {
"code": "not_found",
"message": "the resource does not exist in this org (ids from other orgs look the same), a referenced id does not exist, a list cursor is not in the list, or the endpoint does not exist",
"docs_url": "https://referalli.com/docs/errors-and-limits#not_found"
}
}{
"error": {
"code": "not_enrolled",
"message": "the user is not a partner in the program (and the widget's autoenroll is off, or no verified email was given)",
"docs_url": "https://referalli.com/docs/errors-and-limits#not_enrolled"
}
}Schema
errorobject
required
Show child parameters
codestring
required
messagestring
required
detailsrequestIdstring
docs_urlstring
required
The docs entry for this error code: what it means and how to fix it.
Headers
x-request-idstring
This request's id (
req_…), matching the server logs. On every response.429 Rate limited.
error.code is one of:Example
{
"error": {
"code": "rate_limited",
"message": "an endpoint limit or the per-key quota was exceeded",
"docs_url": "https://referalli.com/docs/errors-and-limits#rate_limited"
}
}Schema
errorobject
required
Show child parameters
codestring
required
messagestring
required
detailsrequestIdstring
docs_urlstring
required
The docs entry for this error code: what it means and how to fix it.
Headers
x-request-idstring
This request's id (
req_…), matching the server logs. On every response.Retry-Afterinteger
Seconds until a retry can succeed.
RateLimit-Limitinteger
The quota bucket's size (the burst).
RateLimit-Remaininginteger
Requests that can be made right now.
RateLimit-Resetinteger
Seconds until the bucket is full again.
500 Unexpected server error.
error.code is one of:Example
{
"error": {
"code": "internal_error",
"message": "retry with backoff",
"requestId": "req_8f2c1d4e5a6b7c8d",
"docs_url": "https://referalli.com/docs/errors-and-limits#internal_error"
}
}Schema
errorobject
required
Show child parameters
codestring
required
messagestring
required
detailsrequestIdstring
docs_urlstring
required
The docs entry for this error code: what it means and how to fix it.
Headers
x-request-idstring
This request's id (
req_…), matching the server logs. On every response.default Any other error, in the same envelope.
Example
{
"error": {
"code": "string",
"message": "string",
"details": {},
"requestId": "string",
"docs_url": "string"
}
}Schema
errorobject
required
Show child parameters
codestring
required
messagestring
required
detailsrequestIdstring
docs_urlstring
required
The docs entry for this error code: what it means and how to fix it.
Updated