# Suggest a registration from a website

Source: https://jointextkit.com/docs/api/registrations/prefill
Index: https://jointextkit.com/llms.txt

`POST /v1/registrations/prefill`

Reads the public pages of the website (homepage plus the sign-up, contact, privacy and terms pages it links to) and returns suggestions for a registration: business name, legal name when the site states one, use case, description, opt-in / privacy / terms URLs with ranked candidates, support email, contact phone, address and industry. Creates and files nothing. EIN and entity type are never suggested. Names, contact details and URLs are read with fixed rules; where drafting is available (ai: true) we draft the description, use case, industry and three starter example messages from the same public page text, and every field it returns is validated. Review the fields, then send them to POST /registrations (drafted examples as starter_messages, or as sample_messages once they are yours). One read per website per account every 10 minutes; 10 websites a minute.

Send your API key as a bearer token: `Authorization: Bearer ssms_sk_...`. Test keys run this endpoint against the [sandbox](/docs/sandbox); see [Authentication](/docs/authentication) for key modes and scopes.

## Request body

JSON (`Content-Type: application/json`).

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `website` | string (uri) | Yes | Example: `https://acmeplumbing.com`. |

## Responses

| Status | Meaning | Body |
| --- | --- | --- |
| 200 | Suggestions (reachable: false when the site could not be read) | `RegistrationPrefill` |
| 400 | Invalid website | `Error` |
| 401 | Missing, malformed, or revoked API key | `Error` |
| 402 | Billable live calls only: the prepaid credit balance cannot cover the call (insufficient_credits); nothing was done or charged | `Error` |
| 429 | Rate limit or quota exceeded | `Error` |

### 200: `RegistrationPrefill` fields

| Field | Type | Description |
| --- | --- | --- |
| `object` | `registration_prefill` |  |
| `reachable` | boolean | false = the website could not be read; fields then holds only the website |
| `error` | string | Why the site could not be read Nullable. |
| `fields` | object | Suggestions, shaped like RegistrationInput. Only fields we found are present. |
| `fields.website` | string (uri) |  |
| `fields.business_name` | string |  |
| `fields.use_case` | string |  |
| `fields.description` | string | At most 500 characters. |
| `fields.opt_in_url` | string (uri) |  |
| `fields.privacy_url` | string (uri) |  |
| `fields.terms_url` | string (uri) |  |
| `fields.support_email` | string (email) |  |
| `fields.sample_messages` | array of string | Starter drafts written for this business (drafting only). Send them as starter_messages. |
| `fields.brand` | object | Never includes ein or entity_type. |
| `fields.brand.legal_name` | string |  |
| `fields.brand.street` | string |  |
| `fields.brand.city` | string |  |
| `fields.brand.state` | string |  |
| `fields.brand.postal_code` | string |  |
| `fields.brand.country` | string |  |
| `fields.brand.vertical` | `PROFESSIONAL`, `REAL_ESTATE`, `HEALTHCARE`, `HUMAN_RESOURCES`, `ENERGY`, `ENTERTAINMENT`, `RETAIL`, `TRANSPORTATION`, `AGRICULTURE`, `INSURANCE`, `POSTAL`, `EDUCATION`, `HOSPITALITY`, `FINANCIAL`, `LEGAL`, `CONSTRUCTION`, `NGO`, `MANUFACTURING`, `GOVERNMENT`, `TECHNOLOGY`, `COMMUNICATION` |  |
| `fields.brand.contact_email` | string |  |
| `fields.brand.contact_phone` | string | A 10-digit US number for the business contact. Required to submit. |
| `suggested` | array of string | Dotted names of every field filled in, e.g. business_name, brand.city |
| `sources` | object | Where each suggested field came from: page = read from your pages by fixed rules; ai = drafted for you |
| `candidates` | object | Pages that could be the opt-in, privacy policy and terms, best first |
| `candidates.opt_in` | array of object |  |
| `candidates.opt_in[].url` | string (uri) |  |
| `candidates.opt_in[].confidence` | number | Maximum 1. Minimum 0. |
| `candidates.opt_in[].reason` | string |  |
| `candidates.privacy` | array of object |  |
| `candidates.privacy[].url` | string (uri) |  |
| `candidates.privacy[].confidence` | number | Maximum 1. Minimum 0. |
| `candidates.privacy[].reason` | string |  |
| `candidates.terms` | array of object |  |
| `candidates.terms[].url` | string (uri) |  |
| `candidates.terms[].confidence` | number | Maximum 1. Minimum 0. |
| `candidates.terms[].reason` | string |  |
| `about` | string | What the site says the business is (its meta description) Nullable. |
| `ai` | boolean | true when any of these suggestions were drafted rather than read from your pages |
| `policy_checks` | object | Whether the suggested privacy policy and terms pages pass the website check's rules for them (privacy: says mobile opt-in data is not shared; terms: SMS program terms with STOP and HELP). Fixed rules, never the model; false when that page was not suggested. |
| `policy_checks.privacy` | boolean |  |
| `policy_checks.terms` | boolean |  |

