Attribute a new user (signed protocol)

Embed
Preview of the card
<a href="https://referalli.com/docs/ref-postv1authconnectionsidsignups"><img src="https://referalli.com/docs/_api/public/orgs/07f432f4-34b9-46a7-aaad-c0e395d2e4f9/spaces/2bf4f614-3630-4fbf-85f9-5ecafa6b7d97/pages/da1f79db-0e70-4623-a30d-853d37635c7c/social-card.svg?v=3e7ae33eec8b" alt="Attribute a new user (signed protocol)" width="600" height="315"></a>
POST https://referalli.com/v1/auth/connections/{id}/signups

The auth platform reports a new user with the referral context captured at sign-up (referral.code, or with cookie consent clickId/anonId) and optional risk signals. The user is attributed (risky sign-ups are held for review), optionally made a partner with their own link, and the answer says why with reason codes. test: true or atlas-test: 1 simulates without storing. Repeating the same user is idempotent. Signed with the connection secret in x-referalli-signature: t=<unix>,v1=…,v2=… (v2 also signs the request line; once a connection has seen v2 it requires it), with a unique x-referalli-id per call. The legacy header names from before the rename are also accepted, for existing integrations. Calls older than 5 minutes, reused ids (409 replay), paused connections (423 connection_paused) and unknown fields (422) are refused.

Auth: a signature (see above); no API key.

Parameters

id
string
path
required

Request body

application/json
customerRef
string
required
email
string
emailHash
string
name
string
ip
string
ua
string
signedUpAt
string
required
referral
object
Show child parameters
code
string
clickId
string
anonId
string
capturedAt
string
consent
string
granted | not_required = not_required
risk
object
Show child parameters
botScore
number
0 (human) to 1 (certainly a bot). A value above 1 and up to 100 is read as a percentage (85 → 0.85); above 100 is refused.
disposableEmail
boolean
emailVerified
boolean
selfReferral
boolean
velocity
integer
reasons
string[]
score
number
Overall risk, 0 (safe) to 1 (certainly fraudulent), compared with riskPolicy.holdRiskScore (default 0.8). A value above 1 and up to 100 (Atlas’s 0–100 scale) is read as a percentage (85 → 0.85); above 100 is refused.
level
string
low | medium | high
dropped
boolean
emailDomain
string
referralCode
string
autoEnroll
boolean
test
boolean
{
  "customerRef": "string",
  "email": "string",
  "emailHash": "string",
  "name": "string",
  "ip": "string",
  "ua": "string",
  "signedUpAt": "2024-01-01T00:00:00Z",
  "referral": {
    "code": "string",
    "clickId": "string",
    "anonId": "string",
    "capturedAt": "2024-01-01T00:00:00Z",
    "consent": "not_required"
  },
  "risk": {
    "botScore": 0,
    "disposableEmail": true,
    "emailVerified": true,
    "selfReferral": true,
    "velocity": 0,
    "reasons": [
      "string"
    ],
    "score": 0,
    "level": "low",
    "dropped": true
  },
  "emailDomain": "string",
  "referralCode": "string",
  "autoEnroll": true,
  "test": true
}

Code samples

cURL
curl -X POST "https://referalli.com/v1/auth/connections/{id}/signups" \
  -H "Content-Type: application/json" \
  -d '{"customerRef":"string","email":"string","emailHash":"string","name":"string","ip":"string","ua":"string","signedUpAt":"2024-01-01T00:00:00Z","referral":{"code":"string","clickId":"string","anonId":"string","capturedAt":"2024-01-01T00:00:00Z","consent":"not_required"},"risk":{"botScore":0,"disposableEmail":true,"emailVerified":true,"selfReferral":true,"velocity":0,"reasons":["string"],"score":0,"level":"low","dropped":true},"emailDomain":"string","referralCode":"string","autoEnroll":true,"test":true}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 OK
