# Get a one-click setup URL

A signed link to the DNS provider's own page, where the owner approves the record.

POST `/api/v1/claims/{id}/domain-connect/url`

**cURL**

```shell
curl -X POST 'https://www.prufy.dev/api/v1/claims/clm_4b1f7c1e-52e7-4c0a-9a3b-7d2f0c6e8a10/domain-connect/url' \
  -b cookies.txt
```

**Node.js**

```javascript
// `cookie` is the session cookie that Create a claim returned.
const response = await fetch("https://www.prufy.dev/api/v1/claims/clm_4b1f7c1e-52e7-4c0a-9a3b-7d2f0c6e8a10/domain-connect/url", {
  method: "POST",
  headers: { cookie },
})
const data = await response.json()
```

**Python**

```python
import requests

# `session` is the requests.Session() that created the claim.
response = session.post("https://www.prufy.dev/api/v1/claims/clm_4b1f7c1e-52e7-4c0a-9a3b-7d2f0c6e8a10/domain-connect/url")
data = response.json()
```

Response 200 OK

```json
{
  "url": "https://dcc.godaddy.com/manage/v2/domainTemplates/providers/prufy.dev/services/ownership/apply?domain=yourcompany.com&redirect_uri=https%3A%2F%2Fwww.prufy.dev%2Fdomain-connect%2Freturn&state=Zr8s1nK4q0vXc2LmT7yBhJ5dWfE9oAiP3uGtR6eNwQk&token=xwqyp4hnsmgqxceo2xd6orgeay&sig=Jx3k...&key=_dcpubkeyv1"
}
```

This is Domain Connect: the provider shows the record and adds it when the owner agrees, so nobody copies anything. Each provider has to take our template on first, so it's off by default and this route answers `domain_connect_disabled`.

`domainConnect` on a claim says whether it's possible for that domain: `available` means the provider supports us, and `applyEnabled` says whether this server has the feature turned on.

Coming back from the provider proves nothing. We record that they sent the person back, then ask DNS like any other check.

## Authentication

Send the session cookie. Without it the answer is `unauthorized`. [How sessions work](https://www.prufy.dev/docs/authentication.md).

## Path parameters

`id` string required

The claim's id, from Create a claim or List claims. It starts with `clm_`.

## Response

`200 OK`, with every field below present. Times are ISO 8601 strings in UTC.

- `url` URL

  Where to send the owner. It's signed, and it works once.

## Errors

| Status | Kind | When |
| --- | --- | --- |
| 401 | `unauthorized` | The request has no session cookie, or one we don't recognise. |
| 404 | `not_found` | No claim has this id in your account. Another account's claim looks the same as one that doesn't exist. |
| 404 | `domain_connect_disabled` | The feature is turned off on this server. |
| 409 | `domain_connect_unavailable` | The claim isn't pending, or the domain's provider doesn't support our template. |

Any route can also answer `500` with `internal_error`. Every error has the same shape, described in [Errors](https://www.prufy.dev/docs/errors.md).

---

Every page of these docs, as a list: https://www.prufy.dev/llms.txt