## Errors

| Status | When |
| --- | --- |
| 400 | Invalid website |
| 401 | Missing, malformed, or revoked API key |
| 402 | Billable live calls only: the prepaid credit balance cannot cover the call (insufficient_credits); nothing was done or charged |
| 429 | Rate limit or quota exceeded |

Every error has the same JSON shape, and `request_id` matches the `X-Request-Id` response header. [Errors](/docs/errors) lists every code and what to do about it.

```json
{
  "error": {
    "code": "invalid_request",
    "message": "What went wrong, in plain words.",
    "param": "the_field",
    "request_id": "req_a1B2c3D4e5F6g7H8"
  }
}
```

## Examples

### Node.js

The Node.js SDK does not wrap this endpoint yet; call it over HTTP.

```javascript
const res = await fetch('https://api.jointextkit.com/v1/registrations/prefill', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.TEXTKIT_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "website": "https://acmeplumbing.com"
  }),
});

if (!res.ok) throw new Error((await res.json()).error.message);
const data = await res.json();
```

### PHP

```php
<?php

$ch = curl_init('https://api.jointextkit.com/v1/registrations/prefill');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('TEXTKIT_API_KEY'),
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => json_encode([
        'website' => 'https://acmeplumbing.com',
    ]),
]);

$data = json_decode(curl_exec($ch), true);
```

### Python

The Python SDK does not wrap this endpoint yet; call it over HTTP.

```python
import json, os, urllib.request

req = urllib.request.Request(
    "https://api.jointextkit.com/v1/registrations/prefill",
    method="POST",
    headers={
        "Authorization": f"Bearer {os.environ['TEXTKIT_API_KEY']}",
        "Content-Type": "application/json",
    },
    data=json.dumps({
        "website": "https://acmeplumbing.com"
    }).encode(),
)
with urllib.request.urlopen(req) as res:
    data = json.load(res)
```

### Ruby

```ruby
require "net/http"
require "json"

uri = URI("https://api.jointextkit.com/v1/registrations/prefill")
req = Net::HTTP::Post.new(uri)
req["Authorization"] = "Bearer #{ENV["TEXTKIT_API_KEY"]}"
req["Content-Type"] = "application/json"
req.body = {
  "website": "https://acmeplumbing.com"
}.to_json

res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(req) }
data = JSON.parse(res.body)
```

### Go

```go
package main

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

func main() {
	body := strings.NewReader(`{
	  "website": "https://acmeplumbing.com"
	}`)
	req, _ := http.NewRequest("POST", "https://api.jointextkit.com/v1/registrations/prefill", body)
	req.Header.Set("Authorization", "Bearer "+os.Getenv("TEXTKIT_API_KEY"))
	req.Header.Set("Content-Type", "application/json")

	res, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer res.Body.Close()
	data, _ := io.ReadAll(res.Body)
	fmt.Println(res.Status, string(data))
}
```

### Rust

```rust
// cargo add reqwest --features blocking,json
// cargo add serde_json
use serde_json::json;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let key = std::env::var("TEXTKIT_API_KEY")?;
    let res = reqwest::blocking::Client::new()
        .post("https://api.jointextkit.com/v1/registrations/prefill")
        .bearer_auth(key)
        .json(&json!({
          "website": "https://acmeplumbing.com"
        }))
        .send()?
        .error_for_status()?;
    let data: serde_json::Value = res.json()?;
    println!("{data}");
    Ok(())
}
```

### Java

```java
import java.net.URI;
import java.net.http.*;

public class Main {
    public static void main(String[] args) throws Exception {
        var request = HttpRequest.newBuilder(URI.create("https://api.jointextkit.com/v1/registrations/prefill"))
            .header("Authorization", "Bearer " + System.getenv("TEXTKIT_API_KEY"))
            .header("Content-Type", "application/json")
            .method("POST", HttpRequest.BodyPublishers.ofString("""
                {
                  "website": "https://acmeplumbing.com"
                }
                """))
            .build();

        var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
        System.out.println(response.statusCode() + " " + response.body());
    }
}
```

### .NET

```csharp
using System.Net.Http.Headers;
using System.Text;

var http = new HttpClient();
http.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue(
    "Bearer", Environment.GetEnvironmentVariable("TEXTKIT_API_KEY"));

var body = new StringContent("""
    {
      "website": "https://acmeplumbing.com"
    }
    """, Encoding.UTF8, "application/json");
var res = await http.PostAsync("https://api.jointextkit.com/v1/registrations/prefill", body);
res.EnsureSuccessStatusCode();

var data = await res.Content.ReadAsStringAsync();
```

### cURL

```bash
curl -X POST "https://api.jointextkit.com/v1/registrations/prefill" \
  -H "Authorization: Bearer $TEXTKIT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "website": "https://acmeplumbing.com"
}'
```

## Related

- Guide: [Compliance & registration](/docs/compliance)
- [All registrations endpoints](/docs/api#registrations)
- [API reference](/docs/api)
