---
title: "Create a donor magic link"
description: "Generate a magic link for a donor to be used to login to the donor platform."
canonical: https://www.charitips.com/docs/api-reference/create-donor-magic-link
---

# Create a donor magic link

`POST /v1/authentication/magic-links/donors/{donorId}`

Generate a magic link for a donor to be used to login to the donor platform.

**Authentication**: Bearer access token.

## Parameters

- `donorId` (string, required)

## Errors

- 401 `Unauthorized`: The access token is missing, expired or invalid. Create a new one with your client id and secret, send it as `Authorization: Bearer <accessToken>`, then retry once. Sandbox tokens only work on api.sandbox.charitips.com. See https://www.charitips.com/docs/get-started/authentication.md.
- 403 `Donor platform is not enabled`: The donor's account has no enabled donor platform. Enable it first, then retry. See https://www.charitips.com/docs/api-reference/enable-donor-platform.md.
- 403 `API authentication is not allowed for this donor platform`: The donor platform does not list API in its `authSchemes`. Disable the donor platform, then enable it again with API in `authSchemes`. See https://www.charitips.com/docs/api-reference/enable-donor-platform.md.
- 403 `Account closed`: The account behind these credentials is closed: no token is issued and every call is refused, reads included. Contact Charitips to reopen it. See https://www.charitips.com/docs/api-reference/troubleshooting.md#calls-answer-403-account-not-active-account-not-validated-or-account-closed.
- 403 `Forbidden`: Your credentials cannot perform this action on this resource. An id from another account never answers 403: it is treated as unknown, with a 404 in the path or a 400 `Bad Request` in the body or the query. See https://www.charitips.com/docs/api-reference/errors.md.
- 404 `Donor not found`: No donor with this id belongs to the account as a whole: the id is wrong, or the donor was created with a donation, for one campaign only, and cannot sign in to the donor platform. Create the donor with create-donor. See https://www.charitips.com/docs/api-reference/create-donor.md.
- 404 `Not Found`: No resource with this id on your account and environment. An id that belongs to another account answers 404 too when it is in the path. Ids from the sandbox do not exist in production. See https://www.charitips.com/docs/get-started/sandbox.md.

## Example

```bash
curl -X POST https://api.sandbox.charitips.com/v1/authentication/magic-links/donors/<donorId> \
  -H "Authorization: Bearer $CHARITIPS_TOKEN"
```

```javascript
const response = await fetch('https://api.sandbox.charitips.com/v1/authentication/magic-links/donors/<donorId>', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.CHARITIPS_TOKEN}`,
  },
});
if (!response.ok) throw new Error(`${response.status} ${await response.text()}`);
const data = await response.json();
```

```python
import os, requests

response = requests.post(
    "https://api.sandbox.charitips.com/v1/authentication/magic-links/donors/<donorId>",
    headers={"Authorization": f"Bearer {os.environ['CHARITIPS_TOKEN']}"},
)
response.raise_for_status()
data = response.json()
```

## Response example (200, placeholder values)

```json
{}
```