Example
{
  "test": true,
  "referral": {
    "id": "string",
    "partnerId": "string",
    "partnerExternalRef": "string",
    "matchedVia": "string",
    "status": "string",
    "persisted": true
  },
  "reasoning": {
    "notes": [
      "string"
    ],
    "codes": [
      "consent_missing"
    ]
  },
  "partner": {
    "id": "string",
    "code": "string",
    "link": "string",
    "persisted": true
  }
}
Schema
test
boolean
Present on a test signup ("test": true or atlas-test: 1): answered as a real call, nothing stored.
referral
object
required
Show child parameters
id
string
required
partnerId
string
required
partnerExternalRef
string
required
matchedVia
string
required
status
string
required
persisted
boolean
Test signups only: true when this referral already existed; false when it exists only in this answer.
reasoning
object
Show child parameters
notes
string[]
required
English, for people; wording may change.
codes
SignupReasonCode[]
required
One stable code per distinct reason behind notes, in order.
partner
object
Show child parameters
id
string
required
code
string
required
link
string
required
The partner's absolute tracked link (/go/{trackingToken}/{code}), on the org's verified link domain when it has one; null when they have only a coupon.
persisted
boolean
Test signups only: true when this partner already existed; false when it exists only in this answer.
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"
  }
}
Schema
error
object
required
Show child parameters
code
string
required
message
string
required
details
requestId
string
docs_url
string
required
The docs entry for this error code: what it means and how to fix it.
Headers
x-request-id
string
This request's id (req_…), matching the server logs. On every response.
401 Missing or invalid credentials. error.code is one of:
Example
{
  "error": {
    "code": "unauthorized",
    "message": "no credentials, an unknown, revoked or expired api key or session, or a signature that did not verify",
    "docs_url": "https://referalli.com/docs/errors-and-limits#unauthorized"
  }
}
Schema
error
object
required
Show child parameters
code
string
required
message
string
required
details
requestId
string
docs_url
string
required
The docs entry for this error code: what it means and how to fix it.
Headers
x-request-id
string
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"
  }
}
Schema
error
object
required
Show child parameters
code
string
required
message
string
required
details
requestId
string
docs_url
string
required
The docs entry for this error code: what it means and how to fix it.
Headers
x-request-id
string
This request's id (req_…), matching the server logs. On every response.
409 The request conflicts with the current state. error.code is one of:
Example
{
  "error": {
    "code": "conflict",
    "message": "a unique value is taken, or the action would break a rule (the message says which)",
    "docs_url": "https://referalli.com/docs/errors-and-limits#conflict"
  }
}
Schema
error
object
required
Show child parameters
code
string
required
message
string
required
details
requestId
string
docs_url
string
required
The docs entry for this error code: what it means and how to fix it.
Headers
x-request-id
string
This request's id (req_…), matching the server logs. On every response.
422 The request cannot be processed as sent. error.code is one of:
Example
{
  "error": {
    "code": "idempotency_key_reused",
    "message": "the `idempotency-key` was used for a different request",
    "docs_url": "https://referalli.com/docs/errors-and-limits#idempotency_key_reused"
  }
}
Schema
error
object
required
Show child parameters
code
string
required
message
string
required
details
requestId
string
docs_url
string
required
The docs entry for this error code: what it means and how to fix it.
Headers
x-request-id
string
This request's id (req_…), matching the server logs. On every response.
423 The connection is paused. error.code is one of:
Example
{
  "error": {
    "code": "connection_paused",
    "message": "the merchant paused this auth connection",
    "docs_url": "https://referalli.com/docs/errors-and-limits#connection_paused"
  }
}
Schema
error
object
required
Show child parameters
code
string
required
message
string
required
details
requestId
string
docs_url
string
required
The docs entry for this error code: what it means and how to fix it.
Headers
x-request-id
string
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
error
object
required
Show child parameters
code
string
required
message
string
required
details
requestId
string
docs_url
string
required
The docs entry for this error code: what it means and how to fix it.
Headers
x-request-id
string
This request's id (req_…), matching the server logs. On every response.
Retry-After
integer
Seconds until a retry can succeed.
RateLimit-Limit
integer
The quota bucket's size (the burst).
RateLimit-Remaining
integer
Requests that can be made right now.
RateLimit-Reset
integer
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
error
object
required
Show child parameters
code
string
required
message
string
required
details
requestId
string
docs_url
string
required
The docs entry for this error code: what it means and how to fix it.
Headers
x-request-id
string
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
error
object
required
Show child parameters
code
string
required
message
string
required
details
requestId
string
docs_url
string
required
The docs entry for this error code: what it means and how to fix it.
Updated