> ## Documentation Index
> Fetch the complete documentation index at: https://docs.partnero.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create sign-in URL

> Mint a single-use, short-lived URL that logs a partner straight into their portal dashboard

## Endpoint

```
POST https://api.partnero.com/v1/partners/{id}/sign-in-url
```

Generates a **single-use, short-lived** sign-in link. Redirect the partner to the returned `url` and they are logged into their portal dashboard without entering a password or one-time code. See the [Auto-login guide](/guides/partner-portal/single-sign-on) for the full flow.

<Note>
  Available for **affiliate** and **refer-a-friend** programs. For refer-a-friend, the "partner" is the referring customer. Call this endpoint **server-side** — it requires your secret API key.
</Note>

## Identifying the partner

You can pass the partner's ID in the path, or identify the partner in the request body. Use whichever fits your integration:

```
POST https://api.partnero.com/v1/partners/{id}/sign-in-url   # id in the path
POST https://api.partnero.com/v1/partners:sign-in-url         # identifier in the body
```

## Path parameters

| Parameter | Type   | Required | Description                                                                         |
| --------- | ------ | -------- | ----------------------------------------------------------------------------------- |
| `id`      | string | No       | Partner's unique ID. Required unless the partner is identified in the request body. |

## Request body

Provide at least one identifier (`id`, `key`, or `email`) unless the `id` is supplied in the path.

| Parameter    | Type    | Required | Description                                                                                             |
| ------------ | ------- | -------- | ------------------------------------------------------------------------------------------------------- |
| `id`         | string  | No       | Partner's unique ID.                                                                                    |
| `key`        | string  | No       | Partner's referral key.                                                                                 |
| `email`      | string  | No       | Partner's email address.                                                                                |
| `expires_in` | integer | No       | Link lifetime in seconds. Defaults to `120`. Min `30`, max `900`. Values outside the range are clamped. |

<Info>
  Identifiers are resolved by priority: `id`, then `key`, then `email`. Provide the one you have.
</Info>

## Request

```bash cURL theme={null}
curl --location 'https://api.partnero.com/v1/partners:sign-in-url' \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data-raw '{
    "email": "john.doe@partnero.com",
    "expires_in": 120
  }'
```

## Response

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "data": {
      "url": "https://partners.yourdomain.com/sso/8f3c...redacted",
      "expires_at": "2026-07-16T13:22:00.000000Z"
    },
    "status": 1
  }
  ```
</ResponseExample>

| Field        | Type   | Description                                                                    |
| ------------ | ------ | ------------------------------------------------------------------------------ |
| `url`        | string | The single-use sign-in URL on your portal's domain. Redirect the partner here. |
| `expires_at` | string | ISO-8601 timestamp when the link expires.                                      |

## Error responses

| Status | Error                                           | Solution                                                     |
| ------ | ----------------------------------------------- | ------------------------------------------------------------ |
| 400    | Partner "id", "key" or "email" must be provided | Include an identifier in the path or body                    |
| 404    | Partner not found                               | Check the identifier is correct for this program             |
| 422    | Validation failed                               | `expires_in` must be an integer between 30 and 900           |
| 429    | Too many requests                               | Limited to 60 requests per minute; retry after a short delay |

<Warning>
  Treat the returned `url` as a credential — it signs the partner in on first use. Deliver it only to the intended user and avoid logging it.
</Warning>

<Tip>
  Generate the link on demand, immediately before redirecting the partner. Because it is single-use and expires quickly, links created ahead of time are usually no longer valid when needed.
</Tip>
